c++ dll returning string

Sharky Forums


Results 1 to 2 of 2

Thread: c++ dll returning string

  1. #1
    Tiger Shark Muk108's Avatar
    Join Date
    Feb 2002
    Location
    Ohio
    Posts
    868

    c++ dll returning string

    i have no idea how to return a string from my dll here is some code i have so far

    main.cpp
    Code:
    char *__stdcall myfunction(char * variable)
    {
    	return variable;
    }
    main.def

    Code:
    EXPORTS
          myfunction
    vb code

    Code:
    Private Declare Function myfunction  Lib "my.dll" (ByVal variable As String) As String
     -----
    MsgBox myfunction("test")
    whats wrong i get a message saying it cant read the memory and also one that says it cant write to the memory... thanks for the help.
    WHy...why...

  2. #2
    Tiger Shark Muk108's Avatar
    Join Date
    Feb 2002
    Location
    Ohio
    Posts
    868
    nm that works, but when i try to do a strcpy it crashes the dll and says it wont work? does anyone have an idea for that?
    WHy...why...

Posting Permissions

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