First, please follow the installation instructions. Once done, the best way to get started is by looking at the examples accompanying the distribution.
Please also have a look at the sample usage section.
If the COM server you are trying to access has a Windows COM client (executed from a Remote machine), then it is probably already configured for DCOM access. If it is not so, please read FAQ (A5). If the COM server you are using is a DLL\OCX (In-Proc), you may want to have a look at FAQ (A6).
Some important things, before you start :-
Please make sure that the Server Service and Remote Registry Service are running on the Workstation where the COM server resides. Read FAQ (A12) for more details.
To avoid getting ACCESS DENIED exceptions by COM server, it is best to create a session (see sample usage on how to create one) under the identity of currently logged in user. For e.g. if you are logged into your local machine under username "administrator", the session should be created as:-
JISession session = JISession.createSession("localhost","administrator","PASSWORD");For a Domain like "MYDOMAIN", it can be likewise:-
JISession session = JISession.createSession("MYDOMAIN","DOMAINUSER","USERPASSWORD");
Incase granting "administrators" permission is a concern, then :-
- You can create a local user under "Users" group.
- Go to Control Panel > Administrative Tools > Local Security Policy > Security Settings > Local Policies > Security Options:
- Double-click "DCOM: Machine Access Restrictions" policy, click Edit Security, add the user created above, allow "Remote Access"
- Double-click "DCOM: Machine Launch Restrictions" policy, click Edit Security, add the user created above, allow "Local Launch", "Remote Launch", "Local Activation", "Remote Activation"
- Then go to Control Panel > Administrative Tools > Component Services > Computers > right-click My Computer > click Properties > click COM Security tab:
- In Access Permissions section, click Edit Default > add the user created above, allow "Remote Access"
- In Launch and Activation Permissions section > click Edit Default > add the user created above, allow "Local Launch", "Remote Launch", "Local Activation", "Remote Activation"
Sometimes the Windows Firewall will act up if not configured properly, so please make sure that you have either configured it for DCOM protocol or turned it off. Please note that the firewall issue will prevent all DCOM Windows applications to fail as well.
Please make sure that your Windows machine (where COM server is hosted) is up to date with all the Service packs and updates from Microsoft. Many a times issues are due to improper machine configuration.
This is a good article on how to configure DCOM using DCOMCnfg.
j-Interop DCOM forum is also another place where you can get configuration hints.