Link to home
Start Free TrialLog in
Avatar of SRIVB
SRIVB

asked on

HOW TO CONFIGURE DCOM PROGRAMATICALLY???

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????
Avatar of CJ_S
CJ_S
Flag of Netherlands image

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.
Avatar of rkot2000
rkot2000


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.

Avatar of SRIVB

ASKER

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??
Avatar of DanRollins
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
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial