By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,903 Members | 2,075 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,903 IT Pros & Developers. It's quick & easy.

Why provide examples that do not compile??!

P: n/a
I am new to .NET and to DirectInput so I tried to follow the c++ examples
about using DirectInput to get joystick input.

Copied the code for 'step 1'
: -
HRESULT hr;

hr = DirectInput8Create(g_hinst, DIRECTINPUT_VERSION, IID_IDirectInput8,
(void**)&g_lpDI, NULL);

if(FAILED(hr))

{

//oops

}

g_hinst & g_lpDI have been declared.

I have inserted the dinput.h and dinput8.lib files into my project and
included the .h file where required. The code compiles but fails to link due
to: -

GamePM error LNK2001: unresolved external symbol _IID_IDirectInput8A

IID_IDirectInput8A comes from the define statement in dinput.h that creates
IID_IDirectInput8. IID_IDirectInput8A appears in a

DEFINE_GUID(IID_IDirectInput8A,
0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED, 0x36,0x97,0x00);

I have find the definition of DEFINE_GUID and that appears to declare a
struct with name IIF_IDirectInput8A and initialise that struct with the
values supplied. All well and good except I do not know why it all will not
link. As always seems to be the case the info in 'help' is very interesting
and wide ranging etc but so far of no help! I am not really sure how to sort
this one out.

I guess it is something so damn obvious it is not worth documenting or it is
but where?

Any suggestions?

Regards

Mike
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.