T O P I C R E V I E W |
khb |
Posted - May 02 2007 : 05:00:17 AM I added a declaration of a function to my header and selected "Create Implementation". This is what happend in the source file (VS2005, WinXP, build 1555, no other add-ins):
...
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
// ----------------------------------------------------------------------------
bool CMyDlg::Test(mystllisttype::iterator it)
{
}
ON_BN_CLICKED(IDC_MYBUTTON, &MyDlg::OnMyButton)
ON_NOTIFY(TCN_SELCHANGE, IDC_MYTAB, &CMyDlg::OnChangeTab)
END_MESSAGE_MAP()
... I'd like to ask you to make sure, that functions are not added inside the message maps
Regards, Marcus. |
29 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Jul 21 2007 : 12:10:54 PM This may well be the same problem as khb was experiencing. I was able to reproduce it with his solution, but the bug was very "fragile", it didn't take much to stop it showing up, which is very similar to what you are seeing.
Hopefully the fix for case=7251 will fix the problem you are seeing as well. |
jmatthias |
Posted - Jul 20 2007 : 6:23:49 PM Just some more info.
I found that I was able to repro the problem after restarting the solution by...
Delete the method implementation. Save the file. Delete the method decleration. Save the file. Retype the decleration (don't save the file) Use the 'Create Implementation' function. It then put it in the message map. |
jmatthias |
Posted - Jul 20 2007 : 6:20:02 PM I just wanted to add my 2 cents.
This problem happened to me and I was able to undo the change and reproduce it a number of times, however, I closed Visual Studio, re-opened the solution, opened the offending file and was not then able to repoduce it. So this ones going to be fun to track down.
Good luck.
Joel |
khb |
Posted - Jul 09 2007 : 10:50:52 AM Thanks, feline!
Regards, Marcus. |
feline |
Posted - Jul 09 2007 : 10:18:01 AM I have bumped the priority on this for you, hopefully this will help. |
khb |
Posted - Jul 07 2007 : 4:37:32 PM Is there a change of seeing this fixed rather soon? I'm having this problem on most files I'm currently working on and I'm so used to the refactoring options.
Regards, Marcus. |
khb |
Posted - Jun 23 2007 : 01:52:41 AM Great news! Thank you very much!
Regards, Marcus. |
feline |
Posted - Jun 22 2007 : 7:14:20 PM case=7251 |
feline |
Posted - Jun 22 2007 : 5:35:03 PM I have the files and I am able to reproduce the problem, many thanks for this. I am currently trying to strip the files down even further, to see how small they can become and still reproduce the problem. |
khb |
Posted - Jun 22 2007 : 2:33:51 PM Feline, I just sent you the files to your personal WT email account. I hope you can reproduce the problem.
Regards, Marcus. |
feline |
Posted - Jun 21 2007 : 10:52:44 AM Many thanks for all your hard work here. I just hope I can reproduce the problem when I get the files. |
khb |
Posted - Jun 21 2007 : 03:51:39 AM The alt-m list is working, as far as I can say. I removed all includes and there are no #if statements unbalancing the code. I'm still making progress stripping down the code. I think I can send you the files tomorrow.
Regards, Marcus. |
feline |
Posted - Jun 20 2007 : 4:08:46 PM This description makes me think that there is something in this code that is confusing VA's parser, which is my only real theory.
Are you seeing any other problems? Is the alt-m list working correctly? What about next and previous scope?
Once or twice people have reported problems due to code like this:
static void problemFunction()
{
#if 0
{
{
#endif
}
which compiles perfectly, but VA's parser is confused by the mismatched brackets. These sort of problems are quite easy to detect though, since the alt-m list only reports functions above this "bad" function.
It is quite a leap from this to what you are seeing, but maybe this will give you some ideas. |
khb |
Posted - Jun 20 2007 : 09:04:16 AM I'm trying to strip it down, but the shorter the code gets, the more difficult it is to reproduce the problem. It's really strange! I spend two hours today on stripping it down, then I lost my nerves . Maybe I will continue tomorrow.
Regards, Marcus. |
feline |
Posted - Jun 20 2007 : 08:08:58 AM *um*
I have seen the pattern you describe once, perhaps twice, but that is it, and never with Create Implementation.
Something is clearly confusing VA quite a lot.
Any chance of getting some very stripped down files that reproduce this problem? I know I keep coming back to this, but so far I have not had any luck reproducing this. |
khb |
Posted - Jun 20 2007 : 02:15:35 AM *sigh* I tried it several times yesterday, with and without the comment. I always saved the files, closed them, reopened the .h file, hit "Reparse current file", and the bug showed up (or not) as expected. Today I opened the IDE freshly and it also works with the comment. Then I modified it and it stopped working. Then I put in the comment as before, saved everything, closed the solution, reopened it, and it's still broken...
Regards, Marcus.
Addendum: After some more fiddling I found that after restarting the IDE it's working most of the time. If I then edit the .h file (without changing the content) and close the .cpp file, then I can do the following: "Create Implemetation" -> Fails -> "Undo" + "Create Implemetation" -> Works -> "Undo" + "Create Implemetation" -> Fails -> "Undo" + "Create Implemetation" -> Works and so on... |
feline |
Posted - Jun 19 2007 : 10:09:29 AM I have run a load of tests, 6 different pairs of files, in different solutions, several functions per class, and not a single problem. I added this block of code to the top of each header file before starting, to make sure that VA had plenty of time to see and parse the block.
Obviously something is going on here, but so far I have no idea why a simple comment would cause so many problems. There are no keywords in the comment, or anything else to obviously cause problems. |
khb |
Posted - Jun 19 2007 : 09:00:31 AM I guess I found the problem. I just started stripping down the code and after erasing the first lines it suddenly worked. My header file starts this way: #if !defined(AFX_ULLU_H__341A251A_A882_49D6_9BB5_9FFF0D5B58D7__INCLUDED_)
#define AFX_ULLU_H__341A251A_A882_49D6_9BB5_9FFF0D5B58D7__INCLUDED_
//
static char UlluHSccsId[] = "@(#) $Id: Ullu.h 1.2 2007/06/15 09:44:50Z xxyyzz6 Exp $";
// ----------------------------------------------------------------------------
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000 The lines above cause the problem. When I remove the comment line behind the "static" line (which is generated by our versioning system), then it works. That means, this works: #if !defined(AFX_ULLU_H__341A251A_A882_49D6_9BB5_9FFF0D5B58D7__INCLUDED_)
#define AFX_ULLU_H__341A251A_A882_49D6_9BB5_9FFF0D5B58D7__INCLUDED_
//
static char UlluHSccsId[] = "@(#) $Id: Ullu.h 1.2 2007/06/15 09:44:50Z xxyyzz6 Exp $";
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000 I hope this is of any help.
Regards, Marcus. |
feline |
Posted - Jun 19 2007 : 07:29:54 AM Do you have the time to try and strip the files right down? Simply deleting the bodies out of all implementations should be quick and easy to do. If the problem still happens after you have done this you may feel able to send me a copy of these edited files.
I have never been able to reproduce the problem, but obviously it is a real problem, and one that we need to try and fix. |
khb |
Posted - Jun 19 2007 : 07:11:58 AM This is still a big problem for me. Today it already happend to me 3 times in 2 diffenent file pairs. It doesn't only happen for "Create Implementation" but also for "Move Implemetation to Source File". It happens for functions I declare before the DECLARE_MESSAGE_MAP() macro. These functions don't need to be directly before the AFX_MSG functions, it also happens if some other of my member functions follow an affected function first. But I don't know what other conditions must be valid so that this happens. One .h/.cpp pair is 150/850 lines, so I guess size isn't a factor. Ok, I have several include in the .cpp file, but only two in the .h file. If I comment out all includes it doesn't work either. The code compiles fine.
Still using VS2005, WinXP, no other add-ins.
Regards, Marcus. |
feline |
Posted - May 11 2007 : 3:36:19 PM Most kind, thank you.
My current guess, there is something slightly odd further up the cpp file that confuses VA just enough to cause this problem. If so then the problem will be file specific, and until we find this "odd thing" very hard to reproduce.
Of course I might be wrong Time will tell. |
mtwombley |
Posted - May 11 2007 : 2:03:59 PM Well....
I can't reproduce it now and I don't remember what file I did it on. I have seen this on more then one file but I wonder if it has something to do with the project??? As soon as I see it happen again I will send you the files.
Mark |
feline |
Posted - May 07 2007 : 3:07:02 PM Still no problems here. I have tried in two different header files, with different code, and for me Create Implementation never places the function into the message map.
mtwombley is there any chance you could strip these files down to the point where you could send me a copy for testing purposes? |
mtwombley |
Posted - May 04 2007 : 4:26:18 PM I'm seeing the same thing. Here is the conditions I found to repeat it.
Header file
class ReallyFunTest { public: ReallyFunTest(void); protected: bool myVars; ...
protected: DECLARE_MESSAGE_MAP() }
If I create a member after the DECLARE_MESSAGE_MAP() and go "Create Implementation". The new member appears at the end of my CPP file.
If I create a member before the DECLARE_MESSAGE_MAP() and go "Create Implementation". It appears right after BEGIN_MASSAGE_MAP in the CPP file.
Hope this helps. |
feline |
Posted - May 03 2007 : 2:54:32 PM That is the normal answer, so I am not surprised.
If you are able to produce a small example of this effect I would be very interested in seeing it. |
khb |
Posted - May 03 2007 : 02:03:15 AM I really would like to, but I'm not allowed to give you the code. Anyway, if I manage to cut down the problem to a simple test case, I'll tell you.
Regards, Marcus. |
feline |
Posted - May 02 2007 : 4:29:37 PM I have tried a couple of extra tests of this, and for me the implementation is never placed into the message map.
Would it be possible to get copies of just these two files so I can try them here? It could be something about these files, or perhaps the project its self is causing this effect. |
khb |
Posted - May 02 2007 : 12:47:53 PM Yes, I can reproduce it. It happends for all functions I add to the .h/.cpp pair. The code compiles before adding, so incorrect syntax can't be the reason. And the code doesn't look very different to what I've coded before. I have no idea why this happens for me.
Regards, Marcus. |
feline |
Posted - May 02 2007 : 11:04:29 AM Can you reproduce this effect on demand? I have just run a quick test using VS2003 and VA 1555 and the implementation is placed after the message map, not inside of it.
I am wondering if this is random - just to make my job interesting *rolls eyes* or if it happens under some specific conditions which I have not reproduced. |