Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Goto not working with STDMETHOD_ macro

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
pwc Posted - Aug 15 2012 : 11:53:14 AM
Hello,

In a header have:


class CMyClass : public IUnknown
{
public: 
	CMyClass();
	STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
	STDMETHOD_(ULONG, AddRef)(void);
	STDMETHOD_(ULONG, Release)(void);
};

In the corresponding cpp file:

STDMETHODIMP CMyClass::QueryInterface(REFIID riid, void **ppvObject)
{
	if(!ppvObject)
		return E_POINTER;
	if(riid == IID_IUnknown)
	{
		*ppvObject = static_cast<IUnknown*>(this);
		AddRef();
		return S_OK;
	}
	return E_NOINTERFACE;
}

STDMETHODIMP_(ULONG) CMyClass::AddRef(void)
{
	return 2;
}

STDMETHODIMP_(ULONG) CMyClass::Release(void)
{
	return 1;
}



In the header, trying hitting alt-g on AddRef or Release - nothing happens. QueryInterface works.

1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Aug 15 2012 : 11:27:13 PM
I am seeing the same effect here. Thank you for the clear description.

case=58457

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