Estoy compilando un codigo con codedom y ese codigo crea un gancho "hook" de esta forma:
Public Sub New()
HHookID = SetWindowsHookEx(WH_KEYBOARD_LL, KBDLLHookProcDelegate, _ System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly. _ GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
If HHookID = IntPtr.Zero Then
messagebox.show("Could not set keyboard hook")
End If
End Sub
Pero el gancho no se crea. Sin embargo el gancho se crea sin el codedom.
Cualquier ayuda me vendria bien.
Creo que es algo de interopservices.marshal, pero no se como declararlo en memoria.
Alguien me guia un poco?