Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM Automation on a Remote User
Message
 
To
08/09/2011 03:03:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01522969
Message ID:
01522975
Views:
56
Jos,

Remoting is possible, but...

It works IF there's a direct network connection between the two machines and if security is configured properly. In Vista/Windows 7 remote access to DCOM components (like Office) is not allowed by default so you will have to set the machine level DCOM permissions to even allow access. Whether the server machine then finds your client is yet another story :-) Most likely you have to do this by IP address and it's very likely somewhere along the way a firewall (either outgoing from the TS machine or inbound for your client machine) will not allow the DCOM request through.

DCOM is pretty finicky and getting connections to work is very tricky. If you work with known machines in a known environment then this can be overcome. But when you're dealing with external logons then things get a lot more tricky as each machine will have a different config.

Further you need to figure out what machine you're actually connecting to - SYS(0) will not give you the right machine - that's the server. You need that information - IP address most likely - from the local machine which is not easily available (there might be an API call in the TS API for that though) and then the server needs to be able to tunnel back to that IP address and have access using hte various DCOM ports.

DCOM is possible but it usually is a lot more difficult than it should be in my experience.

Good luck,

+++ Rick ---

>Hi All,
>
>We have an application running on a server to which we allow users remote access via terminal services / remote desktop. Our application has a facility where it automate Excel to create and populate a spreadsheet with data. This is done via
>
>
>  TOBJ_XLS = CREATEOBJECT( "Excel.Application" )
>
>
>However, under terminal services / remote desktop this would instantiate Excel on the server and we obviously don't want that. We want the Excel to be instantiated on the client machine. Under VFP help I find this command:
>
>
>  CREATEOBJECTEX(cCLSID | cPROGID, cComputerName [, cIID])
>
>
>and, if I understand this correctly, it appears that this command can be used to instantiate an object reference to Excel on the user's machine. Is that right? If so, how do I determine the value of the parameters required? Does SYS(0) help me? Any advice very welcome.
>
>TIA
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform