Results 1 to 4 of 4

Thread: Help!!!!!

  1. #1

    Thread Starter
    Lively Member markmyb's Avatar
    Join Date
    Nov 2001
    Location
    Alberton - South Africa
    Posts
    108

    Exclamation Help!!!!!

    I need to compile a dll for a vb app. what project type and complie options must I use!!!

    Using Visual C++

    the following header has being included:

    #define CEEPROGS

    extern "C" // need for 'C' & VB progs
    {

    #ifdef CEEPROGS
    __declspec(dllexport) int CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
    #define OURCALLING __declspec(dllexport)
    #else
    int APIENTRY CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
    #define OURCALLING APIENTRY
    #endif
    }


    the vb programmer has defined it as:
    Public Declare Function CVDDLL_Main Lib "cvddllmain.dll" (ByVal sFile As String, _
    ByVal iLen As Integer, _
    ByVal sFileDesc As String, _
    ByVal sErrorLog As String) As Integer


    but it keeps give bad dll calling convention error.
    Last edited by markmyb; Apr 9th, 2002 at 05:24 AM.
    Confusios say "Man who run in front of car get tired."

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    you must add a .def file:

    Code:
    LIBRARY
       myDLL
    EXPORTS
      CVDDLL_Main
    Then I think you don't even need the extern "C"
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    And you need APIENTRY on both declarations.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Lively Member markmyb's Avatar
    Join Date
    Nov 2001
    Location
    Alberton - South Africa
    Posts
    108
    Thanx CornedBee,
    I managed to sort out the problem

    added the following change to both apps.

    Alias "_CVDDLL_Main@16" to the vb declaration and change the c++ declaration to include __stdcall



    this way I don't have to export another file as well...

    latter
    Confusios say "Man who run in front of car get tired."

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