J
Jeffrey Walton
Hi All,
I'm working on a Website that uses ASP.Net. I need to call into a few
APIs, the first of which is CreateFile. CreateFile always fails with
INVALID_HANDLE_VALUE.
It seems that 'Dim sz As Integer = IntPtr.Size' returns 4 for the size
even though the docs state I should get 8 on x64 Vista [1]:
The IntPtr type is designed to be an integer whose size is
platform-specific. That is, an instance of this type is expected
to be 32-bits on 32-bit hardware and operating systems, and
64-bits on 64-bit hardware and operating systems.
When I replace the IntPtr to Long for the declaration of CreateFile, I
get a handle back. Unfortunately, the docs tell me otherwise [1], as
does a Visual Basic .NET sample (KB823179) demonstrating CreateFile
[2].
I did not see anything of interest under Solution and Project
properties. What's the trick to get an IntPtr on x64 VB/ASP.Net to
work as advertised?
Wasn't VB much more fun back in the 5.0 and 6.0 days before .Net? I
don't recall having so many problems with the language back then...
Thanks,
Jeff
[1] http://msdn.microsoft.com/en-us/library/system.intptr.aspx
[2] http://support.microsoft.com/kb/823179
I'm working on a Website that uses ASP.Net. I need to call into a few
APIs, the first of which is CreateFile. CreateFile always fails with
INVALID_HANDLE_VALUE.
It seems that 'Dim sz As Integer = IntPtr.Size' returns 4 for the size
even though the docs state I should get 8 on x64 Vista [1]:
The IntPtr type is designed to be an integer whose size is
platform-specific. That is, an instance of this type is expected
to be 32-bits on 32-bit hardware and operating systems, and
64-bits on 64-bit hardware and operating systems.
When I replace the IntPtr to Long for the declaration of CreateFile, I
get a handle back. Unfortunately, the docs tell me otherwise [1], as
does a Visual Basic .NET sample (KB823179) demonstrating CreateFile
[2].
I did not see anything of interest under Solution and Project
properties. What's the trick to get an IntPtr on x64 VB/ASP.Net to
work as advertised?
Wasn't VB much more fun back in the 5.0 and 6.0 days before .Net? I
don't recall having so many problems with the language back then...
Thanks,
Jeff
[1] http://msdn.microsoft.com/en-us/library/system.intptr.aspx
[2] http://support.microsoft.com/kb/823179