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
 Feature Requests
 Friend member functions not recognized!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Nov 17 2007 :  08:35:31 AM  Show Profile  Reply with Quote
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();

Edited by - znakeeye on Nov 17 2007 08:36:32 AM

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Nov 17 2007 :  4:19:38 PM  Show Profile  Reply with Quote
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?

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

znakeeye
Tomato Guru

379 Posts

Posted - Nov 19 2007 :  02:45:05 AM  Show Profile  Reply with Quote
Strange. Can't reproduce it now. Was this fixed in 1614?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Nov 19 2007 :  09:41:41 AM  Show Profile  Reply with Quote
I am not aware of this being fixed, but I was not aware this was actually broken, so that does not prove much

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