Problem with DirectInput8Create while debugging

Started by
1 comment, last by varungang 18 years, 4 months ago
Hi, i am a newbie...here is my code.....

BOOL cInput::Init(HWND hWnd, HINSTANCE hInst)
{
  // Free a prior Init
  Shutdown();
  // Record parent Window handle
  m_hWnd = hWnd;
  // Create a DirectInput interface  \\m_pDI =    NULL;
  if(FAILED(DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&m_pDI, NULL)))
  return FALSE;
  // Return a success
  return TRUE;
}
i use VC++ 6.0 and directx 9 sdk can anybody tell me whats wrong with this code ,it compiles n runs fine but while debugging at line "DirectInput8Create" it exits to the assembly gives dialog "userbreakpoint called at .....".here the hInst is valid...n even rest seems fine for me.any kind of help is welcomed. thanks in advance... [Edited by - Muhammad Haggag on November 28, 2005 4:36:09 AM]
Advertisement
1. Please read the GDNet Forums FAQ for the general rules, then the Forum FAQ for forum-specific rules.

2. Regarding your problem, where do you get the HINSTANCE and HWND from? Do you get any debug output? What's the value of the returned HRESULT?

Thanks a lot for replying...
i call this from another class
m_Input.Init(GethWnd(), GethInst());
GethWnd(),GethInst() returns the handler(m_hWnd) and the instace of the window( m_hInst) respectively....
m_hWnd = CreateWindow(m_Class, m_Caption,WS_OVERLAPPEDWINDOW,
m_XPos, m_YPos,
m_Width, m_Height,
NULL, NULL, m_hInst, NULL);


the debugging escapes to disassembly as it leaves the line DirectInput8Create so i dont get to know what it returns...

hope so this will do
regards



This topic is closed to new replies.

Advertisement