-
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
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.
-
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?