M
Marauderz
The fun never ends with P/Invoke does it? Anyway I'm trying to call the
function SHChangeNotifyRegister which is defined as :-
BOOL WINAPI SHChangeNotifyRegister (
HWND hwnd,
SHCHANGENOTIFYENTRY * pshcne );
-----
It needs a pointer to a SHCHANGENOTIFYENTRY structure which looks like this
typedef struct tagSHCHANGENOTIFYENTRY {
DWORD dwEventMask;
LPTSTR pszWatchDir;
BOOL fRecursive;
} SHCHANGENOTIFYENTRY;
-------
This is the definitions I used for the function and structure
<DllImport("coredll.dll")> _
Public Shared Function SHChangeNotifyRegister(ByVal hwnd As IntPtr,
ByVal oNotify As SHChangeNotifyEntry) As Int32
End Function
Public Class SHChangeNotifyEntry
Public EventMask As Int32
Public WatchDir As String
Public Recursize As Int32
End Class
--------
But I'm getting a NotSupported exception when I call it.. can someone tell
me what I'm doing wrong? As MY SHChangeNotifyEntry is a class and all
classes are passed via it's pointer I CAN pass it ByVal to the Native DLL
right?
Thanks for any help guys
Marauderz
function SHChangeNotifyRegister which is defined as :-
BOOL WINAPI SHChangeNotifyRegister (
HWND hwnd,
SHCHANGENOTIFYENTRY * pshcne );
-----
It needs a pointer to a SHCHANGENOTIFYENTRY structure which looks like this
typedef struct tagSHCHANGENOTIFYENTRY {
DWORD dwEventMask;
LPTSTR pszWatchDir;
BOOL fRecursive;
} SHCHANGENOTIFYENTRY;
-------
This is the definitions I used for the function and structure
<DllImport("coredll.dll")> _
Public Shared Function SHChangeNotifyRegister(ByVal hwnd As IntPtr,
ByVal oNotify As SHChangeNotifyEntry) As Int32
End Function
Public Class SHChangeNotifyEntry
Public EventMask As Int32
Public WatchDir As String
Public Recursize As Int32
End Class
--------
But I'm getting a NotSupported exception when I call it.. can someone tell
me what I'm doing wrong? As MY SHChangeNotifyEntry is a class and all
classes are passed via it's pointer I CAN pass it ByVal to the Native DLL
right?
Thanks for any help guys
Marauderz