Results 1 to 5 of 5

Thread: Standard DLL's

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Location
    Calgary
    Posts
    121

    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.

  2. #2
    New Member krishnaa's Avatar
    Join Date
    Feb 2003
    Location
    India , Pune
    Posts
    10
    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.
    Hi , Havent seen me before ???
    Not Even on Codeguru ?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Location
    Calgary
    Posts
    121
    how do I give it the equi. declaration in VB/VBA? is there a big conversion needed?

  4. #4
    Fanatic Member
    Join Date
    May 2001
    Posts
    837
    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.

  5. #5
    New Member krishnaa's Avatar
    Join Date
    Feb 2003
    Location
    India , Pune
    Posts
    10
    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.
    Hi , Havent seen me before ???
    Not Even on Codeguru ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width