473,324 Members | 2,166 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,324 software developers and data experts.

Cal Dll was written by VC++ in VB

Hi, I want to call a function int* TestCall(int ref1,int
&ref2,int n) in <MyDll.dll> file.That was written in VC++6.0. How can i
call this function in VB.
Please help me!
Thanks!

May 27 '06 #1
6 1050
Hai,
Add a reference to the DLL file by Right Clicking the project name in
the solution explorer. Once the reference is set, you should be able to
call the function TestCall..You might have to even register the DLL
file using RegSvr32.exe from .NET command prompt..

Hope it helps.

May 27 '06 #2
Here's a good example of doing exactly what you want:

http://www.gotdotnet.com/Community/U...2-CA46EF086C12
"Zicovn" <ng***********@gmail.com> wrote in message
news:11**********************@38g2000cwa.googlegro ups.com...
Hi, I want to call a function int* TestCall(int ref1,int
&ref2,int n) in <MyDll.dll> file.That was written in VC++6.0. How can i
call this function in VB.
Please help me!
Thanks!

May 27 '06 #3
Only if its a NON MFC C++ DLL & normally wouldn't need to register it
"IdleBrain" <in**************@yahoo.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hai,
Add a reference to the DLL file by Right Clicking the project name in
the solution explorer. Once the reference is set, you should be able to
call the function TestCall..You might have to even register the DLL
file using RegSvr32.exe from .NET command prompt..

Hope it helps.

May 27 '06 #4
Hi ,Peter
My proplem is not how to call Dll function in VB, my strong problem
is how to declare pointer in VB6 that is returned fron function.
Please help me,thanks

May 29 '06 #5
Unfortunately, there are several choices how this could be translated:
1) if a single pointer is returned, you could return an 'IntPtr'
2) if the pointer points to multiple integers, declare the function as
returning 'integer array'.
Can you show us how it's used in existing C++ code?
Good luck!
george
http://code2code.net - C++ to C# and VB.Net translation engine

"Zicovn" <ng***********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi ,Peter
My proplem is not how to call Dll function in VB, my strong problem
is how to declare pointer in VB6 that is returned fron function.
Please help me,thanks

May 29 '06 #6
Hi Gmou,
My pointer i said below points to the first element of interger
array.In "MyDll.dll" file have a function declared that int*
TestCall(int ref1,int ref2,int & n). Variable 'n' is the size of array
and function returned pointer that point to the first element in that
array.Can you tell me how to decalre function in VB6 that reference
from this C++ Dll function.I have to declare this function in VB6 to
use this Dll file.Please help me,thanks you so muck !

May 30 '06 #7

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

Similar topics

0
by: R Tamilarasan | last post by:
Curiosity made me to install VC - 7 (.net) in my machine which had VC - 6 already installed. I tried to compile my workspace in VC - 7 but failed due to several compile time errors. ok no...
2
by: Dave.NET | last post by:
Hi, I had written an application and few DLLs in VC++ before. Now I have switched to .NET platform to compile. Then odd thing happens: the application can be started and run as before on...
11
by: Tatu Portin | last post by:
Have this kind of struct: typedef struct { char **user_comments; /* ... */ } vorbis_comment; /* prototype */ char * read_vorbis_string ( FILE *sc);
4
by: Anthony Gallagher | last post by:
I have a bunch of libraries compiled using VC++ 6.0, and I am trying to recompile one of our projects using VC++ .NET. I get all kind of linker errors (specially in STL calls). How do I get rid of...
0
by: Vijay Chegu | last post by:
Hi I am using vc++ .net 2003 ide with Feb 2003 platform sdk to build 64bit application. I want to use vc++ to debug the app on 64bit machine. As we do not have 64bit VC++, I would like to...
5
by: Hari | last post by:
Guys please help me to solve this strange problem what Iam getting as follows.. Trying to instantiate a global instance of a template class as follows :- when i build this code with debug and...
2
by: um | last post by:
When the POSIX pthreads library for w32 release 2-2-0 (http://sources.redhat.com/pthreads-win32/) is compiled with VC++6 then it compiles and passes all the benchmark tests in the subdirectory...
15
by: Michael Tissington | last post by:
I have a Visual Basic 6.0 ActiveX Control. It seems there is no way with VS 2005 to create a similar control for containers that host ActiverX controls, is this correct ? I'm thinking of...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.