|
-
Feb 3rd, 2003, 04:17 PM
#1
Thread Starter
Lively Member
Standard DLL's
how can I make a standard DLL in C? are these Standard DLL's able to be called from VBA code and return values to Excel? I'm just looking for the easiest way to do this.
-
Feb 5th, 2003, 07:52 AM
#2
New Member
Ohh Thats tooo Easy !
Create a new project in VC++ of type Win32 DLL , and Export functions.Remember to use _stdcall calling convention to be used for all exported function.
Later you can give it's equi. declaration in VB/VBA , and simply use it in EXCEL/WORD/Any VBA Automation supporting app.
-
Feb 5th, 2003, 10:46 AM
#3
Thread Starter
Lively Member
how do I give it the equi. declaration in VB/VBA? is there a big conversion needed?
-
Feb 5th, 2003, 07:16 PM
#4
Fanatic Member
there have been other posts on this before, trying searching for C++ DLL
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Feb 5th, 2003, 10:59 PM
#5
New Member
It's not so hard to write equ. declaration in VB.
C++ 's int is mapped to LONG in VB , C++'s BSTR/Char * are mapped to string.
See following.
int CppFunctionExported(char*lpszName ); //C++
it's equi. in VB is..
Public Declare Function CppFunctionExported Lib "dllName.DLL" (ByVal szName as string) As Long
so simple.. See API text viewer to find more mapping in C++ and VB.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|