Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 [1724]Intelligence problem in WTL, or template?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
wondering Posted - Jun 16 2009 : 05:50:03 AM
In my WTL project, VA intelligence often doen't work. In the snapshot bellow, class CCreateRepoDlg is inherited from template class CDialogImpl<>, but VA suggestion couldn't provide the members of the template class, such as Create(), ShowWindow(), etc.. How to explain this problem?
class CCreateRepoDlg : public CDialogImpl<CCreateRepoDlg>



My system info:
VA_X.dll file version 10.5.1724.0 built 2009.05.01
Licensed to:
VA X: terry
VA.NET 7.1: terry
DevEnv.exe version 9.0.30729.1
msenv.dll version 9.0.30729.1
Font: +?+?+?+?+?+? 12(Pixels)
Comctl32.dll version 6.10.6001.18000
Windows Vista 6.0 Build 6001 S
2 processors (x86)

Platform: Win32
Stable Includes:
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
D:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
D:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
E:\\SDK\\WTL8.1\\Include;
E:\\SDK\\boost_1_39_0;

Other Includes:

Stable Source Directories:
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\crt\\src;
30   L A T E S T    R E P L I E S    (Newest First)
wondering Posted - Aug 17 2009 : 10:54:16 PM
OK, expect to your solution.
feline Posted - Aug 13 2009 : 2:46:17 PM
Sorry about that, my mistake. This is quite a long thread, and I sometimes forget what I have already asked

It is good to know this helps, thank you. The problem is happening since there are two different classes called "CDialogImpls" and VA is getting confused:

case=30555
wondering Posted - Aug 13 2009 : 02:37:59 AM
quote:
Originally posted by wondering

STL is supported perfectly by VA. I'm sorry for my ambiguous statement.
What I say means some template class I code meets this problem. But I forget where are them just now.

Here are some new finds when I use WTL:
CTabCtrl tabGroup = GetDlgItem(IDC_TAB_GROUP);
tabGroup.AddItem("Group");

If I use alt+g on GetDlgItem, it goes to winuser.h(Windows API), but if I press F12 on GetDlgItem it can go to atlwin.h(correct).
When I type the dot after tabGroup, it can't list AddItem function.

WTL::CTabCtrl tabGroup = CWindow::GetDlgItem(IDC_TAB_GROUP);
tabGroup.AddItem("Group");

If I write code like this, add WTL or CWindow before class and function name, alt+g works well and all member listed.



In fact, I has did this test and posted this reply on Jul 18 2009 : 12:43:18 AM.
Today, I tested again according to your suggestion.
Added using ATL::CDialogImpl or ATL:: it can show the listbox.
It works well in the test project and my project.
feline Posted - Aug 05 2009 : 2:24:44 PM
Using the test solution first, can you try adding:

using ATL::CDialogImpl;

to the cpp file, or adding ATL:: before CDialogImpl to see if this helps?

If this helps in the test solution does this help in your main solution?
feline Posted - Jul 28 2009 : 7:07:49 PM
I have the files, many thanks for these. I have asked our developers to see if they have any ideas:

case=30151
wondering Posted - Jul 28 2009 : 03:50:48 AM
I have sent my va log to you.
feline Posted - Jul 27 2009 : 3:50:42 PM
Many apologies for all of the problems you are having. There is clearly a serious problem, but I have no idea what is causing it.

Using the test project can you please try the following.

Press the button:
VA Options -> Performance -> Rebuild symbol databases

reload the IDE, and turn on VA logging:

VA Options -> Performance -> Enable logging

BEFORE you load the test solution. Then load the test solution, and once VA has finished parsing try triggering the listbox on the original test plus the three tests:

CDialogImpl<CCreateRepoDlg> dlgImpl;
dlgImpl;

CDialogImpl dlgBasic;
dlgBasic;

CDialogImpl::


and then close the IDE to stop the log files from getting to large. Please see this FAQ for details on sending me the log files

http://docs.wholetomato.com?W305

hopefully the log files with give us some clues.
wondering Posted - Jul 27 2009 : 04:21:54 AM
I have tested it according to your suggest. But there isn't any change. I think it's not a factor.
I did another test later: I uninstalled VA, and clear its root registry(delete all items).
Then I installed VA again and used the default VA settings, but it's also not correct when I open the test project.

I have no choice now, I want to give up...
feline Posted - Jul 24 2009 : 1:51:13 PM
One more test, and then VA log files. Can you please close all instances of the IDE and then in your registry delete or rename the key:

HKCU \\ Software \\ Whole Tomato \\ UserDataDir = "..."

and then load the test solution. VA should now rebuild its symbol database in the default location, probably on C drive. This is about the only difference I have not been able to test, so it might be a factor. I don't understand why it might be a factor, but this should be a quick and easy test.

Does this make any difference to the VA listboxes?
wondering Posted - Jul 24 2009 : 01:32:09 AM
I test on three other machine, one Vista, two XP. They are all correct.
Our anti-virus software are all ESET NOD32, which isn't a factor I think.

Could you provide me a debug VA version for debugging this problem?
It's a pleasure for me to assist you with this special case.
feline Posted - Jul 23 2009 : 2:20:37 PM
Is the listbox correct on this other machine?

This looks like a VA parser problem, but there does not seem to be a general problem with VA's parser, the problem, what ever it is, is machine specific.

Is the anti-virus software and anti-virus settings the same on both machines?
Are there any obvious differences between the two machines?

The screen shots are really interesting, thank you for these. It looks like VA does not understand that CDialogImpl is a derived class, since all of the items in the listbox are bold, but that does not make much sense.
wondering Posted - Jul 22 2009 : 10:04:17 PM
VisualSVN is not be listed in the add-in manager, but I found the other one add-in names VisualFC,
which provides WTL/WinxGui Wizard. I forgot it the other day. //shy...

Then I disable it and restart my IDE, however, it was no any effect for this problem.
Another member of my team uses the same IDE and VisualFC with me,
the difference is his OS is WinXP, but his listbox is normally.

The new test result:

	CDialogImpl<CCreateRepoDlg> dlgImpl;
	dlgImpl;

The listbox doesn't show.

	CDialogImpl dlgBasic;
	dlgBasic;



	CDialogImpl::

feline Posted - Jul 21 2009 : 3:13:53 PM
If you look at:

IDE tools menu -> Add-in Manager -> list of available add-ins

is VisualSVN listed? If it is listed can you uncheck the check boxes, so that it will not automatically run when you load the IDE. And then restart the IDE and re-run these simple tests. I am hoping we can find out if this is a factor or not.

Since this works correctly in VC6 it is not a problem with VA's parser on your system. So something else must be causing it.

Can you please add this new test code to the test function:


	CDialogImpl<CCreateRepoDlg> dlgImpl;
	dlgImpl;

	CDialogImpl dlgBasic;
	dlgBasic;


and try typing a dot after each of these new variables. Do you get a VA listbox in either case?

What about with the code:

CDialogImpl::

you should get a listbox from the IDE when you type the double colon, so there should be no pale tomato icons in the background of the icons.
wondering Posted - Jul 21 2009 : 08:05:01 AM
It also happens nothing when I press Ctrl+Space after the dot,
but it can show the listbox if I press Ctrl+Alt+Space(Complete Word of IDE). I have shot the screen as below:


If I declare a method in the calss, when I type the dot after "dlg", it's state will like this:


But it works well in my vc6 IDE:


Another plugin of My IDE is VisualSVN and nothing else.
feline Posted - Jul 20 2009 : 2:32:06 PM
What happens when you press CTRL-SPACE after the dot? This should force a listbox to appear.

Do you have any other IDE plugin's installed?
Is there anything "odd" about your system that might be a factor?
wondering Posted - Jul 20 2009 : 2:06:36 PM
atlwin.h code:
template <class T, class TBase /* = CWindow */>
class ATL_NO_VTABLE CDialogImpl : public CDialogImplBaseT< TBase >
{ // 3450
public:
#ifdef _DEBUG
	bool m_bModal;
	CDialogImpl() : m_bModal(false) { }
wondering Posted - Jul 20 2009 : 2:04:43 PM
I have converted your vs2003 project to vs2008, it doesn't matter:)

When I type the dot after "dlg", it happens nothing, no listbox showed. So I think it's not necessary to snapshot screen.

It's go to line 3450 when I use alt+g on CDialogImpl, the file is the same with yours.
feline Posted - Jul 20 2009 : 11:39:26 AM
I have imported your VA and IDE settings, and using the test project I uploaded I still cannot reproduce the problem. The test project was VS2003 format, that was my mistake, I got confused. I am now testing in VS2008, the same IDE you are using.

Can you post a screen shot of what you see when you type dot after "dlg" on line 18 please?

What happens if you use Escape to dismiss this listbox and then press CTRL-SPACE?


If you use alt-g on CDialogImpl what happens? I am taken to line 3454 in the file:

C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include\\atlwin.h

Are you taken to the same line in the same file? Or are you taken somewhere else? I am wondering if your header files for ATL and WTL are different to mine, since that might explain the problems.
feline Posted - Jul 20 2009 : 11:02:36 AM
I have found one problem, in your settings you have set VA's data directory to F drive, but I do not have a F drive on my computer, which is why it was so very slow. So that explains that
feline Posted - Jul 20 2009 : 10:54:23 AM
I have the files, thank you for these. When you tell VA to rebuild its symbol database and restart the IDE, approximately how long does this take? It should only take 1 or 2 minutes, but after importing your VA settings it is taking much longer on my test machine.

But I don't understand why. This might be a factor, especially if it is as slow on your machine.
wondering Posted - Jul 19 2009 : 12:36:19 PM
I have sent them to you and expect your response.
feline Posted - Jul 18 2009 : 11:51:05 AM
Can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

I can then import them here and see if I can reproduce the problem using the sample solution I made. Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

Next time you see a template problem that does Not use WTL I would be very interested in more details. I am hoping it might provide some clues to this WTL problem.
wondering Posted - Jul 18 2009 : 12:43:18 AM
STL is supported perfectly by VA. I'm sorry for my ambiguous statement.
What I say means some template class I code meets this problem. But I forget where are them just now.

Here are some new finds when I use WTL:
CTabCtrl tabGroup = GetDlgItem(IDC_TAB_GROUP);
tabGroup.AddItem("Group");

If I use alt+g on GetDlgItem, it goes to winuser.h(Windows API), but if I press F12 on GetDlgItem it can go to atlwin.h(correct).
When I type the dot after tabGroup, it can't list AddItem function.

WTL::CTabCtrl tabGroup = CWindow::GetDlgItem(IDC_TAB_GROUP);
tabGroup.AddItem("Group");

If I write code like this, add WTL or CWindow before class and function name, alt+g works well and all member listed.
feline Posted - Jul 17 2009 : 12:55:15 PM
This should work for you, it works for me. This is very strange.

Do any template classes work for you? Can you try adding this simple test code to a file:

static void testStandardTemplate()
{
	std::list<std::string> listStrings;
	listStrings.front()|;
}

what happens when you type the dot here? I get the correct listbox on my machine, showing the members of std::string.
wondering Posted - Jul 16 2009 : 11:23:10 PM
I changed the Platform of VA Options to Custom and set the include directories according to your solution.
But I still saw the problem.
Then I rebuild the symbol database again, The problem also exists.
Oh...

BTW, recently I found out all template class I use can not be supported by VA, not only WTL. What a pity.
feline Posted - Jul 16 2009 : 12:19:32 PM
Do you mean the test failed after the symbol database rebuild? I do not see any obvious problems with your stable include directories.

If you are still seeing this problem after the symbol database rebuild can you please set:

VA Options -> Projects -> C/C++ Directories -> Platform = Custom

and set the list of include directories to:

C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;

and then restart the IDE and load the test solution. This way you can simply change the platform back to "Win32" to get your old settings back.
wondering Posted - Jul 15 2009 : 9:49:05 PM
I'm sorry it can not work all the same. my stable include directories are as follow.

Platform: Win32
Stable Includes:
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
D:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
D:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
D:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
E:\\SDK\\WTL8.1\\Include;
E:\\SDK\\boost_1_39_0;

Threr are any problems in their order?
feline Posted - Jul 15 2009 : 10:37:05 AM
Can you please press the button:

VA Options -> Performance -> Rebuild symbol databases

then restart the IDE and load the test solution I uploaded. After VA has finished rebuilding its symbol database and VA's syntax colouring has been applied to the cpp file can you please re-run the tests and see what happens?

Obviously something is confusing VA, but I don't know what that something is. If this works correctly after a symbol database then it will suggest the problem is something in your main project. If it still fails then we need to look more closely at your stable include directories.
wondering Posted - Jul 14 2009 : 11:37:32 PM
// place caret into this header file name and VA definition field should show:
// C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include\\atlwin.h

----OK
// "CDialogImpl" on the next line should be shown in italic
// if italic is turned on in VA options.

----OK
// type dot after this variable name and I get many functions listed
----NO WORK, no functions listed...
If I use "Get content from default Intellisense", the functions will list.
feline Posted - Jul 13 2009 : 2:19:54 PM
Can you try downloading and opening the following test solution please:

http://forum.wholetomato.com/colin/forumimages/8811_wtl_listbox_test.zip

this is a simple VS2003 command line project where I have added the test code to the cpp file, and I have added comments describing a couple of tests I ran, in "wtl_listbox_test.cpp"

What results do you get?

This way we know we are both looking at the same solution, so it will be easier to compare things.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000