Re: VB5 Long & Double to VB.NET
- From: "Terry" <news-grps@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Jan 2007 00:19:01 -0000
Hi Tom,
Thanks for the help. Long to int32 did the trick. As I am calculating
astrological positions I find that there are some small differences between
the Access VBA results and VB.NET for the Sun and Moon of a couple of arc
seconds each that I will need to check out, apart from that all is working
out just fine now. It's great to finally get my first VB.NET solution
working thanks.
Regards
Terry
"Tom Shelton" <tom_shelton@xxxxxxxxxxx> wrote in message
news:1169497591.732089.96660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Terry wrote:
I have some old VB5 functions that specify types of Long and Double that
make calls to an unmanaged 3rd party DLL probably just as old. The source
for the DLL is not available.
I'm getting some warnings "PInvoke..unbalanced stack..." etc. Reading up
a
bit on this and trying to understand this particular warning, I find that
part of the problem could be in the mismatch of allocated space for the
variables, e.g. VB5 Long is not the same as VB2005 Long.
Another part is to do with the CallingConvention and for this I'm not
all
too sure how to set this up.
Have I understood this warning and is there something that may be done to
correct the problem? I will add that I am converting an Access 2K3 VBA
application to VB.NET 2005. In the Access app all worked OK.
Regards
Terry - the problem is most likely data size. Up until .NET, you
couldn't call anything but stdcall functions with declare statements
(without hacks). VB.NET will let you call cdecl, but stdcall is the
default.
In VB5/6 a Long was 32-bit. In VB.NET it is 64-bit. You need to
change it to Integer (32-bit in VB.NET). If making your datatypes the
right size doesn't fix the issue - then you might want to post the
function declarations (old and new).
--
Tom Shelton
.
- Follow-Ups:
- Re: VB5 Long & Double to VB.NET
- From: Fabio Z
- Re: VB5 Long & Double to VB.NET
- References:
- VB5 Long & Double to VB.NET
- From: Terry
- Re: VB5 Long & Double to VB.NET
- From: Tom Shelton
- VB5 Long & Double to VB.NET
- Prev by Date: Re: Creating an array
- Next by Date: Re: Print Active Access Window Using VB
- Previous by thread: Re: VB5 Long & Double to VB.NET
- Next by thread: Re: VB5 Long & Double to VB.NET
- Index(es):
Relevant Pages
|
Loading