本文介绍了IntelliSense命名空间错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此代码上收到命名空间错误....
8 IntelliSense:名称后跟''::''必须是类或名称空间名称c:\ fbcode \ winmeover \ winmeover \ winmeover.cpp 7 30 WinMeOver

Recieving a Namespace Error on this code....
8IntelliSense: name followed by ''::'' must be a class or namespace namec:\fbcode\winmeover\winmeover\winmeover.cpp730WinMeOver

// WIN 7 WFP //
#include "stdafx.h"
#include <netfw.h>

int _tmain(int argc, _TCHAR* argv[])
{
typedef BOOL (*RuleCallback)(fw::INetFwRulePtr& Rule);
void ListRules(RuleCallback Callback); 
{ 
   HRESULT hr; 
   // Connect to the firewall 
   fw::INetFwPolicy2Ptr Pol2; 
   hr = Pol2.CreateInstance(__uuidof(fw::NetFwPolicy2)); 
   if(Pol2 == NULL) 
         return;
   // Retrieve collection rules 
   fw::INetFwRulesPtr Rules = Pol2->Rules; 
   if(Rules == NULL) 
         return;
   // enumerate the collection and call a callback function 
   ULONG num; 
   VARIANT obj; 
   IEnumVARIANTPtr enumerator = Rules->Get_NewEnum(); 
   while(enumerator->Next(1, &obj, &num) == S_OK) 
   { 
         fw::INetFwRulePtr Rule = obj; 
         if(!Callback(Rule)) 
               return; 
   } 
}

	return 0;
}

</netfw.h>

推荐答案


这篇关于IntelliSense命名空间错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 11:53