From: singurd on
On Sep 3, 7:48 pm, singurd <sing...(a)yahoo.com> wrote:
> why do i get this link warning when i compile the Unicode DLL
> Debug/VTReportPage.dll : warning LNK4086: entrypoint
> "_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments;
> image may not run
>
> and the EXE crashes with exception handling at NTDLL.dll.  Its the
> same result even though the calling EXE is unicode.
>
> Are there more settings for Unicode DLL projects ?

The warning could be due to me exporting the class using the macro
below. I am building MFC unicode extension DLL
class AFX_EXT_DATA ReportPage : public CDialog
From: Goran on
On Sep 3, 3:14 pm, singurd <sing...(a)yahoo.com> wrote:
> The warning could be due to me exporting the class using the macro
> below. I am building MFC unicode extension DLL
> class AFX_EXT_DATA ReportPage : public CDialog

I never tried, but I am pretty sure that could never work with a non-
unicode app. Your DLL is supposed to link with a unicode MFC, as an
extension, and your exe links with non-unicode MFC. Extension to what
version of MFC, then!?

I think you should save yourself a hassle and build a regular DLL.
From what you are saying, it's about one function call. So export that
one function!

AFAIK, MFC extension DLLs are for "framework-type" libraries that are
supposed to integrate tightly and mix intensively with application
code that uses MFC. It does not seem to be the case here.

Goran.
From: Giovanni Dicanio on
singurd ha scritto:
> why do i get this link warning when i compile the Unicode DLL
> Debug/VTReportPage.dll : warning LNK4086: entrypoint
> "_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments;
> image may not run
>
> and the EXE crashes with exception handling at NTDLL.dll. Its the
> same result even though the calling EXE is unicode.
>
> Are there more settings for Unicode DLL projects ?

The _wWinMainCRTStartup is the entry point for a Win32 EXE, not a DLL...
It sounds strange to me that you had this kind of error.

Are you sure that you built a DLL from scratch using the VS wizard?

The entry point for a DLL should be _DllMainCRTStartup(a)12 (not
_wWinMainCRTStartup).

(Note that __stdcall calling convention and 12 bytes of arguments
perfectly match the _DllMainCRTStartup(a)12 identifier.)

Giovanni


From: singurd on
On Sep 3, 10:03 pm, Giovanni Dicanio
<giovanniDOTdica...(a)REMOVEMEgmail.com> wrote:
> singurd ha scritto:
>
> > why do i get this link warning when i compile the Unicode DLL
> > Debug/VTReportPage.dll : warning LNK4086: entrypoint
> > "_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments;
> > image may not run
>
> > and the EXE crashes with exception handling at NTDLL.dll.  Its the
> > same result even though the calling EXE is unicode.
>
> > Are there more settings for Unicode DLL projects ?
>
> The _wWinMainCRTStartup is the entry point for a Win32 EXE, not a DLL...
> It sounds strange to me that you had this kind of error.
>
> Are you sure that you built a DLL from scratch using the VS wizard?
>
> The entry point for a DLL should be _DllMainCRTStartup(a)12 (not
> _wWinMainCRTStartup).
>
> (Note that __stdcall calling convention and 12 bytes of arguments
> perfectly match the _DllMainCRTStartup(a)12 identifier.)
>
> Giovanni

Hi Giovanni
thanks , so for unicode DLL we need to set entry point to
DllMainCRTStartup(a)12
After i did this the EXE is able to display the unicode DLL dialog now