The following fails, and I am not sure why (yet)
Is this a correct way to send back a string from c ?
export char* _stdcall getCurrentRecordingDevice()
{
char deviceName[MIXER_SHORT_NAME_CHARS] = "null";
/*
processing to get name works.
*/
return deviceName ;
}
It compiles
but within rb.
dim result as MemoryBlock
result = new MemoryBlock(32)
#if TargetWin32
declare Function getCurrentRecordingDevice Lib "WinM" Alias
"_getCurrentRecordingDevice at 0" () As Ptr
result = getCurrentRecordingDevice // the memoryblock gets clobbered
#endif
Return result.CString(0)
What is the best way to return a string from a dll to realbasic?
Keith
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|