Cal Dll was written by VC++ in VB

Z

Zicovn

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!
 
I

IdleBrain

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.
 
Z

Zicovn

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
 
G

gmou

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
 
Z

Zicovn

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 !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top