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.