Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1535 - Create Implementation annoyings

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
swinefeaster Posted - Sep 21 2006 : 4:40:38 PM
Why do I have to press my CreateImp hot key sometimes multiple times on a function to get it to work? Seems it doesn't always work the first time.

Also, it doesn't work for overloaded operators like this:

operator DWORD(void)const;
19   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 25 2007 : 08:32:14 AM
Does the shift + right click menu seem more unreliable in 1559? Or is it about the same?

We have had reports of both problems with this menu on and off for a while now, but I have never had much success in reproducing either of them. Currently I am able to reproduce the menu appearing and then disappearing when I first load VC6 and trigger it in 1559, but this only happens if I keep the shift key held down after the menu appears.

case=6310


For the Create Implementation problem, using VC6 and VA 1559 I have assigned the keyboard shortcut CTRL+ALT+C to Create Implementation. I copy / pasted the code into a header file and then move down these functions, one by one, using the keyboard shortcut to trigger Create Implementation and alt-o to swap back to the header file.

I have 6 different implementations in the cpp file, no sign of a problem here.

If you are able to reproduce this problem it is possible something about the header or cpp file is confusing VA.
swinefeaster Posted - Jul 24 2007 : 3:19:37 PM
maybe because i use a hotkey for create implementation? this was also in vc6.

btw your context menu in vc6 is very buggy and doesn't stay on when you shift+right click --- sometimes it disappears right after being displayed, or worse it executes some command without the user clicking it... but that's ok there are always shortcuts!
feline Posted - Jul 21 2007 : 10:09:59 AM
Are you able to reproduce this problem?

using VS2005 and VA 1559 I have just copy / pasted this code into an existing class in a header file, and run Create Implementation on each function in turn, and all of the newly created implementations are different. No duplicates here.

Do you know if your machine was running slowly when you did this? Some process using 100% of the CPU?
As a wild theory I am wondering if you managed to trigger the second Create Implementation before VA had realised you had moved the caret to a new position in the file, and it picked up the old position. This does seem unlikely though.
swinefeaster Posted - Jul 20 2007 : 2:33:18 PM
Ok I just got it again:

in h file:

  // Called on the first timer tick of the animation
  void animationStarted(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);

  // Called on the first timer tick of the animation
  virtual void animationStartedInternal(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);

  // Called on each timer tick of the animation
  void animationAction(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);

  // Overridable called on each timer tick of the animation.
  virtual void animationActionInternal(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);

  // Called on the last timer tick of the animation
  void animationEnded(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);

  // Overridable called on the last timer tick of the animation
  virtual void animationEndedInternal(
    const OnMessageInputInfo& inputInfo,
    OnMessageResultInfo& resultInfo);


then create imp does:

void
OverlayAnimation::animationStarted(const OnMessageInputInfo& inputInfo, OnMessageResultInfo& resultInfo)
{
  
}

void
OverlayAnimation::animationStarted(const OnMessageInputInfo& inputInfo, OnMessageResultInfo& resultInfo)
{
  
}


and I tried to do animationStarted() and then animationStartedInternal().

Hope this helps,

swine
feline Posted - Jul 17 2007 : 3:02:11 PM
If you can reproduce the bug then any details you can provide would be most helpful.
swinefeaster Posted - Jul 17 2007 : 2:29:36 PM
duh, you're right!

but i still think i've seen the bug described. i will let you know if i see it again.

thanks

swine
feline Posted - Jun 26 2007 : 08:07:56 AM
Thank you for the very clear description.

Your header file, did you copy / paste the code from your solution into this forum thread, or did you re-type it? I have not run Create Implementation on this code yet, but the code you have posted shows that VA was working correctly. In your header file the two operator functions are identical. I have just asked VS2005 to compile the class, to make sure I am not imagining things, and it reported:

Error 4 error C2535: 'CurrencyCode &CurrencyCode::operator =(const CString &)' : member function already defined or declared
swinefeaster Posted - Jun 25 2007 : 4:57:33 PM
Ok I just experienced this on a new class.

I created the header:



#pragma once

// This class is used to represent a currency.

class CurrencyCode
{
  public:
    CurrencyCode(int code);
    CurrencyCode(const CString& stringCode);

    // Sets as CURR_XXX code.
    CurrencyCode& operator=(const CString& stringCode);

    // Sets as string code.
    CurrencyCode& operator=(const CString& stringCode);

    // Returns the string representation.
    CString getStringCode(void)const;

    // Returns one of the CURR_XXX constants.
    int getCode(void)const;

  private:
    // One of the CURR_XXX constants.
    int m_code;
};


and then the cpp file like so:


#include "StdAfx.h"
#include "CurrencyCode.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


Now I added them both to the project. Close both and reopened them (otherwise Visual Assist create imp doesn't work at all).

Then I went to the header, and used my Shift+Alt+X hotkey to create implementations for all the functions, from top to bottom. Each time I hit that, I hist my switch between cpp/h hotkey to go back to the header, click on the next function, and then hit Shift+Alt+X. And so forth.

I got:



#include "StdAfx.h"
#include "CurrencyCode.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


CurrencyCode::CurrencyCode(int code)
{
  
}

CurrencyCode::CurrencyCode(const CString& stringCode)
{
  
}

CurrencyCode&
CurrencyCode::operator=(const CString& stringCode)
{
  
}

CurrencyCode&
CurrencyCode::operator=(const CString& stringCode)
{
  
}

CString
CurrencyCode::getStringCode(void)const
{
  
}

int
CurrencyCode::getCode(void)const
{
  
}


Notice the operators were duplicated even though I clicked correctly in the header.

Thanks,

swine
feline Posted - Jun 22 2007 : 5:15:46 PM
As a test I have just created 5 overloads of the same function, in a class, and then run Create Implementation on each of the overloads in turn. As expected Create Implementation worked perfectly on all 5 of them.

If / when you next see this problem any clues you could offer would be greatfully received. I am wondering if somehow the problem was file specific, perhaps there was something that was confusing VA, or if you had been actively editing the file VA was not properly caught up when you triggered the refactoring, so it performed the operation on the function that used to be on line X, rather than the line that currently was on line X.
swinefeaster Posted - Jun 22 2007 : 12:31:54 PM
this was on the 1557 build.

yes i think they were overloads of each other, though i may have also seen it happen when they were not.

sorry i haven't seen this problem in a while (i haven't been creating that many new classes lately)...
feline Posted - Jun 08 2007 : 1:17:42 PM
Have you seen this problem with 1557 yet?
How are you triggering Create Implementation?
Are the functions overloads of each other, or are they "unrelated"?
swinefeaster Posted - Jun 08 2007 : 1:05:18 PM
ok thanks guys this works a lot better now...

however... sometimes when i do CreateImp it does it on the previous function I did a CreateImp for --- not the one the cursor is on.

i'll let you know if i see this again.
support Posted - May 31 2007 : 12:27:50 AM
fixed in build 1557
sean Posted - Oct 06 2006 : 12:52:09 AM
The reparse happens automatically - but it waits for a break in typing or for a change in focus (so pressing the hotkey 5 times might actually be counter-productive). And you don't really want us to reparse the file everytime the IDE asks us to handle QueryStatus (separate calls to enable/disable each of the commands we expose to the VS shell).
swinefeaster Posted - Oct 05 2006 : 4:14:52 PM
well a better way for VAX to do this would be to:

1. check if knows that function
2. if yes, ok, if not, reparse current file
3. check again if knows that function....

manually reparsing the file is just a work around... i'd rather hit the CreateImp hotkey 5 times than doing a reparse, personally.

thanks

sean Posted - Sep 28 2006 : 3:06:35 PM
There is a reparse menu item in the Tools submenu of the VA menu:
Alt+A,T,R
swinefeaster Posted - Sep 28 2006 : 2:50:12 PM
> does this sound like it matches your experience?

YES, that's it exactly. any way we can force a reparse around the current line before failing the Create Implementation ?

thanks
feline Posted - Sep 24 2006 : 3:07:42 PM
if you open the VAssistX menu and then the refactoring sub-menu is the option "Create Implementation" greyed out?

i have run into a problem that sometimes the refactoring operations are not available immediately after you have added a new class member function. i suspect this is because VA has not re-parsed the file and caught up with the change. does this sound like it matches your experience?
jpizzi Posted - Sep 22 2006 : 01:31:22 AM
I can get the lack of refactoring offering on conversion operators like your example.

case=2649

Not having a hotkey for CreatImp, I don't know how to approach the first issue. If you hover over the function, does the refactor icon appear reliably? Is there any pattern you can discern about the "sometimes"?

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