IntelliSense命名空间错误 [英] IntelliSense Namespace Error

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

问题描述

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

Recieving a Namespace Error on this code....
8 IntelliSense: name followed by ''::'' must be a class or namespace name c:\fbcode\winmeover\winmeover\winmeover.cpp 7 30 WinMeOver

// 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>

推荐答案

我相信您尚未在此处完成#import.
#import是为您提供后缀为Ptr的智能指针的原因. #import指令(C/C ++) [
I believe you haven''t done the #import here.
#import is what gives you the smart pointers suffixed with Ptr.
#import Directive (C/C++)[^]


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆