Jump to content
  • Advertisement


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


IDirectPlay8Peer help pls

This topic is 5716 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

i just started with directplay8 after lots of headaches and keyboard and mouse smashing with directplay3 i created the IDirectPlay8Peer obj with DirectPlay8Create(...) now when i call the enumerate function it returns strange error msg which is neither DPNERR_INVALIDPARAM nor PNERR_BUFFERTOOSMALL it is -2146073024. i dunno what it is but the main prob is that i cant get a list of the ServiceProviders . here is my code:
#include <dplay8.h>

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


// {5548930D-7262-11d7-AE23-0048541FE02B}

GUID gAppGUID  = { 0x5548930d, 0x7262, 0x11d7, 0xae, 0x23, 0x0, 0x48, 0x54, 0x1f, 0xe0, 0x2b };


int mpInitialize()
	DWORD numSP = 16;
	DWORD retSP = 0;
	int hr = DirectPlay8Create(&IID_IDirectPlay8Peer, (void **)&dp, NULL);
	if (hr)	
		lprintf("Cannot initialize DirectPlay\n", hr);		
//		return SYS_ERR;


	hr = dp->EnumServiceProviders(NULL, NULL, dpSPs, &numSP, &retSP, 0);

	if (hr != S_OK)
		switch (hr)
			case DPNERR_BUFFERTOOSMALL: lprintf("buffer err\n"); break;
			case DPNERR_INVALIDPARAM: lprintf("Invalid param\n"); break;
		lprintf("Cannot enumerate SPs (code %d) \n", hr);
		return SYS_ERR;

	return SYS_OK;

does anyone know of a good DirectPlay8Peer tutorial , in the SDK the samples are filled with lots of unneeded crap

Share this post

Link to post
Share on other sites
I would suggest looking at the SDK tutorials. They are in the same directory as the samples, but they don''t use any of the common code, use the console for IO, and thus are much easier to understand.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!