Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
chandir.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:
Windows Kernel
Development Platform:
Visual C++
- //
- // test code for chanmgr
- //
- #include <windows.h>
- #include <windowsx.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <ole2.h>
- #include <chanmgr.h>
- //
- // Macros
- //
- #define ASSERT(x) //if(!(x)) printf("ASSERT:line %d: %s", __line__, ##x);
- int _cdecl main()
- {
- HRESULT hr;
- hr = CoInitialize(NULL);
- if (SUCCEEDED(hr))
- {
- IChannelMgr* pIChannelMgr;
- hr = CoCreateInstance(CLSID_ChannelMgr, NULL, CLSCTX_INPROC_SERVER,
- IID_IChannelMgr, (void**)&pIChannelMgr);
- if (SUCCEEDED(hr))
- {
- ASSERT(pIChannelMgr);
- IEnumChannels* pIEnumChannels;
- hr = pIChannelMgr->EnumChannels(CHANENUM_ALL, NULL, &pIEnumChannels);
- if (SUCCEEDED(hr))
- {
- ASSERT(pIEnumChannels);
- CHANNELENUMINFO ci;
- while (S_OK == pIEnumChannels->Next(1, &ci, NULL))
- {
- printf("Channel : %Sn"
- "Url : %Sn"
- "Path : %Sn"
- "Subscription : %snn",
- ci.pszTitle, ci.pszURL, ci.pszPath,
- ci.stSubscriptionState == SUBSTATE_NOTSUBSCRIBED ?
- "Not Subscribed" :
- (ci.stSubscriptionState == SUBSTATE_FULLSUBSCRIPTION ?
- "Full Subscription" :
- "Partial Subscription")
- );
- CoTaskMemFree(ci.pszTitle);
- CoTaskMemFree(ci.pszURL);
- CoTaskMemFree(ci.pszPath);
- }
- pIEnumChannels->Release();
- }
- pIChannelMgr->Release();
- }
- }
- CoUninitialize();
- return 0;
- }