Advertisement

05.15.2008 at 02:51PM PDT, ID: 23406819
[x]
Attachment Details

conflict with MFC versions using unicode and CDatabase

Asked by JohannRamon in Windows MFC Programming, C++ Programming Language, Microsoft Visual C++

Tags: , , ,

Hi people!

 

I'm having a big problem:

I'm migrating a big project from VC++6 to VC++8 (2005) and i'm stacked with a .exe project that was converted to unicode; the debub version works fine, but the release version throws crazy exceptions. I was reading about CDatabase bug using unicode in mfc42, but i supposed i'm working on mfc80... i think.

I attach a little portion of my code.


My debug version is fine, but in my release version i had to convert the unicode string back to char and cast to wchar_t* and it works, but i´m having a lot of troubles after that.

 

This link talks about that: http://support.microsoft.com/kb/139759/en

 

I wanna know what is the problem; MFC Version, CDatabase, other?

Both projects are unicode, but the dll projects only works if it is debug.

 

Thanks a lot!
Start Free Trial
1:
2:
3:
4:
5:
#ifdef _DEBUG
   Result = pDatabase->OpenEx(Key, CDatabase::openReadOnly | CDatabase::noOdbcDialog ); // ANMB VS2005 'Key' is an Unicode CString
#else
   Result = pDatabase->OpenEx((wchar_t*)StringClass(Key.GetBuffer()).ToChar(), CDatabase::openReadOnly | CDatabase::noOdbcDialog ); // ANMB VS2005 'StringClass' converts from Unicode to char
#endif
[+][-]05.15.2008 at 10:40PM PDT, ID: 21580253

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 07:06AM PDT, ID: 21582768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:25AM PDT, ID: 21583574

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:34AM PDT, ID: 21583674

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:35AM PDT, ID: 21583679

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:27AM PDT, ID: 21584166

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 10:25AM PDT, ID: 21584662

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 11:13AM PDT, ID: 21585098

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 09:45AM PDT, ID: 21599401

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 10:10AM PDT, ID: 21599623

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 10:28AM PDT, ID: 21599761

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows MFC Programming, C++ Programming Language, Microsoft Visual C++
Tags: Microsoft, Visual C++, 6.0, 8.0/2005, Migration
Sign Up Now!
Solution Provided By: wayside
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.19.2008 at 02:41PM PDT, ID: 21601868

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 11:43PM PDT, ID: 21603956

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.20.2008 at 06:57AM PDT, ID: 21606160

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.20.2008 at 09:45AM PDT, ID: 21607962

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 10:05AM PDT, ID: 21608127

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2008 at 03:39PM PDT, ID: 21636275

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628