Page 1 of 1

DLL Call Return Value

Posted: Tue Feb 16, 2016 4:31 pm
by Christina
Now that I am actually connecting to my DLL, I am having a new problem. The return value of the DLL is a char*, hard coded to "This". I tried to call it and I end up getting a number [13068] back. Why does it do this? Is this normal?

My dll call is as followed:

Code: Select all

~InstallAware Clipboard Data~
~Call DLL Function~
~{0FD88D9C-D9B4-400C-A065-5B78EED67672}~
~$TARGETDIR$\ConfigRA\RAWrapper.dll,?help@@YGPBDXZ,word,dllReturn,$~
~mIDEFunc.dll\mEXEFunc.dll~


This is the DLL function:

Code: Select all

__declspec(dllexport)const char* _stdcall help()
{
 
    const char* pie = "This.";
    return pie;
}

Re: DLL Call Return Value

Posted: Thu Feb 18, 2016 1:22 pm
by FrancescoT
Dear Christina,

of course it doesn't work. You cannot return a local pointer or a pointer to a local variable.

This is not an InstallAware limitation ... instead depends on how C/C++ handles pointers and variables.

Regards