Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with CreateObjectEx and Win Server 2003
Message
 
 
To
09/12/2005 17:57:38
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01076737
Message ID:
01126204
Views:
20
>I have seen the access denied error using VFP MTDLLs in COM+ on Server 2003. Here are steps to get things working in that environment. I haven't seen the event log event ID you describe, though.
>
>I had to add roles to the component to avoid the "access is denied" error. Steps 8, and 14 - 16 describe the role configuration. Also, CREATEOBJECTEX() syntax is described in step 18 so no local registration is necessary on the clients.
>
>These should form comprehensive instructions:
>
>1. Take the MTDLL to the server machine and drop into the folder you wish to host it in. The runtimes need to be installed on the server as well.
>
>2. On Windows Server 2003, click the Start button, and then Run. Type DCOMCNFG in the Run dialog box, and then click OK.
>
>3. Expand Component Services, then Computers, then My Computer.
>
>4. Right-click on COM+ Applications and select New, then Application, from the context menu.
>
>5. In the COM+ Application Wizard, click Next.
>
>6. Click the "Create an empty application" button. Enter a name, leaving the radio button on "Server application", then click Next twice, to go through the Set Application Identity page.
>
>7. On the Add Application Roles tab, click Add Role. Enter AppUsers as the name of the role, then click OK. Click Next.
>
>8. On the Add Users to Roles page, you will see the two Roles, CreatorOwner and AppUsers. Each of these will include the account you are logged in under when you create the application, as this is added by default. Expand AppUsers, and select Users. Click the Add button, and add any other local or domain users or local or domain groups you wish to allow access the application. When done, click Next.
>
>9. Click Finish to close the wizard.
>
>10. Expand COM+ Applications, and find the new application you just created.
>
>11. Expand the newly added application. Right-click on Components, and select New, then Component from the context menu.
>
>12. Click Next in the COM+ Component Install Wizard.
>
>13. Click "Install New Component(s)" on the dialog, and navigate to your MTDLL. Click Next, then Finish.
>
>14. To avoid an "Access is denied" error when calling remotely, you need to add your roles to the component. Rightclick on the newly added component. Select Properties. Click the Security tab.
>
>15. Check the "Enforce component level access checks" checkbox.
>
>16. Check the checkboxes next to AppUsers and CreatorOwner in the Name list. Click Apply.
>
>17. Get the CLSID of the component. Click the General tab of the component Properties dialog in the Component. The CLSID is listed, and you can highlight the text with the mouse, and copy it.
>
>Network COM+ must be enabled on the server. For info on how to do this in Windows Server 2003, see: 817065 How to enable network COM+ access in Windows Server 2003
>http://support.microsoft.com/default.aspx?scid=kb;EN-US;817065
>
>
>18. To call from a remote machine use code as below
>
>
>MyObj = CreateObjectEX("{CLSID}","<servername>")
>
>
>where CLSID is the CLSID, including the bracketting {} characters, from step 17 above.
>
>Example:
>
>
>xx = CreateObjectEx('{A2EAAE4F-4B00-4107-8E9F-214C38E4CE4D}','chinadoll')
>
Jim,

Thanks for the thorough instructions. I'm going to try it out. Also as I understood I should use CLSID instead of ProgID.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform