Click here to Skip to main content
16,005,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Another group of questions... Pin
Christian Graus28-Mar-02 16:11
protectorChristian Graus28-Mar-02 16:11 
GeneralRe: Another group of questions... Pin
SilverShalkin28-Mar-02 17:30
SilverShalkin28-Mar-02 17:30 
GeneralRe: Another group of questions... Pin
alex.barylski28-Mar-02 19:39
alex.barylski28-Mar-02 19:39 
GeneralRe: Another group of questions... Pin
Nish Nishant28-Mar-02 20:55
sitebuilderNish Nishant28-Mar-02 20:55 
GeneralRe: Another group of questions... Pin
alex.barylski28-Mar-02 22:12
alex.barylski28-Mar-02 22:12 
GeneralRe: Another group of questions... Pin
Mazdak28-Mar-02 21:09
Mazdak28-Mar-02 21:09 
GeneralRe: Another group of questions... Pin
alex.barylski28-Mar-02 22:08
alex.barylski28-Mar-02 22:08 
QuestionIIsWebVirtualDir and using the Internet Information Services? Pin
Craig Miller28-Mar-02 12:48
Craig Miller28-Mar-02 12:48 
Hi,

I'm trying to programmatically create some virtual directories for a release process and I've run into a strange problem. If I create the virtual directory using the Internet Information Services control panel, the directory is fine and it has an icon of a box with a ball coming out of it. If I use the code shown below, it looks like it creates an application instead of a virtual directory like I think it should. The resulting icon is a folder with a little world on the right lower corner.

Can anyone see what I'm doing wrong with the code below?

Thanks in advance,

Craig

USES_CONVERSION;
try
{
HRESULT hr; // Generic COM result variable
_variant_t variant; // Variant used to set some properties in the metabase
IADsContainer* virtDirRoot; // Virtual root
IADs* virtDir; // The new virtual directory
IDispatch* pDisp = NULL;

//
// Get the virtual directory root
//
hr = ADsGetObject(L"IIS://Localhost/W3svc/1/ROOT",
IID_IADsContainer,
(void**) &virtDirRoot);
if(FAILED(hr))
{
return hr;
}

//
// Create the new virtual directory
//
_bstr_t virtPath("c:\\inetput\\wwwroot\\Test");
hr = virtDirRoot->Create(L"IIsWebVirtualDir", // Name of the virtual directory schema class
L"Test", &pDisp); // Relative name of the object to create
if(FAILED(hr))
{
IErrorInfoPtr error;
HRESULT hr;

CComBSTR description;
hr = GetErrorInfo(0, &error);
if (SUCCEEDED(hr) && error != NULL
&& SUCCEEDED(error->GetDescription(&description)))
{
//return description;
}
}

// Get the IADsContainer interface
hr = pDisp->QueryInterface(IID_IADs, (void**) &virtDir);

// Set the AspAllowOutOfProcess switch
variant = L"true";
virtDir->Put(METABASE_ALLOW_OUT_OF_PROC_COMPONENTS, variant);
virtDir->Put(L"AccessExecute", variant);

// Set the physical path
variant = physDirPath;
virtDir->Put(L"Path", variant);

//
// Set the info
//
virtDir->SetInfo();

return 0;
}
Generalbeginning a thread : MFC vs direct API Pin
28-Mar-02 11:36
suss28-Mar-02 11:36 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tomasz Sowinski28-Mar-02 11:36
Tomasz Sowinski28-Mar-02 11:36 
GeneralRe: beginning a thread : MFC vs direct API Pin
28-Mar-02 12:06
suss28-Mar-02 12:06 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tomasz Sowinski28-Mar-02 12:11
Tomasz Sowinski28-Mar-02 12:11 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tim Smith28-Mar-02 12:19
Tim Smith28-Mar-02 12:19 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tomasz Sowinski28-Mar-02 12:25
Tomasz Sowinski28-Mar-02 12:25 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tim Smith28-Mar-02 12:30
Tim Smith28-Mar-02 12:30 
GeneralRe: beginning a thread : MFC vs direct API Pin
Nish Nishant28-Mar-02 14:44
sitebuilderNish Nishant28-Mar-02 14:44 
GeneralRe: beginning a thread : MFC vs direct API Pin
Tim Smith28-Mar-02 14:53
Tim Smith28-Mar-02 14:53 
GeneralRe: beginning a thread : MFC vs direct API Pin
29-Mar-02 7:04
suss29-Mar-02 7:04 
GeneralIstream & Global Alloc & GDI+! Pin
AJ12328-Mar-02 10:11
AJ12328-Mar-02 10:11 
GeneralRe: Istream & Global Alloc & GDI+! Pin
Paul M Watt28-Mar-02 11:08
mentorPaul M Watt28-Mar-02 11:08 
GeneralProblem using DIalogBar Pin
Maverick28-Mar-02 8:43
Maverick28-Mar-02 8:43 
GeneralRe: Problem using DIalogBar Pin
Shog928-Mar-02 8:55
sitebuilderShog928-Mar-02 8:55 
GeneralRe: Problem using DIalogBar Pin
Maverick28-Mar-02 14:48
Maverick28-Mar-02 14:48 
GeneralRe: Problem using DIalogBar Pin
Shog928-Mar-02 14:57
sitebuilderShog928-Mar-02 14:57 
GeneralRe: Problem using DIalogBar Pin
Maverick28-Mar-02 19:11
Maverick28-Mar-02 19:11 

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.