direct input in dev-c++ (specific problem)


#1

I’m working through various tutorials re:directx and direct input and am coming up with a strange error. I can compile everything up to the setDataFormat function of the direct input part of the program. everything compiles and links fine, but I get an error message when I try to run the program saying “The procedure entry point c_dfDIMouse could not be located in the dll dinput.dll”

this happens regardles of the data format (ie c_dfDIMouse, c_dfDIKeyboard, c_dfDIMouse2…)

I’ve linked to every single file in the dx9 lib file thinking it could be a linking error, but that was not the case

I’ve tried different dinput dll’s but that did not work.

(I’m using dev-c++, by the way.)


#2

Are you using a .DEF file? (I’m pretty newbish on dll exporting). But I had similar problems for 2 month’s because I forgot to specify a .DEF file.

I’m hoping to learn some too.


#3

dinput.lib is included in support of older versions as i recall. with dx9 you are supposed to link dinput8.lib, and it works for me on VS .NET. must be a compiler problem. can dev-C++ even read MS LIB files or is there some sort of converter?

btw alpine, in VS you don’t really need a DEF file unless you really need to control how your functions/classes/variables are exported.


#4

Actually, i found my error. it wasn’t anything to do with the linker at all. I have the file structure split up so the direct input is managed with a class and has functions that initialise/shutdown dinput. I didn’t include this diMgr.h file in main.cpp . also didn’t getInstance of the diMgr object. Strange it didn’t error me earlier in the code. In diMgr:

// Create the DirectInput object. 
hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION, 
                        IID_IDirectInput8, (void**)&g_lpDI, NULL); 

if FAILED(hr) 
	return FALSE; 

// Retrieve a pointer to an IDirectInputDevice8 interface 
hr = g_lpDI->CreateDevice(GUID_SysMouse, &g_lpDIDevice, NULL); 
if FAILED(hr)
	return FALSE; 

hr = g_lpDIDevice->SetDataFormat(&c_dfDIMouse); 
MessageBox(wndHandle, "Mouse DI Aquired", "STATUS", MB_OK);
if FAILED(hr)
	return FALSE; 

No error until the SetDataFormat function call. Interface was created without initializing the managing class.


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.