Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB6,MTS,COM+
Expertise: Intermediate
Dec 15, 2001

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_MACHINE\SOFTWARE\Classes\AppID\yourclient.exe] @= _
    "YourClient" 
"AppID"="{YourGuid}" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{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).

Enrico Sabbadin
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap