Conversion of a C++ function
Posted: Sun Apr 10, 2011 8:18 am
Hello,
maybe a silly question but I have no result yet. Perhaps someone can help me.
In C++ the Function header is this
In my opinion it means that a pointer to string variable should get the value of Source.
The pointer hasn't to be initialized (but it can).
For interested the complete C++ Function:
Thank for all your suggestions.
maybe a silly question but I have no result yet. Perhaps someone can help me.
In C++ the Function header is this
Code: Select all
void SetStr(char*& Dest,char* Source)
Code: Select all
Procedure SetStr(*varname.String, value$)
?
EndProcedure
test$ = #NUL$
SetStr(@test$, "HALLO")
Debug test$
For interested the complete C++ Function:
Code: Select all
void SetStr(char*& Dest,char* Source)
{
int slngth = strlen(Source);
HANDLE ProcessHeap = GetProcessHeap();
if(Dest != NULL && HeapValidate(ProcessHeap, 0, Dest) != FALSE)
{Dest=(char*)HeapReAlloc(ProcessHeap, HEAP_ZERO_MEMORY, Dest, slngth+1);}
else {Dest=(char*)(HeapAlloc(ProcessHeap, HEAP_ZERO_MEMORY, slngth+1));}
if(Dest != NULL)strcpy(Dest,Source);
}
Thank for all your suggestions.