directplay how to bypass the enumconnection and the enumsession

Hello All i can do a small program like a chat with the dialog that ask the user to
choose their provider like tcpip or IPX or .... and assk the user to choose the session
in this provider. but i dont want to do it each time i connect

what should i do to connect directly to a server like a tcpic computer via a specific address

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rejected without any comments. What do you want?
You need to create a IDirectPlayLobby interface and use the CreateCompoundAddress() function.  I use code similar to this.

char m_lpConData[256];
char m_lpConAddr[256];

// Reset the data
void Reset(void)
    m_nCurConElement = 0;
    m_lpConDataPtr = m_lpConData;

// To add to the address
void AddConData(GUID guid, int nDataSize, char *szData)
    // Add the next element
    m_lpAddressElements[m_nCurConElement].guidDataType = guid;
    m_lpAddressElements[m_nCurConElement].dwDataSize = nDataSize;
    m_lpAddressElements[m_nCurConElement].lpData = m_lpConDataPtr;

    // Copy the data
    memcpy(m_lpConDataPtr, szData, nDataSize);

    // Now increase the pointers
    m_lpConDataPtr += nDataSize;

To create say a TCPIP connection you would do

_ServiceProvider, sizeof(GUID), DPSPGUID_TCPIP);
AddConData(DPAID_INet, 13, "");

int nTotalSize = 256;

lpDirectLobby->CreateCompoundAddress(m_lpAddressElements, m_nCurConElement, m_lpConAddr, &nTotalSize);

lpDirectLobby->InitializeConnection(m_lpConAddr, 0);

This sets up a compound address with the provider of TCPIP and the address to connect to.  The address is then created and initialised.

Hope this helps, for more info see the SDK
DirectPlay->DirectPlay Essentials->DirectPlay Address

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.