Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » MS Com and Unicode issue
icon9.gif  MS Com and Unicode issue [message #8180] Wed, 14 February 2007 17:09
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
I ported an application from Visual Studio 2005 to Upp using the VS compiler (MSC8). One part of the program uses a com dll. I import it into my program using a line such as:

#import "library_name.tlb"

at the top of my .cpp file.
At first, I was getting this compiler error:
..."\comip.h(689) : error C2065: 'CP_ACP' : undeclared identifier"
..."while compiling class template member function 'HRESULT _com_ptr_t<_IIID>::CreateInstance("...

I looked at the difference between the 2 command line arguments to the compiler and saw the /D"UNICODE" switch in the VS command line. I added this option to the compiler command line and now I get an error in a Upp header file:

..."uppsrc\Core/Path.h(77) : error C2440: 'return' : cannot convert from 'const WCHAR [14]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"

I have restricted the compiler switch only to my package and not the others (ie Core), but my package still uses the Upp NTL Core features. I am not sure how to proceed. Are there other /D options I can use that will agree with both Upp and MS Com?

TIA


Update 1: I changed the compiler switch to "/DCP_ACP=0" and now my error is
"comip.h(689) : error C3861: 'MultiByteToWideChar': identifier not found"


Update 2: I have changed the defined variable to '/DCP_ACP=1252' for the iso western english codepage. and I found a header file that defines the necessary functions, so I include WINNls.h. Not sure if this is a temporary solution or not. I have to investigate whether there are other headers that would accomplish the same goal.
BTW, I am very grateful for the little and big endian functions in the stream io part of the libraries. A big thanks to the developers for making my life a bit easier!

[Updated on: Thu, 15 February 2007 14:45]

Report message to a moderator

Previous Topic: LIB from Visual C++ cannot link to UPP package
Next Topic: Assmbley with Upp
Goto Forum:
  


Current Time: Fri May 03 02:07:30 CEST 2024

Total time taken to generate the page: 0.04711 seconds