0 Members and 1 Guest are viewing this topic.
error C3861: 'GetHandle': identifier not found
class InfoMFD::InfoMFD (DWORD w, DWORD h, VESSEL2 *vessel): MFD (w, h, vessel){ MyID=ConnectToOrbiterSoundDLL3(GetHandle()); RequestLoadVesselWave3(MyID,DING,"Sound\\ding.wav",INTERNAL_ONLY); RequestLoadVesselWave3(MyID,MYDING,"Sound\\dingdong.wav",INTERNAL_ONLY); RequestLoadVesselWave3(MyID,HORROR,"Sound\\horror.wav",INTERNAL_ONLY);}
#ifndef __HEADERFILE_H#define __HEADERFILE_Hclass InfoMFD: public MFD { void clbkPostCreation(void); int MyID;public: InfoMFD (DWORD w, DWORD h, VESSEL2 *vessel); ~InfoMFD (); bool ConsumeKeyBuffered (DWORD key); //-----------------sounds------------------------------------------------------------- #define DING 1 #define MYDING 2 #define HORROR 3 //------------------------------------------------------------------------------------ void Update (HDC hDC); static int MsgProc (UINT msg, UINT mfd, WPARAM wparam, LPARAM lparam);private: void ShowColors(const HDC hDC, const int y, const char *name, const COLORREF c1, const COLORREF c2, const COLORREF c3);};#endif
EtherDragon wrote:I think you're suffering from a lack of knowledge on our parts. I don't have any advice. Maybe Dan can have a look when he's feeling better?
Your bug is here:Code:MyID=ConnectToOrbiterSoundDLL3(GetHandle());GetHandle() is a method of the VESSEL class, not an MFD class, therefore you can't use it like this.This should work:Code:MyID=ConnectToOrbiterSoundDLL3(oapiGetFocusObject());Another alternative:MyID=ConnectToOrbiterSoundDLL3(oapiGetObjectByName(NAME));orMyID=ConnectToOrbiterSoundDLL3(oapiGetVesselByIndex(inx));