PC Review


Reply
Thread Tools Rate Thread

Calling C++ DLL from VB.NET

 
 
Michael
Guest
Posts: n/a
 
      9th Dec 2003
Ok this is driving me crazy. I have a simple DLL written
in VC ++ version 6.0. Lets take this for example..

long _stdcall Login()
{
return 123;
}

I aslo have the EXPORTS call in the DEF file like so

EXPORTS
Login @1

Now If I call this function from a VB version 6 app I get
a return value of 123 as expected, BUT if I run this from
a VB.NET app I get a weird number like 5332356516808378.
Has anyone seen this before. My function for both VB apps
is ..

Public Declare Function Login Lib "testDLL5.dll" () As
Long

Please help !!

-Michael
 
Reply With Quote
 
 
 
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
longs are 64 bit in .NET

Willy.

"Michael" <(E-Mail Removed)> wrote in message
news:060201c3bdff$88996410$(E-Mail Removed)...
> Ok this is driving me crazy. I have a simple DLL written
> in VC ++ version 6.0. Lets take this for example..
>
> long _stdcall Login()
> {
> return 123;
> }
>
> I aslo have the EXPORTS call in the DEF file like so
>
> EXPORTS
> Login @1
>
> Now If I call this function from a VB version 6 app I get
> a return value of 123 as expected, BUT if I run this from
> a VB.NET app I get a weird number like 5332356516808378.
> Has anyone seen this before. My function for both VB apps
> is ..
>
> Public Declare Function Login Lib "testDLL5.dll" () As
> Long
>
> Please help !!
>
> -Michael



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling SQL from code has different behaviour than calling it from MS SQL Server Management Studio jeeji Microsoft C# .NET 1 29th Jun 2006 10:43 AM
Calling DoCmd.RunCommand acCmdSaveRecord, after calling an API function Savvoulidis Iordanis Microsoft Access Form Coding 2 19th Mar 2005 06:34 PM
Fail to send fax when making international fax calling / calling c =?Utf-8?B?c2Ftd2lzZQ==?= Windows XP Help 1 28th Dec 2004 02:31 PM
Calling FormsAuthentication.SignOut() after calling Response.Flush =?Utf-8?B?TWFydGluIExlZQ==?= Microsoft ASP .NET 1 28th Sep 2004 01:47 PM
Server Side button calling page_load before calling it's own click event. Ryan Ternier Microsoft ASP .NET 4 29th Jul 2004 02:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.