APPEL D'UNE FONCTION DANS DLL
Bonjour à tous,
J'ai écrit une dll incluant notamment la fonction Initialize.
Je définis la fonction Initialize dans la dll comme suit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
extern "C" __declspec(dllexport) HRESULT CT4UDLL_MIDI::Initialize(void)
{
if (iNb_MidiPorts !=0)
{
CDMusic.Initialize(0,NULL);
CInPort.Initialize(CDMusic);
CInPort.GetPortInfo(1,&PortInfo);
return S_OK;
}
else
return E_FAIL;
} |
J'appelle dans le projet Initialize et j'arrive donc bien à :
CDMusic.Initialize(0,NULL);
Initialize est définie comme suit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
HRESULT CDirectMusic::Initialize(HWND hWnd,IDirectSound8* pDirectSound)
{
TCHAR strMembrFunc[] = _T("CDirectMusic::Initialize()");
HRESULT hr = S_OK;
if (FAILED(hr = CoCreateInstance(CLSID_DirectMusic,NULL,
CLSCTX_INPROC,IID_IDirectMusic8,(void**)&m_pMusic8)))
throw CDMusicException(strMembrFunc,hr,__LINE__);
if (FAILED(hr = m_pMusic8->SetDirectSound(pDirectSound,hWnd)))
throw CDMusicException(strMembrFunc,hr,__LINE__);
return S_OK;
} |
Premier problème : Lorsque je rentre dans Initialize, hWnd et pDirectSound ne sont pas égaux à 0,NULL
Deuxième problème:Le debugger s'arrête bien sur TCHAR strMembrFunc mais saute directement sur le "if" en ignorant HRESULT hr = S_OK; En déplaçant le curseur sur hr, hr demeure invisible alors que strMembrFunc l'est.
Je ne comprends pas trop.
Si vous aviez quelque idée ... Merci à tous