Solved

HOW TO CONFIGURE DCOM PROGRAMATICALLY???

Posted on 2001-08-03
6
461 Views
Last Modified: 2008-02-01
Hello Experts!!!

I want to configure DCOM related settings (in client and server) for my component (ActiveX dll & exe) , while running the component's setup.  I don't want to use "dcomcnfg.exe" and "clireg32.exe" for that.  (But now i'm using that.)

How i can programatically accomplish all those things which we are doing using those utility programs.  I'm also sure we can, because some programs already doing all those settings, (like dcom registration, MTS registration etc.,) when we are installing them.

Is there anybody to help me please????
0
Comment
Question by:SRIVB
6 Comments
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
here's a small article of the MSDN libraries. It means that you can use the normal registry api functions to set up the DCOM environment. It shows a small example (manual setting regisytry settings), but you can get the correct functionality too if you use the Registry API functions. I hope it is clear.

----

Changing the Registry Manually
You can also make many of these modifications manually instead of using the DCOMCNFG tool, as follows:


Using the registry editor, modify the server application's registry entries on the client and the server machines. The following registration information uses the REGEDIT4 syntax where the key is specified in square brackets. The line after each key specifies a name and a value. The name is on the left of '=' and the value on the right.
   '@' on the left indicates a value without a name. Replace the following
   GUIDs with your GUIDs. You can generate a new GUID for AppID (using
   uuidgen.exe), or use the same GUID as the CLSID. Replace hello.exe with
   your server's EXE name and replace 'Hello App' with a string that
   describes your server application:

   REGEDIT4
   ;;;; CLSID key
   [HKEY_CLASSES_ROOT\CLSID\{0bf52b11-8cab-11cf-8572-00aa00c006cf}]
   "AppID"="{0bf52b15-8cab-11cf-8572-00aa00c006cf}"

   ;;;; AppID key
   [HKEY_CLASSES_ROOT\APPID\{0bf52b15-8cab-11cf-8572-00aa00c006cf}]
   @="Hello App"

   [HKEY_CLASSES_ROOT\APPID\hello.exe]
   "APPID"="{0bf52b15-8cab-11cf-8572-00aa00c006cf}"



Remove any InprocServer32 and LocalServer32 keys from the server application's registry entries on the client machine. (These should not be removed on the server machine where the server application resides.) Add the following key to the server's registry entries on the client machine. Use the same GUID for the AppID as in the previous step. Replace server_machine_name with the name of the machine on which the server is located:
[HKEY_CLASSES_ROOT\APPID\{0bf52b15-8cab-11cf-8572-00aa00c006cf}] "RemoteServerName"="server_machine_name"


On the server machine, use DCOMCNFG or the OLE View tool to specify access and launch permissions for the server application. See the sections in this article that describe these tools for more information about how to specify permissions.
0
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility

PDW - can do some job for you...

just when you compile *.dll you need to check remote files ..

Package and Deployment Wizard ? Remote Servers

Allows you to provide or modify the settings necessary for the end user's machine to find and connect to a remote server. When end users install the package, they will be required to provide any information necessary for the connection that you did not enter here.

This screen only appears if your package includes one or more .vbr files. These and all included files are listed on the Included Files screen; they are either needed by your project, manually added to the package on the Included Files screen, or needed by another file in the package.

Options
Remote Servers List

Displays the name and current location of each .vbr file, and provides columns in which you can specify the necessary connection settings:

Net Address ? The network address of the machine where the server application will be installed. If you leave this column blank, your users will be asked for this information when they install the package.

Connection Type ? Choose whether your application uses DCOM (Distributed Component Object Model) or RA (Remote Automation) to access the remote component.

Protocol ? Displays a list of the network protocols from which you can choose. Available only if you selected RA (Remote Automation) as the connection type. If you want the end user to supply the information, choose "(End user must specify)."

Authentication ? Available only if you selected RA (Remote Automation) as the connection type. Required. For more information, see RPC Security in your Windows NT documentation.

When you move the mouse cursor over an entry in the remote servers list, a tooltip appears, listing the files for which the given file is needed or stating that the given file was manually added to the list.

0
 

Author Comment

by:SRIVB
Comment Utility
I already read those MSDN articles, but they are little confusing.  Using dcomcnfg utility i can configure some general machine settings(Enable/Disable DCOM, Default Authentication, Default Impersonation.. etc.,) as well as some settings which are specific to my component(Access Permissions, Launch Permissions, identity, activation..etc.,).  I want to do all those settings thru my program.

So can you please give some code (or) logic, specific to my requirement??
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:marconovaro
Comment Utility
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi SRIVB,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.
    *** Unsure if any answer worked and too few points to split.

SRIVB, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

10 Experts available now in Live!

Get 1:1 Help Now