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
 Implement Virtual Methods
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pwc
Tomato Guru

138 Posts

Posted - Mar 18 2011 :  12:54:04 PM  Show Profile  Reply with Quote
Hi,

I can't get the 'implement virtual methods' command to work with this code:


class IShape
{
public:
    STDMETHOD(GetSize)(int* size)=0;
};

class CShape : public IShape
{
};


Right click 'CShape' and choose the command, you get the dialog listing all the virtual methods and then hit ok.

You will get an error:


---------------------------
Visual Assist X
---------------------------
Visual Assist X failed to modify one or more files. The refactoring may not have completed successfully.
Inspect your files to see if any changes need to be rolled back.

Common causes for this error are read-only files and related source control problems.
---------------------------
OK
---------------------------

It appears to have problems with the STDMETHOD macro.

Thanks,

Paul

feline
Whole Tomato Software

United Kingdom
18958 Posts

Posted - Mar 18 2011 :  7:12:36 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=56145

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

support
Whole Tomato Software

5566 Posts

Posted - May 12 2011 :  12:45:42 AM  Show Profile  Reply with Quote
case=56145 is fixed in build 1848

Whole Tomato Software, Inc.
Go to Top of Page

pwc
Tomato Guru

138 Posts

Posted - May 12 2011 :  12:54:36 AM  Show Profile  Reply with Quote
Yes, I just read the release notes and noticed this was fixed - many thanks. I'll install 1848 and report the results.

Best Regards,

Paul
Go to Top of Page

pwc
Tomato Guru

138 Posts

Posted - May 12 2011 :  5:02:19 PM  Show Profile  Reply with Quote
It works now, but could stand some improvement. I now get:


class IShape
{
public:
	STDMETHOD(f1)()=0;
};

class CShape : public IShape
{
	virtual STDMETHODIMP f1();
};


Issues/Requests:
1) Can it maintain STDMETHOD() instead of using 'virtual STDMETHODIMP'?
2) Create implementation works, but could you include 'return E_NOTIMPL;' by default? This would allow it to compile.

STDMETHODIMP CShape::f1()
{
	return E_NOTIMPL;
}


Thanks,

Paul
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18958 Posts

Posted - May 16 2011 :  3:11:50 PM  Show Profile  Reply with Quote
For point 1, I have put in a feature request for this:

case=57491

For point 2, you can change the body that VA uses by editing the VA Snippet "Refactor Create From Usage Method Body", and add the return line after or instead of the throw statement.

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