views:

50

answers:

1

Dear All,

I am developing an application to get the networks available on the system. Trying to run the same on windows vista. (The below code is based on the link : http://msdn.microsoft.com/en-us/library/ms697388(VS.85).aspx)

Below is the Code Snippet:

#include "Netlistmgr.h"
#include "Objbase.h"


INetworkListManager* pNLM = NULL;
IEnumNetworks *pEnumNetworks = NULL;
hr = ::CoCreateInstance(CLSID_CNetworkListManager,
  NULL,
  CLSCTX_LOCAL_SERVER,
  IID_INetworkListManager,
  (LPVOID*) &pNLM);

error C2065: 'CLSID_CNetworkListManager' : undeclared identifier

Kindly help... Have i missed any header files/Library files???

Thanks, Suren

+2  A: 

INetworkListManager comes with Vista and up, you need to make sure that you have #define WINVER=600 defined in your source before #include or in the project settings.

You also need to make sure that you have Platform SDK 6.0 and up, if your working with Visual Studio 2008 then you're already using it.

Shay Erlichmen