Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ilici

DPlay Problem

This topic is 5575 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi i'm using the old style DirectPlayCreate(..) to init DPlay before i do the DirectPlayEnumarate(...) 2 get the guids. after i get the guids, i cannot init Dplay with DirectPlayCreate(...) it gives me DPERR_UNAVAILABLE here is the code:
    
#include <dplay.h>
#include "log.h"

#pragma comment (lib, "dplay.lib")
#pragma comment (lib, "dplayx.lib")
#pragma comment (lib, "dxguid.lib")

LPDIRECTPLAY	dp;

bool	mpIPX		= false;
bool	mpTCPIP		= false;
bool	mpSERIAL	= false;
bool	mpMODEM		= false;

GUID	mpIPXguid;
GUID	mpTCPIPguid;
GUID	mpSERIALguid;
GUID	mpMODEMguid;

BOOL FAR PASCAL mpEnumConnections( 
    LPGUID      lpguidSP,
    LPSTR       lpSPName,
    DWORD       dwMajorVersion,     
    DWORD       dwMinorVersion,
    LPVOID      lpContext)
{

	if (strcmp(lpSPName, "IPX Connection For DirectPlay") == 0)
	{
		mpIPX = true;
		mpIPXguid = *lpguidSP;
		return TRUE;
	}

	if (strcmp(lpSPName, "Internet TCP/IP Connection For DirectPlay") == 0)
	{
		mpTCPIP = true;
		mpTCPIPguid = *lpguidSP;
		return TRUE;
	}

	if (strcmp(lpSPName, "Modem Connection For DirectPlay") == 0)
	{
		mpMODEM = true;
		mpMODEMguid = *lpguidSP;
		return TRUE;
	}

	if (strcmp(lpSPName, "Serial Connection For DirectPlay") == 0)
	{
		mpSERIAL = true;
		mpSERIALguid = *lpguidSP;
		return TRUE;
	}
	return TRUE;
}

int mpGetConnections()
{
	int hr;

	hr = DirectPlayEnumerate(mpEnumConnections, 0);

	if (hr)
	{
		lprintf("Cannot Enumerate SPs\n");
		return SYS_ERR;
	}

	return SYS_OK;
}

int mpInitialize()
{
	if (mpGetConnections()) return SYS_ERR;

	int hr = DirectPlayCreate(&mpIPXguid, &dp, NULL);

	//{685BC400-9D2C-11cf-A9CD-00AA006886E3} this is the GUID in the registry and i get it from Enumarate


	if (hr != DP_OK)
	{
		switch (hr)
		{
			case CLASS_E_NOAGGREGATION :	lprintf("CLASS_E_NOAGGREGATION  "); break;
			case DPERR_EXCEPTION :			lprintf("DPERR_EXCEPTION  ");break;
			case DPERR_INVALIDPARAMS  :		lprintf("DPERR_INVALIDPARAMS  "); break;
			case DPERR_UNAVAILABLE :		lprintf("UNAVAIABLE CONNECTION"); break;
		}

		lprintf("Cannot initialize DirectPlay\n", hr);
		return SYS_ERR;
	}
	
	return SYS_OK;

}
    
i have DX9 i dont like the CoCreateInstance(...) it suxx coz it makes my app multi-threaded and stuff is there a prob with my code or is the damn DX? [edited by - Ilici on April 18, 2003 1:22:07 PM]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!