Re: how to export this function?
From: Nicky (Nicky_at_discussions.microsoft.com)
Date: 09/28/04
- Next message: Igor Tandetnik: "Re: Can objects have properties?"
- Previous message: Carl Daniel [VC++ MVP]: "Re: template friend function and LNK2019 errors"
- In reply to: David Lowndes: "Re: how to export this function?"
- Next in thread: David Lowndes: "Re: how to export this function?"
- Reply: David Lowndes: "Re: how to export this function?"
- Reply: Tim Roberts: "Re: how to export this function?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 06:31:03 -0700
Thank you dave.
Both are debug version.
Another question is when I use .def to export the interface, the exported
name is GetStringCode, but when I use __declspec(dllexport) __cdecl CString
GetStringCode(CString str1, CString str2) without .def file, after compile,
the Dependency shows the exported function is
GetStringCode@@?1CString@@?2CString@ and some other strange chars. It seems
vc6 uses some name mapping on it. How to resolve this ?
"David Lowndes" wrote:
> >I wrote a dll, but , it does not work correctly.
> >I created a Regular DLL using shared MFC DLL in vc6 and exprots one function
> >// in mydll.cpp
> >CString __cdecl GetStringCode(CString str1, CString str2);
> >...
> >// ----- Use it in another Dialog Based app
> >typedef CString (FAR __cdecl *PGetStringCode)(CString str1,CString str2);
> >...
> > CString str = pGetSC("1","2");
> > //Here, I debugged into the mydll, int function
> >GetStringCode(str1, str2), the str1="2" , str2="", this is not right.
>
> Nicky,
>
> Since you appear to be defining the function & pointer correctly in
> both the EXE & DLL there shouldn't be a mis-match with the calling
> convention (__cdecl).
>
> Are you perhaps mixing a debug build of the EXE/DLL with a release
> build of the other component, or building one component with a
> different version of the compiler (both of which are big problems in
> this scenario)?
>
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
>
- Next message: Igor Tandetnik: "Re: Can objects have properties?"
- Previous message: Carl Daniel [VC++ MVP]: "Re: template friend function and LNK2019 errors"
- In reply to: David Lowndes: "Re: how to export this function?"
- Next in thread: David Lowndes: "Re: how to export this function?"
- Reply: David Lowndes: "Re: how to export this function?"
- Reply: Tim Roberts: "Re: how to export this function?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|