From: singurd on
Now i have my Unicode dialog project that displays, read and writes
with unicode characters.

My plan is to create a dll for this dialog, i was hoping that somehow
i could still retain my EXE as non unicode
and just call this dialog that displays the unicode characters.
I want to design it such way that there will not be any string
parameters being passed between EXE and unicode DLL
to avoid any link error.
Is this something possible ?




From: Goran on
On Sep 3, 9:56 am, singurd <sing...(a)yahoo.com> wrote:
> Now i have my Unicode  dialog project that displays, read and writes
> with unicode characters.
>
> My plan is to create a dll for this dialog, i was hoping that somehow
> i could still retain my EXE as non unicode
> and just call this dialog that displays the unicode characters.
> I want to design it such way that there will not be any string
> parameters being passed between EXE and unicode DLL
> to avoid any link error.
> Is this something possible ?

Yes. Just make a regular DLL and expose such interface so that MFC
artifacts aren't visible in it.

You can even exchange unicode character strings (e.g. BSTR being the
best candidate due to shared allocator), but how can your app use
this? Your DLL will only produce data for external (to your app code)
use?

Goran.
From: singurd on
On Sep 3, 4:57 pm, Goran <goran.pu...(a)gmail.com> wrote:
> On Sep 3, 9:56 am, singurd <sing...(a)yahoo.com> wrote:
>
> > Now i have my Unicode  dialog project that displays, read and writes
> > with unicode characters.
>
> > My plan is to create a dll for this dialog, i was hoping that somehow
> > i could still retain my EXE as non unicode
> > and just call this dialog that displays the unicode characters.
> > I want to design it such way that there will not be any string
> > parameters being passed between EXE and unicode DLL
> > to avoid any link error.
> > Is this something possible ?
>
> Yes. Just make a regular DLL and expose such interface so that MFC
> artifacts aren't visible in it.
>
> You can even exchange unicode character strings (e.g. BSTR being the
> best candidate due to shared allocator), but how can your app use
> this? Your DLL will only produce data for external (to your app code)
> use?
>
> Goran.

Yes the DLL is just used to display output result and data, with
unicode labels.

From: Giovanni Dicanio on
singurd ha scritto:

> Yes the DLL is just used to display output result and data, with
> unicode labels.

It's not clear to me what kind of data is passed between your EXE and
your DLL.
Is your EXE just passing numeric data to the DLL (e.g. some array of
double's), and is your DLL just displaying this data in a Unicode
dialog-box?

In this case, you can just have a regular Win32 DLL, and there is no
need to pass strings at your DLL interface. And you can happily have an
ANSI/MBCS EXE and a Unicode DLL.

But if your DLL expects some strings at its interface, you have to
convert it from ANSI/MBCS (on the side of the .EXE) to Unicode (on the
side of the DLL).

To convert from ANS/MBCS to Unicode, you could use MultiByteToWideChar
Win32 API:

http://msdn.microsoft.com/en-us/library/dd319072.aspx

Note that you should be aware of the code page used by your EXE.

(I still think that the best solution is to convert the EXE to Unicode.
It's a long-term investment in quality, IMHO.)

Giovanni
From: singurd on
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 ?