From: Giovanni Dicanio on
"Marc Oden" <moden(a)avioninc.com> ha scritto nel messaggio
news:5C4F7ED0-3987-42B1-BFDD-8C6F67C3FC62(a)microsoft.com...

> Giovanni,
>
> Thank you for replying.

You are welcome.


> The method you described is exactly how I created the project.

OK.


> My project does contain a shared libarary that came from a hardware vendor
> (I do not have the source) that I believe is compiled with the MBCS
> instead of UNICODE. This might be causing the problem.

OK, you don't have the source code of the 3rd party library, so you can't
rebuild it in Unicode.
But you could convert your Unicode strings to MBCS and back to Unicode
(considering the specific encoding/code page used by the 3rd party library).
WideCharToMultiByte and MultiByteToWideChar Win32 APIs (or CW2A, CA2W, etc.
ATL helper classes) are good tools for that kind of job.

Giovanni



From: Giovanni Dicanio on

"Marc Oden" <moden(a)avioninc.com> ha scritto nel messaggio
news:9463EF45-B95A-4582-AF43-9E6C52887387(a)microsoft.com...

> I do have a shared library from a hardware vender was compiled with
> VS2005. I do not have the source code so I will have rebuild my project
> under VS2005.

Or you could wrap your shared library with a thin wrapper consisting in a
COM DLL or a pure-C interface DLL (in this latter case providing that both
memory allocations and cleanups are done both inside the DLL or both inside
the calling EXE, in other words: don't mix alllocating in EXE and freeing in
DLL or viceversa).
This thin wrapper must be built using VS2005, but can be used also by other
versions of the compiler.

Giovanni



From: Marc Oden on
I recreated whole project in VS2005 rather then VS2008. I complied it a few
times and then started getting the "_DllMain(a)12 already defined" error
again. I then changed the preprocessor options from UNICODE to MBCS. This
did not work. After trying several other things I stumbled upon the /ZI
complier option (Ignore standard include path) and the error went away.

Thank you for your assistance.
"Giovanni Dicanio" <giovanniDOTdicanio(a)REMOVEMEgmail.com> wrote in message
news:%23Fj4nQleKHA.4880(a)TK2MSFTNGP05.phx.gbl...
> "Marc Oden" <moden(a)avioninc.com> ha scritto nel messaggio
> news:5C4F7ED0-3987-42B1-BFDD-8C6F67C3FC62(a)microsoft.com...
>
>> Giovanni,
>>
>> Thank you for replying.
>
> You are welcome.
>
>
>> The method you described is exactly how I created the project.
>
> OK.
>
>
>> My project does contain a shared libarary that came from a hardware
>> vendor (I do not have the source) that I believe is compiled with the
>> MBCS instead of UNICODE. This might be causing the problem.
>
> OK, you don't have the source code of the 3rd party library, so you can't
> rebuild it in Unicode.
> But you could convert your Unicode strings to MBCS and back to Unicode
> (considering the specific encoding/code page used by the 3rd party
> library).
> WideCharToMultiByte and MultiByteToWideChar Win32 APIs (or CW2A, CA2W,
> etc. ATL helper classes) are good tools for that kind of job.
>
> Giovanni
>
>
>

From: Marc Oden on
Correction /ZI is the Omit Default Library Name option..sorry for the any
confusion
"Marc Oden" <moden(a)avioninc.com> wrote in message
news:9598D96B-6D38-4946-A9A1-C3D33A037F83(a)microsoft.com...
>I recreated whole project in VS2005 rather then VS2008. I complied it a
>few times and then started getting the "_DllMain(a)12 already defined" error
>again. I then changed the preprocessor options from UNICODE to MBCS. This
>did not work. After trying several other things I stumbled upon the /ZI
>complier option (Ignore standard include path) and the error went away.
>
> Thank you for your assistance.
> "Giovanni Dicanio" <giovanniDOTdicanio(a)REMOVEMEgmail.com> wrote in message
> news:%23Fj4nQleKHA.4880(a)TK2MSFTNGP05.phx.gbl...
>> "Marc Oden" <moden(a)avioninc.com> ha scritto nel messaggio
>> news:5C4F7ED0-3987-42B1-BFDD-8C6F67C3FC62(a)microsoft.com...
>>
>>> Giovanni,
>>>
>>> Thank you for replying.
>>
>> You are welcome.
>>
>>
>>> The method you described is exactly how I created the project.
>>
>> OK.
>>
>>
>>> My project does contain a shared libarary that came from a hardware
>>> vendor (I do not have the source) that I believe is compiled with the
>>> MBCS instead of UNICODE. This might be causing the problem.
>>
>> OK, you don't have the source code of the 3rd party library, so you can't
>> rebuild it in Unicode.
>> But you could convert your Unicode strings to MBCS and back to Unicode
>> (considering the specific encoding/code page used by the 3rd party
>> library).
>> WideCharToMultiByte and MultiByteToWideChar Win32 APIs (or CW2A, CA2W,
>> etc. ATL helper classes) are good tools for that kind of job.
>>
>> Giovanni
>>
>>
>>
>