Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Shall I release a Dll? Pin
Steen Krogsgaard16-Oct-01 23:38
Steen Krogsgaard16-Oct-01 23:38 
GeneralRe: Shall I release a Dll? Pin
Maer72717-Oct-01 2:02
Maer72717-Oct-01 2:02 
QuestionWhich type of file is : .ocx ? Pin
16-Oct-01 22:59
suss16-Oct-01 22:59 
AnswerRe: Which type of file is : .ocx ? Pin
Jon Hulatt17-Oct-01 1:10
Jon Hulatt17-Oct-01 1:10 
QuestionHow to get global caret position in screen? Pin
tfElep16-Oct-01 21:49
tfElep16-Oct-01 21:49 
AnswerRe: How to get global caret position in screen? Pin
Tomasz Sowinski17-Oct-01 0:40
Tomasz Sowinski17-Oct-01 0:40 
GeneralShared network resources Pin
Daniel Visan16-Oct-01 21:20
Daniel Visan16-Oct-01 21:20 
GeneralRe: Shared network resources Pin
Andres Manggini17-Oct-01 5:46
Andres Manggini17-Oct-01 5:46 
Hi,
you can do it using this functions:

WNetOpenEnum
WNetEnumResource

You'll find all the information on MSDN.

I wrote a little program that walks through all machines in the local network looking for shared directories (it was 3 or 4 years ago), this is a snippet:


void CNetScanDlg::StartScan()
{
ULONG ulDataSize = 16000;
NETRESOURCE* pData = new NETRESOURCE[ulDataSize];
DWORD dwEntries = 0xFFFFFFFF;

OpenContainer(NULL);
delete [] pData;
}


BOOL CNetScanDlg::OpenContainer(NETRESOURCE* pNetRes)
{
//Datos necesarios para la API de NetWorking
ULONG ulDataSize = 16000;
NETRESOURCE* pData = new NETRESOURCE[ulDataSize];
DWORD dwEntries = 0xFFFFFFFF;
DWORD dwResult;
HANDLE handle;
//

dwResult = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pNetRes, &handle);
if( dwResult == NO_ERROR )
{
dwResult = WNetEnumResource( handle, &dwEntries, pData, &ulDataSize);
if( dwResult == NO_ERROR )
{
for( DWORD i = 0; i < dwEntries; i++)
{
AddItem( pData[i] );
if(RESOURCEUSAGE_CONTAINER == (pData[i].dwUsage & RESOURCEUSAGE_CONTAINER))
{
OpenContainer( &pData[i] ); //Recursividad
}
}
}
}
delete [] pData;
return FALSE;
}





Andres Manggini.
Buenos Aires - Argentina.
GeneralRe: Shared network resources Pin
Andres Manggini17-Oct-01 5:54
Andres Manggini17-Oct-01 5:54 
GeneralSharing a data segment in a DLL Pin
Mr.Freeze16-Oct-01 18:51
Mr.Freeze16-Oct-01 18:51 
GeneralRe: Sharing a data segment in a DLL Pin
Michael Dunn16-Oct-01 19:47
sitebuilderMichael Dunn16-Oct-01 19:47 
GeneralRe: Sharing a data segment in a DLL Pin
Mr.Freeze16-Oct-01 20:29
Mr.Freeze16-Oct-01 20:29 
GeneralDetecting List View Header Click in Dialog Pin
16-Oct-01 16:54
suss16-Oct-01 16:54 
GeneralRe: Detecting List View Header Click in Dialog Pin
Michael Dunn16-Oct-01 17:25
sitebuilderMichael Dunn16-Oct-01 17:25 
GeneralCreating Property ... Pin
Hadi Rezaee16-Oct-01 12:35
Hadi Rezaee16-Oct-01 12:35 
GeneralDLL in ATL . small question ! Pin
mimi16-Oct-01 11:48
mimi16-Oct-01 11:48 
GeneralRe: DLL in ATL . small question ! Pin
Christian Graus17-Oct-01 11:22
protectorChristian Graus17-Oct-01 11:22 
GeneralCStrings Pin
Chris Klecker16-Oct-01 10:25
Chris Klecker16-Oct-01 10:25 
GeneralRe: CStrings Pin
Ravi Bhavnani16-Oct-01 10:30
professionalRavi Bhavnani16-Oct-01 10:30 
GeneralRe: CStrings Pin
Jamie Nordmeyer16-Oct-01 11:15
Jamie Nordmeyer16-Oct-01 11:15 
GeneralRe: CStrings Pin
Nish Nishant16-Oct-01 22:08
sitebuilderNish Nishant16-Oct-01 22:08 
GeneralRe: CStrings Pin
#realJSOP17-Oct-01 0:26
professional#realJSOP17-Oct-01 0:26 
GeneralMaking things pretty by returning BSTR's (ATLCOM) Pin
Tim Rymer16-Oct-01 10:02
Tim Rymer16-Oct-01 10:02 
GeneralRe: Making things pretty by returning BSTR's (ATLCOM) Pin
Carlos Antollini16-Oct-01 10:27
Carlos Antollini16-Oct-01 10:27 
GeneralRe: Making things pretty by returning BSTR's (ATLCOM) Pin
Tim Rymer16-Oct-01 10:48
Tim Rymer16-Oct-01 10:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.