devxlogo

Avoiding Access Denied erros when raising events from MTS objects

Avoiding Access Denied erros when raising events from MTS objects

If you don’t take specific actions, you get an Access Denied Error when you try to raise an event from an MTS component into a client. This happens because the client executable doesn’t have the proper DCOM security settings to let the server call it back. In order to have it working you have two solutions:

1) Open wide DCOM security settings on the client side
2) Add the proper DCOM security settings for the client executable in the registry (you cannot call CoInitializeSecurity in a VB client).

Or

a) Add a new key with the name of the client executable under the AppId key
b) Generate a GUID with guidgen.exe
c) Add a key with such value under the AppId key
d) Add a string value under the key created in step a whose name is AppID and the value is the generated GUID vaue
e) Add the proper security settings under the GUID key.

Here is an example:

REGEDIT4] [HKEY_LOCAL_MACHINESOFTWAREClassesAppIDyourclient.exe] @= _    "YourClient" "AppID"="{YourGuid}" [HKEY_LOCAL_MACHINESOFTWAREClassesAppID{YourGuid}] @= _    "YourClient" "AuthenticationLevel"=dword:00000001

See http://msdn.microsoft.com/library/psdk/com/reg_33y1.htm for further info.

This tip is taken from the FAQ list that Enrico mantains at his own home page (www.sabbasoft.com/mts_faq.htm).

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist