LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

activex error: access is denied

I created basic ActiveX server and client programs. They seem to work fine while running on the same machine. However, if the client tries to connect to a machine across our network, I receive the error: "Access is denied." Could this be a permissions problem or a DCOM configuration problem? I have tried Windows 2000 to XP, XP to 2000, and XP to XP, all with the same result.
0 Kudos
Message 1 of 10
(6,247 Views)
Hi,

This is most likely a permissions problem. When you attempt to access the ActiveX server on another machine, you need to have access to the server, which is usually achieved by being the administrator on the remote machine. I would try accessing the remote system to see if you have full permissions to roam all over the machine (log in remotely as admin), and then try running your client once you have established that you can access the remote system without having to log into it.

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 10
(6,247 Views)
Hi,

I don�t have much experience with remote ActiveX, however I sure that you have to configure your remote machine to accept the DCOM connection.

I found some instructions on how to enable LabVIEW remote launching; I think that the same procedure could be used for your server.

1. Run the DCOM Configuration Utility (DCOMCNFG.EXE) from the command line or from Start >> Run . This should bring up the Component Services DCOM configuration window.

2. Open the folder in the following path: Component Services >> Computers >> My Computer >> DCOM Config

3. Right-click on [Your Application] and select Properties.

There you can specify the security configuration and enable access for your remote clients.

Please give this a try and let me know how this
goes.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 10
(6,247 Views)
I toyed around with this with no success. Are there any details on the security configuration that might help me set this up properly?
0 Kudos
Message 4 of 10
(6,247 Views)
Hi,

I was able to get it working here on a test machine, using the example SimpleEXE activeX programs that come shipped with CVI. What I did was create a release executable of the server on my test machine, and then went into DCOM settings and modified the permissions. I have attached screenshots of the permissions I changed so you can see them. After that, I went to my main computer and modified the client to point to the test machine, and then ran it. Everything worked! The settings I changed in the DCOM configuration (the file I accessed for this example is 'Object that performs simple scalar, string and vector calculations', not 'CVI Application'. Those are 2 different applications. First, change the Security Permissio
ns for Launch and Access to add 'Everybody'. Then, go to Identity and select 'The interactive user'. Beyond that configuration, I just made sure that I could ping the computer, and also had file access into it. Hope this helps!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 5 of 10
(6,247 Views)
Ok, I am starting to understand my problem, but I am not sure how to fix it. I just tried the SimpleEXE program, and was able to access it across the network. However, when I compile my own program, there is no entry in the DCOM settings for it! I was previously setting the permissions for 'CVI Application', which appears to be wrong. In my ActiveX server settings, what do i set so it appears in DCOM Config?
0 Kudos
Message 6 of 10
(6,247 Views)
It seems the Object GUID set in the activex server settings is also the application name displayed in DCOM config. How do I change this name without changing the GUID?

I set the permissions as explained to me above, and I am able to launch the server remotely, but I still receive the same error which keeps my client from running (even though the server is running on the remote machine).
0 Kudos
Message 7 of 10
(6,247 Views)
CVI's server creation was not designed to be used with DCOM, which is why when you created the server using CVI, the name never shows up under the DCOM configuration window. Unfortunately, this is something we do not support.

Having said this, I have found a way (from the internet) you can get the activex servers to show up in the dcom configuration utility, but this requires making some registry edits. The reason is CVI built servers and objects do not register AppIDs. And this is something DCOM needs. We can add this manually to the registry, but if anything goes terribly wrong, you may corrupt your activex server settings and be in a bad situation. So, be cautious if you choose to do the following:

Remember that AppID's are object based and not server based. So you would need to setup an AppID per object you have, assuming the server is registered.

First get the CLSID of the object, from CVI >> Tools menu >> Edit ActiveX Server >> Edit Objects >> Edit >> Advanced Options >> GUID (CLSID)).

1) Open the HKCR/CLSID/{clsid of object} for the object
2) Add a String value at the top level in this node with the name: "AppID" and for the value use a new GUID.

You can use guigen.exe to generate a guid for you. You can find this tool under ..\CVI\sdk\bin. Launch the tool, choose GUID format 4, and copy the guid. Include the braces as well.

3) Go to HKCR/AppID and create a new Key under this with the same name as the new GUID key.

4) In this new Key, modify the (Default) String value with a descriptive name for the AppID. This is the name that will show up in the dcom configuration tool

5) Now reload dcomcnfg or oleview to see the new AppID (look for the descriptive name you added).

To refresh the registry, open up the task manager, end all the processes for "explorer.exe", and then start it again by going to the task manager >> File >> New Task ( Run.) option. Type explorer to launch the explorer process. You should be able to configure the server to be used remotely.

Again to emphasize, modifying your registry settings may or may not corrupt your activeX server settings, and so I would test this on another machine. I think this would work for you, but just be VERY careful. Again, NI does not support this, and so if you run into trouble, there is limited help.

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 8 of 10
(6,247 Views)
On that note, the SimpleEXE example runs fine, but the SimpleEvents example generates the same "Access is denied" error that I am seeing with my own code. Does the root problem reside in the fact that CVI server creation is not desinged to be used with DCOM?
0 Kudos
Message 9 of 10
(6,247 Views)
Yes. However, I was able to get the SimpleEvents example to work by searching through the registered DCOM applications under Component Services. I found it as a CLSID, and it did not have an application name. The way I found it was by manually checking the file path properties of each DCOM application until I found the one that pointed to SimpleEvents.exe. Once I found this, I set my access permissions, and then I was able to access it remotely. However, keep in mind for this example it may complain about having an ActiveX class not being registered, so you might have to do a few other steps to register it.

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 10 of 10
(6,247 Views)