I'm writing a DLL in Delphi using the below C++ example:
USERDLL_API double process_message (const char* pmessage, const void* param)
{
if (pmessage==NULL) { return 0; }
if (param==NULL) { return 0; }
if (strcmp(pmessage,"state")==0)
{
current_state *state = (current_state*) param;
return process_state( (current_state*)param );
}
}
Unfortunately, I know next to nothing about C++ and pointers. What should I use instead of char* (PChar?) and void*?
function process_message (const pmessage: PChar; const param: ???): Double; export;
begin
???
end;
exports process_message;
Any help with the body of the function will be highly appreciated, too. I realize it's not rocket science, but I wouldn't learn the basics of C++ just to convert a couple of lines, if someone's kind enough to do that for me :-)