#DEFINE SomeComServer_Server1 '{FCB56EAB-3CB7-4B35-B992-305092CBFC7D}' #DEFINE SomeComServer_Server2 '{CE3823A8-95F3-4280-B9C4-3B5791D76BAD}' #DEFINE ..... And so onSo in the client we never use the CLSID but the constant representing it:
MyObject = CreateObjectEx(SomeComServer_Server1, ServerName)Further more, The client never use CreateObjectEx Directly, its calling a generic function we have created.
Local loServer GetObjectEx(SomeComServer_Server1,,@loServer) FUNCTION GetObjectEx( cObjectId, cServer, roObject ) *-- Wrapper To CreateObjectEx() *-- cObjectId Is the Server CLSID *-- cServer is the server Ip Or HostName *-- If cServer is ommited, use oEnv.oSettings.Server If This.oSettings.Dev *-- Development Create a local Foxpro object roObject = CreateObject( This.GetFoxName(cObjectId) ) Else IF Type("cServer") = "C" roObject = CreateObjectEx( cObjectId, cServer ) ELSE roObject = CreateObjectEx( cObjectId, This.oSettings.Server ) ENDIF Endif If VarType( roObject ) # 'O' Throw "Error creating the object:" + Transform(cObjectID) EndIf ENDFUNCThere's more in the function, but that gives you an idea. Using it this way you can create native Foxpro object instead of COM without changing a line of code in your client (great for debugging).