• Welcome to Valhalla Legends Archive.
 

Need help on MSVC++ socket error

Started by R.a.B.B.i.T, April 12, 2005, 07:01 PM

Previous topic - Next topic

R.a.B.B.i.T

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.

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

R.a.B.B.i.T

Because I'm still fairly new to MFC, and that's what the control uses (which was created by MFC).

MyndFyre

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?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

R.a.B.B.i.T

The m_sock variable is a CMSWinsockControl, which is the only option available.

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

R.a.B.B.i.T

Thanks, I don't have any problems now (so far).  I didn't know about those :D