473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Calling C++ DLL from VB.NET

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
Nov 22 '05 #1
2 2564
longs are 64 bit in .NET

Willy.

"Michael" <mk*****@yahoo.com> wrote in message
news:06****************************@phx.gbl...
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

Nov 22 '05 #2
longs are 64 bit in .NET

Willy.

"Michael" <mk*****@yahoo.com> wrote in message
news:06****************************@phx.gbl...
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

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
7
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
2
by: Geler | last post by:
A theoretical question: Sorry if its a beginner question. Here is a quote from the MSDN explaning the C/C++ calling convention.. It demonstrates that the calling function is responsible to clean...
47
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
10
by: sulekhasweety | last post by:
Hi, the following is the definition for calling convention ,which I have seen in a text book, can anyone give a more detailed explanation in terms of ANSI - C "the requirements that a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.