Hi,
My dev computer is 64 bit Windows 7.
I use the IntPtr variable in several classes throughout my application.
When I compile the .msi file on my 64 bit computer, then install and then run it in a 32 bit environment I get 'System.MissingMethodException: Method not found ...get_HWND' error messages. The stack trace basically points to the portion of my method arguments that's expecting an IntPtr.
It appears when the code was compiled in my 64 dev environment it compiles the 64 version of IntPtr. I was half hoping for a place holder variable that would call, at runtime, the correct IntPtr depending on the environment.
Is there a way to build classes to delay the compiling of IntPtr until runtime? I.e. is there a generic IntPtr or method of using the IntPtr variable that will prevent this type of runtime error?
I would really like a way to compile the program once and have it run in either 32 or 64 environments.
Here is a snippet from a method's constructor that is expecting an IntPtr
Public Sub New(ByVal handle_1 As IntPtr, ByVal formsHandle As IntPtr)
_handle_1 = handle_1
_formsHandle = formsHandle
If _formsHandle = 0 OrElse _handle_1 = 0 Then
' log issue
Exit Sub
End If
Timer1 = New Timer
Timer1.Interval = 1000
' Timer1.Start()
End Sub