Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Visual C++ 6.0 Debugger can't handle CString variables

Posted on 2002-05-06
16
Medium Priority
?
880 Views
Last Modified: 2013-12-14
Using Visual C++ 6.0 Enterprise Edition.
Working with DLL code, DEBUG compiled with NO optimizations, _UNICODE is defined, tools->options->debug->display unicode strings checked.

void MyClass::myFn()
{
  CString strName = _T( "Name" );
...
}

Debugger doesn't understand strName!

Variable window:
  Name column: blank
  Value column: CXX0004: Error: Syntax Error
Watch window:
  Name column: "strName"
  Value column: CXX0017: Error: symbol "strName" not found.

Newsgroups aren't very helpful. The only suggestion I've seen is to turn off optimization(not a factor here).

Thanks in advance.
0
Comment
Question by:shadow66
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6991976
Do you have the MFC debug symbols installed (search for e.g. MFC*.pdb under your windows dir)? If not, that might explain the problem. You can install these symbols form the VC++ CD at any time. If you have, there might be a bigger problem...
0
 

Author Comment

by:shadow66
ID: 6992006
Yep. Also, as a test, I created a single document MFC app (with UNICODE enabled) on the same machine and verified the debugger is able to handle CStrings for that project. The problematic project contains a number of DLLs and the problem has been introduced in the last week or so. I was able to view string vars in the debugger in this very same project last week.
0
 
LVL 4

Expert Comment

by:mblat
ID: 6992016
just shot in dark - try to delete all *.ncb and *.opt files from your project....

it is like i said shot in a dark, but your problem seems to be project related...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:jkr
ID: 6992024
Hmmmm - if there are DLLs in the project that reference ANSI CStrings (and you are using UNICODE CStrings, if I get you right), there might be a problem in how the bugger handles such a duplicate in a symbol table - you may have notoced that there is e.g. a mfc42.pdb for the ANSI version of MFC and mfc42u.pdb for the UNICODE version...
0
 

Author Comment

by:shadow66
ID: 6992064
mblat - tried it and no change

jkr - both of those files exist in c:\winnt\system32, as well as others. The workspace contains ~25 projects; are you thinking one of them is missing _UNICODE in the list of preprocessor definitions (project settings)?
0
 
LVL 86

Expert Comment

by:jkr
ID: 6992077
Hmm, if you have the 'control' over all these projects, I'd better check it... BTW, just use the 'dependency walker' to see if any of these modules references an ANSI DLL (DW comes with VC++, but you can find updated versions on www.dependencywalker.com)
0
 

Author Comment

by:shadow66
ID: 6992169
jkr - great tool, thanks. According to Dependency Walker, some modules depends on MFC42UD.DLL, but none depend on MFC42.DLL.
0
 
LVL 4

Expert Comment

by:mblat
ID: 6992195
by any chance you're not mixing realese and debug versions of dll in your project?
0
 

Author Comment

by:shadow66
ID: 6992246
That doesn't seem real likely, as debug versions of DLLs get copied to install-tree/bin/debug while release ones go to install-tree/bin/release; so the .exe in ../debug would only see the DLLs in that directory, and presumably they are all debug versions. However, I am going to clean the entire workspace and build it overnight to see if I get any relief.
0
 
LVL 22

Expert Comment

by:ambience
ID: 6993677
hey is there any goto or label around ? just asking !!
0
 

Author Comment

by:shadow66
ID: 6994202
Problem seems to have been resolved by:
1. Exiting the IDE
2. Restarting the computer
3. Opening the IDE and workspace

My next step was going to be a full clean/rebuild, but it turned out to be unnecessary. I suppose the IDE entered an unstable state and got confused.

Thanks to all commenters. Mblat and jkr - I'd like to award you both 200 points you for your efforts. If one of you would please lock this question, I will score it "A". Then for the other of you I will post a 200 point-award question for you to get credit for your time as well.

0
 
LVL 4

Expert Comment

by:mblat
ID: 6994265
just wondering: what OS are you using?  
0
 
LVL 86

Accepted Solution

by:
jkr earned 800 total points
ID: 6994271
>>If one of you would please lock this question

OK, so I'll do it :o)
0
 

Author Comment

by:shadow66
ID: 6994572
Thanks again!
0
 

Author Comment

by:shadow66
ID: 6994582
Oops - Mblat I didn't notice your question. Win2K. Also, please lock the new question I've posted for you so I can award you points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question