Home All Groups Group Topic Archive Search About
Author
28 Jan 2006 12:22 AM
Kent
Hi All,
I have a c++ library that I would like to call from vb6 or vb.net. For
instance, the file is called name.lib (and name.h) Is it possible to
call the functions in the *.lib from vb6 or vb.net? If so, could you
please point me in the right direction?

Thanks.
(The email address is valid and I check it.)

Author
28 Jan 2006 2:07 PM
AMercer
> I have a c++ library that I would like to call from vb6 or vb.net. For
> instance, the file is called name.lib (and name.h) Is it possible to
> call the functions in the *.lib from vb6 or vb.net? If so, could you
> please point me in the right direction?

In both vb6 and vb.net, you need to make Declare statements which are
analogous to C function prototypes.
Author
28 Jan 2006 5:14 PM
Kent
AMercer wrote:
> > I have a c++ library that I would like to call from vb6 or vb.net. For
> > instance, the file is called name.lib (and name.h) Is it possible to
> > call the functions in the *.lib from vb6 or vb.net? If so, could you
> > please point me in the right direction?
>
> In both vb6 and vb.net, you need to make Declare statements which are
> analogous to C function prototypes.

Thanks for the reply. So I would add the following statement:

Private Declare Sub DoSomething Lib "name.lib" Alias "DoSomething"
(ByVal param As Long)

Is this correct?

Thanks again
Author
28 Jan 2006 5:21 PM
Herfried K. Wagner [MVP]
"Kent" <unwantedspam@mchsi.com> schrieb:
>> > I have a c++ library that I would like to call from vb6 or vb.net. For
>> > instance, the file is called name.lib (and name.h) Is it possible to
>> > call the functions in the *.lib from vb6 or vb.net? If so, could you
>> > please point me in the right direction?
>>
>> In both vb6 and vb.net, you need to make Declare statements which are
>> analogous to C function prototypes.
>
> Thanks for the reply. So I would add the following statement:
>
> Private Declare Sub DoSomething Lib "name.lib" Alias "DoSomething"
> (ByVal param As Long)

Typically you'd declare the function using 'Lib "name.dll"'.  How are the
functions exported by the DLL?

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>