DLL Call Return Value

Got a problem you cannot solve? Try here.
Christina
Posts: 5
Joined: Fri Feb 12, 2016 10:36 am

DLL Call Return Value

Postby Christina » Tue Feb 16, 2016 4:31 pm

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;
}

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: DLL Call Return Value

Postby FrancescoT » Thu Feb 18, 2016 1:22 pm

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 46 guests