CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Posts
    2

    How to cerate a C++ DLL that can be called from VB 6?

    People, if some one has experience in creating C++ or C non MFC DLLs in VC++ 6 so that they can be accessed later from VB 6 ActiveX DLL as an access to a regular API, please give me a small example or send me a link on a Web.
    All suggestions are most welcomed.
    I can't find any good example in MSDN.
    Thanks


  2. #2
    Join Date
    Sep 1999
    Location
    Istanbul
    Posts
    85

    Re: How to cerate a C++ DLL that can be called from VB 6?

    May be this help:
    http://www.tair.freeservers.com
    see for VC++/Keyboard Hook.


  3. #3
    Join Date
    Aug 1999
    Location
    India
    Posts
    14

    Re: How to cerate a C++ DLL that can be called from VB 6?

    Go to Visual Studio envi. and select new Project 'Win32 DLL' and then 'an Empty DLL' in next tab and proceed.
    write the source file as in example below. word 'CALLBACK' is important here.
    Then create a .def file to export the desired functions as shown below.
    <vbcode>
    //in the source file. xyz.c
    int CALLBACK GetCount(void);
    int CALLBACK GetCount(void)
    {
    // write your implementation here
    }

    //Create a .def file with same name as .c file // added in same workspace. add following code.

    EXPORTS

    GetCount @1

    //if you have multiple functions just increase //the count @2 , @3 and so on.
    </vbcode>

    Onc

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

Featured