Results 1 to 2 of 2

Thread: C++ Builder DLL

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Posts
    1

    C++ Builder DLL

    I cant get a simple C++ Builder DLL to return a string into Visual Basic

    The C++ Builder DLL Function Code is this:

    extern "C" __declspec (dllexport) __stdcall char* ReturnHello()
    {
    char* NewString = "hEllo WoRLd!";
    return NewString;
    }
    the VB side is:
    Private Declare Function ReturnHello Lib "mylib" () As String

    private sub form_load()
    msgbox retunrHello
    end sub

    it keeps coming up with error 96, conflicting type modifiers, Help, please, someone.....
    ICQ# 96929314


  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Look at the other Strings and DLLs thread - it's not specific to C++ Builder but it gives you enough of an idea. You shouldn't really return pointers to local variables (although in this case it MIGHT work because it's a static string).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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