Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / February 2004



Tip: Looking for answers? Try searching our database.

VB6 & VC6 C++ DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sarak - 28 Feb 2004 17:17 GMT
How do I access a DLL written in VC6 within a VB6 program?

For example if I used inline assembly to write a matrix multiplication
routine and compiled it as a DLL.  How now do I call that routine?

--
Craig.
Duane Bozarth - 28 Feb 2004 18:50 GMT
> How do I access a DLL written in VC6 within a VB6 program?
>
> For example if I used inline assembly to write a matrix multiplication
> routine and compiled it as a DLL.  How now do I call that routine?

See the sections on mixed language programming in the help files for
both VB and your external language of choice.  There are samples of
almost all types of arguments and return values in there.

However, if you are specifically interested in matrix manipulations, why
not simply take the Netlib code and package it rather than writing it
over again?
Steve Gerrard - 29 Feb 2004 01:40 GMT
> How do I access a DLL written in VC6 within a VB6 program?
>
[quoted text clipped - 3 lines]
> --
> Craig.

Declare the procedures, the same way you would call a windows api
function in a dll:

Private Declare Function GetTickCount Lib "kernel32.dll" () As Long

   dim nTick as Long

   nTick = GetTickCount()

On the other end, you have various tasks to do, such as making your
procedures have the correct calling convention (WINAPI, aka PASCAL, I
think), and exporting them correctly....
GeoffreyW - 29 Feb 2004 06:08 GMT
>> How do I access a DLL written in VC6 within a VB6 program?
>>
[quoted text clipped - 16 lines]
>procedures have the correct calling convention (WINAPI, aka PASCAL, I
>think), and exporting them correctly....

WINAPI is a macro for the __stdcall calling convention which is the
only calling convention that VB6 recognises.  This is the same
convention that the Win32 API uses.  The PASCAL calling convention is,
I believe, for 16 bit platforms only and so not applicable.

When writing the VB6 declare statments for DLL's written in C++ watch
out for C++ name mangling.  The name exported by your C++ compiler may
not be what you think it is without some effort to make sure it
becomes what you would expect.  At best this may be *yourfunction@8*
where the function name is followed by @ followed by the number of
bytes that make up the argument list.  At worst it can be prefixed by
something horrible.  This depends on your C++ compiler and your
documentation should tell you what you need to know.

Geoff
Sarak - 29 Feb 2004 06:34 GMT
Thanks guys I found an awesome code sample for this.

> >> How do I access a DLL written in VC6 within a VB6 program?
> >>
[quoted text clipped - 32 lines]
>
> Geoff
GeoffreyW - 29 Feb 2004 07:18 GMT
>Thanks guys I found an awesome code sample for this.

Any chance you might post a link to it?  Might be useful to others
with the same query.

geoff

>> >> How do I access a DLL written in VC6 within a VB6 program?
>> >>
[quoted text clipped - 32 lines]
>>
>> Geoff
Steve Gerrard - 29 Feb 2004 16:40 GMT
> >Thanks guys I found an awesome code sample for this.
>
> Any chance you might post a link to it?  Might be useful to others
> with the same query.
>
> geoff

This is a post from comp.lang.basic.visual on the same subject. While
the English is not great, the programming is, which is the main thing:

> Sorry, I read English a little bit, but not write.
> It is pardon when it is strange English.
[quoted text clipped - 19 lines]
>
> - bono
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.