Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to free the memory if memory is allocation using memset PinPopular
Niklas L21-Sep-11 23:12
Niklas L21-Sep-11 23:12 
AnswerRe: How to free the memory if memory is allocation using memset Pin
CPallini21-Sep-11 23:49
mveCPallini21-Sep-11 23:49 
AnswerRe: You can use the function - free() after first calling malloc() Pin
Software_Developer21-Sep-11 23:54
Software_Developer21-Sep-11 23:54 
AnswerRe: How to free the memory if memory is allocation using memset Pin
Erudite_Eric22-Sep-11 2:58
Erudite_Eric22-Sep-11 2:58 
Questionc++ objects, I don't get it - IIS ADSI object Pin
jkirkerx21-Sep-11 18:57
professionaljkirkerx21-Sep-11 18:57 
AnswerRe: c++ objects, I don't get it - IIS ADSI object Pin
XTAL25621-Sep-11 21:04
XTAL25621-Sep-11 21:04 
AnswerRe: c++ objects, I don't get it - IIS ADSI object Pin
Jim Crafton22-Sep-11 4:27
Jim Crafton22-Sep-11 4:27 
GeneralRe: c++ objects, I don't get it - IIS ADSI object Pin
jkirkerx22-Sep-11 6:17
professionaljkirkerx22-Sep-11 6:17 
ohoooo

That was sort of like the registry function I wrote, In which it returns the Success code, and the object in the function contains the data.

Much different than VB or C#, or JavaScript.

Is it possible to export that com object, and pass it to another function for further processing?

HRESULT CA_WebInfo::get_IIS_VirtualDirectories( DWORD InstanceID ) {  
    
	HRESULT hr = CoInitialize( NULL );  
      
    if ( SUCCEEDED( hr ) ) {  
        USES_CONVERSION;  
      
        CComPtr<IADs> pADs;  
        CComPtr<IISApp2> pApp2;  
        WCHAR ADSIPath[50];  
      
        //Get the IIsWebServer object - IIS://localhost/w3svc/xxx  
        wsprintfW( ADSIPath, L"IIS://localhost/w3svc/%d", InstanceID );  
        hr = ADsGetObject( ADSIPath, IID_IADs, (void **)&pADs );  
      
		if ( SUCCEEDED( hr ) ) {  
			//use the &pADS - Decode it, grab it or something
        };   
      
        pADs = NULL;  
      
        //Get the IIsWebDirectory object - IIS://localhost/w3svc/xxx/root  
        hr = ADsGetObject( ADSIPath, IID_IADs, (void **)&pADs );  
        if ( SUCCEEDED( hr ) ) {  
          //Read the root folder of the IIsWebDirectory  
          hr = pADs->QueryInterface( IID_IISApp2, (void **)&pApp2 );  
          if ( SUCCEEDED( hr ) ) {  
            CComBSTR bstrVarname = L"Path";  
            CComVariant varAppRootPath;   
      
            hr = pApp2->Get( bstrVarname, &varAppRootPath );  
            if ( SUCCEEDED( hr ) ) {   
              //IISWebInfo->RootPath = OLE2T( varAppRootPath.bstrVal );  
			}
          }; //SUCCEEDED( hr ) - IID_IISApp2  
      
        };//SUCCEEDED( hr ) - IID_IADs  
      };//SUCCEEDED( hr ) - CoInitialize( NULL );  
      
      CoUninitialize();  
      return hr;    
}

GeneralRe: c++ objects, I don't get it - IIS ADSI object Pin
Jim Crafton22-Sep-11 6:24
Jim Crafton22-Sep-11 6:24 
GeneralRe: c++ objects, I don't get it - IIS ADSI object Pin
jkirkerx22-Sep-11 6:52
professionaljkirkerx22-Sep-11 6:52 
Questionlanguage problem in C .. Pin
gateway2321-Sep-11 0:52
gateway2321-Sep-11 0:52 
AnswerRe: language problem in C .. Pin
Stefan_Lang21-Sep-11 1:39
Stefan_Lang21-Sep-11 1:39 
AnswerRe: IsTextUnicode function Pin
Software_Developer21-Sep-11 7:31
Software_Developer21-Sep-11 7:31 
QuestionCombob box get hide at mouse release Pin
Amrit Agr21-Sep-11 0:15
Amrit Agr21-Sep-11 0:15 
AnswerRe: Combob box get hide at mouse release Pin
Code-o-mat21-Sep-11 9:04
Code-o-mat21-Sep-11 9:04 
QuestionMemory Leak Pin
Tal Rasha's Guardianship20-Sep-11 17:38
Tal Rasha's Guardianship20-Sep-11 17:38 
AnswerRe: Memory Leak Pin
Stefan_Lang20-Sep-11 23:28
Stefan_Lang20-Sep-11 23:28 
AnswerRe: calculate virtual address space Pin
Software_Developer21-Sep-11 10:10
Software_Developer21-Sep-11 10:10 
AnswerRe: Memory Leak Pin
Member 441644522-Sep-11 5:23
Member 441644522-Sep-11 5:23 
QuestionUse AfxParseURLEx ? Pin
bosfan20-Sep-11 2:53
bosfan20-Sep-11 2:53 
QuestionRe: Use AfxParseURLEx ? Pin
David Crow20-Sep-11 9:18
David Crow20-Sep-11 9:18 
AnswerRe: Use AfxParseURLEx ? Pin
bosfan20-Sep-11 20:32
bosfan20-Sep-11 20:32 
GeneralRe: Use AfxParseURLEx ? Pin
XTAL25620-Sep-11 20:41
XTAL25620-Sep-11 20:41 
QuestionCOM DLL Reg Pin
john563220-Sep-11 1:38
john563220-Sep-11 1:38 
AnswerRe: COM DLL Reg Pin
Rajesh R Subramanian20-Sep-11 2:21
professionalRajesh R Subramanian20-Sep-11 2:21 

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.