|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cal Dll was written by VC++ in VBHi, 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! 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. Only if its a NON MFC C++ DLL & normally wouldn't need to register it
Show quoteHide quote "IdleBrain" <indianmostwan***@yahoo.com> wrote in message news:1148748578.558403.322780@j55g2000cwa.googlegroups.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. > Here's a good example of doing exactly what you want:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=06613CC5-2134-404C-A4E2-CA46EF086C12 Show quoteHide quote "Zicovn" <nguyenlinh***@gmail.com> wrote in message news:1148705776.594736.268440@38g2000cwa.googlegroups.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! > 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 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 Show quoteHide quote "Zicovn" <nguyenlinh***@gmail.com> wrote in message news:1148887764.371847.300510@j33g2000cwa.googlegroups.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 > 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 !
VB.NET events creates a hidden delegate, but how do I access it?
Console app no accessible 'Main' method with an app... CurrencyManager Question current function / sub name ? How to use the httpwebrequest with Cookies in "GET" method why are there still COM controls in VS.Net 2005? datagridview cell - get row/column info for updating data- how? Convert VBScript to Visual Basic .Net receiving data over socket How to get the primary key back after you done a single line insert? |
|||||||||||||||||||||||