hi,
I'm writing a directinput external for PD (does this already exist???), and I need to pass one of the api functions a handle to the window that owns the input device I'm creating... what window handle should I pass and how do I get that handle? previously, my code was running in an mfc dialog box as a stand-alone application and I could just do GetSafeHWnd() to get the dialog's handle. What should I do now?
Thanks,
bert
I do somthing like this in the Vst~ plugin - either download the source code (http://www.junklight.com/pd) or I'll send an email tomorrow when I get back to work and have a look myself.
cheers
mark
-----Original Message----- From: Bert Schiettecatte [mailto:bschiett@stanford.edu] Sent: 30 April 2002 01:59 To: pd-list@iem.kug.ac.at Subject: [PD] window handle in pd external?
hi,
I'm writing a directinput external for PD (does this already exist???), and I need to pass one of the api functions a handle to the window that owns the input device I'm creating... what window handle should I pass and how do I get that handle? previously, my code was running in an mfc dialog box as a stand-alone application and I could just do GetSafeHWnd() to get the dialog's handle. What should I do now?
Thanks,
bert
hi,
thanks for the hint. I'll use GetForegroundWindow() and hope it works. I get a nasty error now when compiling my external in visual studio .net:
c:\Documents and Settings\bschiett\My Documents\Visual Studio Projects\dinput\dinput.c(64): error C2039: 'CreateDevice' : is not a member of 'IDirectInput8A'
I've included <dinput.h> ... I don't understand what could be wrong with my code. the external struct looks like this
typedef struct _dinput { t_object x_obj;
t_int m_devid; // device number (index in list of available devices)
t_int m_nrdevs; // number of devices available
t_int m_currdev; // device counter for enumeration
t_int m_nrbuttons; // nr of buttons found on device (check through caps)
t_int* m_buttons; // array of button numbers passed to object
t_int* m_newstate; // state for buttons
t_outlet* m_outlets; // outlets for object
t_float m_value; // just for holding temp list values
LPDIRECTINPUT8 m_di; // directinput interface
LPDIRECTINPUTDEVICE8 m_dev; // device this object gives access to
} t_dinput;
thanks,
bert
-----Original Message----- From: mark [mailto:mark@junklight.com] Sent: dinsdag 30 april 2002 12:22 To: Bert Schiettecatte; pd-list@iem.kug.ac.at Subject: RE: [PD] window handle in pd external?
I do somthing like this in the Vst~ plugin - either download the source code (http://www.junklight.com/pd) or I'll send an email tomorrow when I get back to work and have a look myself.
cheers
mark
-----Original Message----- From: Bert Schiettecatte [mailto:bschiett@stanford.edu] Sent: 30 April 2002 01:59 To: pd-list@iem.kug.ac.at Subject: [PD] window handle in pd external?
hi,
I'm writing a directinput external for PD (does this already exist???), and I need to pass one of the api functions a handle to the window that owns the input device I'm creating... what window handle should I pass and how do I get that handle? previously, my code was running in an mfc dialog box as a stand-alone application and I could just do GetSafeHWnd() to get the dialog's handle. What should I do now?
Thanks,
bert