Click here to Skip to main content
15,885,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using Visual Studio 2010 Ultimate on Windows 7. It seems that I can't do anything with MFC. When I try to create an MFC application, even before I add code I get this error........

Error 1 error C2039: InitNetworkAddressControl; : is not a member of ;CShellWrapper; c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.inl 202 1 NFC TEST

If I do a console program and Use of MFC is either Static or DLL I get the same error. Does anyone know of a cure for this?
Posted

1 solution

Verify Your c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h and afxcomctl32.inl files.
They must contain next code:
class CShellWrapper : public CDllIsolationWrapperBase
{
public:
	CShellWrapper() 
	: CDllIsolationWrapperBase(_T("shell32.dll"))
	{
	}
public:
	AFX_ISOLATIONAWARE_FUNC(BOOL,InitNetworkAddressControl, (void), (),FALSE)
};

and:
#define SHELL_AFXCTXFUNC(type, name, params, args) \
	inline type WINAPI AfxCtx##name##params \
	{ \
		return afxShellWrapper->_##name##args; \
	}

SHELL_AFXCTXFUNC(BOOL ,InitNetworkAddressControl,(void),())
 
Share this answer
 
Comments
Member 7766180 10-Sep-11 15:48pm    
Thank you, I tried and it didn't work.
cariolihome 10-Sep-11 16:50pm    
What did You tried ?
Member 7766180 10-Sep-11 17:17pm    
I added the two code blocks to the two files....afxcomctl32.h and afxcomctl32.inl. Perhaps they are in the wrong place? Where exactly do they go?
cariolihome 10-Sep-11 17:21pm    
This files must already contain this code. You have to find code blocks and just verify that code blocks are identical.
Member 7766180 10-Sep-11 18:44pm    
Actually they didn't contain the code. Only shellapi contained the #define part, the second one. In the others all was missing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900