想调用这样的一个方法INetSharingConfiguration::DisableInternetFirewall,作用是在Xp或以后的操作系统中弹出一个对话框,作用是询问用户是否关闭系统的防火墙,该方法是基于COM的。
头文件有NetCon.h和NetCon.idl,
请我在我的应用程序里面该如何调用该方法?!小弟对COM知之甚少,请说的详细一点,谢谢!MSDN的描述:
The DisableInternetFirewall method disables Internet Connection Firewall on this connection.
……
Use the INetSharingManager::get_INetSharingConfigurationForINetConnection method to obtain an INetSharingConfiguration interface for a particular connection.Client: Included in Windows XP.
Header: Declared in Netcon.idl.
Library: Included as a resource in HNetCfg.dll.
头文件有NetCon.h和NetCon.idl,
请我在我的应用程序里面该如何调用该方法?!小弟对COM知之甚少,请说的详细一点,谢谢!MSDN的描述:
The DisableInternetFirewall method disables Internet Connection Firewall on this connection.
……
Use the INetSharingManager::get_INetSharingConfigurationForINetConnection method to obtain an INetSharingConfiguration interface for a particular connection.Client: Included in Windows XP.
Header: Declared in Netcon.idl.
Library: Included as a resource in HNetCfg.dll.
解决方案 »
- 请教大家一个困扰了我很久的问题啊,关于VC++中多线程中Sleep
- #pragma pack 引起的错误
- 在上传软件时要显示上传的进度,我希望在列表框中显示上传文件的进度,我如何在列表中加入进度条。先谢谢了
- SetSCBStyle()的用法??
- 如何找到代码中sizeof最大的全局变量?300分全送,不够再加两千
- CListCtrl 控件,当view属性为report时,InsertItem(1,"1"),插入时,为什么在1的前面有一个 小方框 ,怎样去掉?
- 高分询问一条简单问题!
- 如何实现MPEG2的多倍速播放?(已有MPEG2 DECODER)
- 谁知道菜鸟级问题???????????·····
- 又是关于afxcomctl32.h错误,求助
- 可以不建立数据源直接操纵ACCESS文件吗, 为什么?
- 如何消除编译警告!!!
{
::CoInitialize(NULL); {
HNC::INetSharingManagerPtr pNSM;
HRESULT hr = pNSM.CreateInstance(__uuidof(HNC::NetSharingManager)); HNC::INetSharingEveryConnectionCollectionPtr pNSECC = pNSM->EnumEveryConnection; if (pNSECC != NULL)
{
IEnumVARIANTPtr pEnum = pNSECC->_NewEnum;
if (pEnum != NULL)
{
HNC::INetConnectionPtr pNC;
HNC::INetSharingConfigurationPtr pNSC;
ULONG fetched;
VARIANT rg; do
{
pEnum->Next(1UL, &rg, &fetched);
if (fetched != 0)
{
pNC = rg.pdispVal;
pNSC = pNSM->GetINetSharingConfigurationForINetConnection(pNC);
// pNSC->DisableInternetFirewall();
// pNSC->EnableInternetFirewall();
}
} while (fetched != 0);
}
}
} ::CoUninitialize();
}============================================================================
NetCon.h
好象只在WinCE下的系统才有吧?我找到的都是SmartPhone 或 PPC下的!
----------------〉
HNetCfg.dll也找不到!
Netcon.idl里面只有:
INetConnectionManager 而没有INetSharingManager接口。