Solved

How to simulate GetObject to IIS in C++

Posted on 2002-05-12
3
452 Views
Last Modified: 2008-01-09
Hi,
I need to translate this code to C++:

ADSIPath = "IIS:// & myServer & "/W3SVC/1/ROOT"
Set defaultSite = GetObject(ADSIPath)
Set vDir = defaultSite.Create("IISWebVirtualDir","test")
vDir.Path = "c:\testdir"
0
Comment
Question by:galor
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 7004329
One way would be to create a script and use ShellExecute, as in this example:

http://groups.google.com/groups?hl=en&selm=3908C4C9.69C51301%40yahoo.com

There is also some example .VBS and .JS code in your IIS SDK samples dir:

      C:\InetPub\iissamples\sdk\admin

I found some C++ examples in Google Groups, but I'm too tired to work through them.  I'll see if I can get to it tomorrow.  Here's one if you want to try it on your own:

http://groups.google.com/groups?selm=3909a21a.8069202%40newsgroups.borland.com&output=gplain

-- Dan

0
 

Expert Comment

by:arvi_sam
ID: 7004529
Try using the IMoniker interface and using its GetObject method. That should solve your problem. Follow the link below on a short introduction to IMoniker

www.devx.com/premier/mgznarch/ vcdj/1997/jul97/moniker3.asp

-Arvind Shyamsundar
Brainbench MVP for Internet Security.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7004667
hi galor,
Thanks for accepting.  Is that all of the help you need?  As I mentioned, my intention was to work through the samples and provide some clean functional code.  But if the question is answered, I'll move on to other things...

-- Dan
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now