Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Friend member functions not recognized!

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
znakeeye Posted - Nov 17 2007 : 08:35:31 AM
MyApp.h:
class CMyApp : public CWinApp
{
private:
	friend class CHotKeyManager& GetHotKeyManager();

	static CHotKeyManager	m_hotkeyManager;

...
};


MyApp.cpp:
CHotKeyManager CMyApp::m_hotkeyManager;

CHotKeyManager& GetHotKeyManager()
{
	return CMyApp::m_hotkeyManager;
}


GetHotKeyManager not recognized by Visual Assist!
GetHotKeyManager().DoSomeStuff();
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 19 2007 : 09:41:41 AM
I am not aware of this being fixed, but I was not aware this was actually broken, so that does not prove much
znakeeye Posted - Nov 19 2007 : 02:45:05 AM
Strange. Can't reproduce it now. Was this fixed in 1614?
feline Posted - Nov 17 2007 : 4:19:38 PM
So far I cannot reproduce the problem. using VS2005 and VA 1618 I have the following code:

header file contains:

class CHotKeyManager
{
public:
	int getKeyHeight();
	int getKeyWidth();
};

class CTestHotKeyFriendFunction
{
private:
	friend class CHotKeyManager& GetHotKeyManager();

	static CHotKeyManager	m_hotkeyManager;
};

and the matching cpp file contains:

CHotKeyManager CTestHotKeyFriendFunction::m_hotkeyManager;

CHotKeyManager& GetHotKeyManager()
{
	return CTestHotKeyFriendFunction::m_hotkeyManager;
}

static void testUsingFriendFunc()
{
	GetHotKeyManager()|;
}


When I type a dot at this point VA suggests the correct members. Can you try my test code and see what results you get?

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