Okay, so I'm using MFC, right? Well, that's all fine and dandy. I've got my form, I've got my classes, member variables, all that shit. My problem, however, is the following:
void void CIde_testDlg::OnGet()
{
tagVARIANT addr;
tagVARIANT port;
addr.pcVal = "valhallalegends.com";
port.intVal = 80;
m_sock.Connect(addr, port);
}
Everything compiles fine, but when I click the "Get" button, a message box pops up and says "Unsupported variant types". Google and MSDN failed to help me figure out what's going on, so I hope someone here knows.
Why are you using VARIANT structures for your data? Why not just your normal everyday types?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_casyncsocket.3a3a.connect.asp talks about the overloaded CAsyncSocket::Connect method.
Because I'm still fairly new to MFC, and that's what the control uses (which was created by MFC).
Quote from: rabbit on April 12, 2005, 08:31 PM
Because I'm still fairly new to MFC, and that's what the control uses (which was created by MFC).
I guess I still don't understand. You're not using an actual MFC socket object (CAsyncSocket or CSocket), but another control that was created *using* MFC?
What
type is the m_sock variable?
The m_sock variable is a CMSWinsockControl, which is the only option available.
Quote from: rabbit on April 12, 2005, 08:58 PM
The m_sock variable is a CMSWinsockControl, which is the only option available.
Do you *need* to use a control? MSDN returns nothing when I search for that type.
If you're using MFC, why not just use the built-in CAsyncSocket or CSocket classes? These are part of MFC.
Thanks, I don't have any problems now (so far). I didn't know about those :D