Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 890
  • Last Modified:

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

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
shadow66
Asked:
shadow66
  • 7
  • 5
  • 3
  • +1
1 Solution
 
jkrCommented:
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
 
shadow66Author Commented:
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
 
mblatCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jkrCommented:
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
 
shadow66Author Commented:
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
 
jkrCommented:
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
 
shadow66Author Commented:
jkr - great tool, thanks. According to Dependency Walker, some modules depends on MFC42UD.DLL, but none depend on MFC42.DLL.
0
 
mblatCommented:
by any chance you're not mixing realese and debug versions of dll in your project?
0
 
shadow66Author Commented:
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
 
ambienceCommented:
hey is there any goto or label around ? just asking !!
0
 
shadow66Author Commented:
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
 
mblatCommented:
just wondering: what OS are you using?  
0
 
jkrCommented:
>>If one of you would please lock this question

OK, so I'll do it :o)
0
 
shadow66Author Commented:
Thanks again!
0
 
shadow66Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 7
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now