Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1555: Create Implementation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - May 02 2007 :  05:00:17 AM  Show Profile  Reply with Quote
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.

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - May 02 2007 :  11:04:29 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - May 02 2007 :  12:47:53 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - May 02 2007 :  4:29:37 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - May 03 2007 :  02:03:15 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - May 03 2007 :  2:54:32 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

mtwombley
Senior Member

Canada
29 Posts

Posted - May 04 2007 :  4:26:18 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - May 07 2007 :  3:07:02 PM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

mtwombley
Senior Member

Canada
29 Posts

Posted - May 11 2007 :  2:03:59 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - May 11 2007 :  3:36:19 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 19 2007 :  07:11:58 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 19 2007 :  07:29:54 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 19 2007 :  09:00:31 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 19 2007 :  10:09:29 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 20 2007 :  02:15:35 AM  Show Profile  Reply with Quote
*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...

Edited by - khb on Jun 20 2007 03:15:55 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 20 2007 :  08:08:58 AM  Show Profile  Reply with Quote
*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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 20 2007 :  09:04:16 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 20 2007 :  4:08:46 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 21 2007 :  03:51:39 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 21 2007 :  10:52:44 AM  Show Profile  Reply with Quote
Many thanks for all your hard work here. I just hope I can reproduce the problem when I get the files.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 22 2007 :  2:33:51 PM  Show Profile  Reply with Quote
Feline, I just sent you the files to your personal WT email account. I hope you can reproduce the problem.

Regards,
Marcus.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 22 2007 :  5:35:03 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jun 22 2007 :  7:14:20 PM  Show Profile  Reply with Quote
case=7251

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 23 2007 :  01:52:41 AM  Show Profile  Reply with Quote
Great news! Thank you very much!

Regards,
Marcus.
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jul 07 2007 :  4:37:32 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jul 09 2007 :  10:18:01 AM  Show Profile  Reply with Quote
I have bumped the priority on this for you, hopefully this will help.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jul 09 2007 :  10:50:52 AM  Show Profile  Reply with Quote
Thanks, feline!

Regards,
Marcus.
Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Jul 20 2007 :  6:20:02 PM  Show Profile  Reply with Quote
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
Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Jul 20 2007 :  6:23:49 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jul 21 2007 :  12:10:54 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000