[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


CreateRemoteComObject + username/password

Posted on 2007-07-30
Medium Priority
Last Modified: 2009-12-16
I have a Delphi 6 app that attaches to an OPC server via CreateRemoteComObject it works fine as long as the server has been configured to allow access to EVERYONE via DCOMCNFG on the remote machine. I now have a customer who is complaining that they don't want to open up access to EVERYONE for security purposes. My question is: is there a way to include a user name/password in the CreateRemoteComObject function call? I seem to remember something about appending a username/password to the MachineName parameter, but I'm having no luck re-discovering that info via Google.
Question by:BradKilmer
  • 2
LVL 21

Expert Comment

ID: 19598292
the best and easiest way is to run your app as user that has granted access to DCOM server


Author Comment

ID: 19602572
Yeah, that was my first thought, but I still would like to know if there is any way to embed to login into my app just in case the customer has some other security reservation. Like I said initially, I thought that I saw a method for doing this by adding the user name/password to the MachineName parameter in the CreateRemoteComObject function call. Am I remembering incorrectly?
LVL 26

Expert Comment

by:Russell Libby
ID: 19604026

You are remembering incorrectly, as CreateRemoteComObject does not let you do this. The following link will give you info on the COM security calls (which are not trivial to use):


As ziolko indicated, you should be using dcomcnfg to specify the clients that are allowed to connect and launch the OPC server.

LVL 21

Accepted Solution

ziolko earned 375 total points
ID: 19606693
COM/DCOM is based on windows security mechanism so using user credentials is natural, you can of course try to impersonate your app as other user.
Other way, if you know name and pass of user that is allowed to access remote object, you can create small app that will launch DCOM client with CreateProcessAsUser().


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

872 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