Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Unkown name error under COM+
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00787371
Message ID:
00788141
Vues:
27
Tony,

We have a build server, all our dll's must be build from that server, also all our projects are in source safe and can only be modified on the build server. This means that if a developer want to build from their machine for testing they get the latest version of the projects and other files and build. The CLSID are in the projects and do not change if you build on a different machine.

We also have a project hook on all our dll projects which update a .h file used by the clients. This .h file looks like this:
#DEFINE SomeComServer_Server1 '{FCB56EAB-3CB7-4B35-B992-305092CBFC7D}'
#DEFINE SomeComServer_Server2 '{CE3823A8-95F3-4280-B9C4-3B5791D76BAD}'
#DEFINE ..... And so on
So 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
		
ENDFUNC
There'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).

>
>By the way, in previous email, you mention you create an object by using createobjectex. How do you manage your clsid? did you wrote all the components yourself; do you have a machine for compile your code? The reason I am asking is that I am thinking of changing from createobject to createobjectex but since a couple of our programmer can compile these components which mean different clsid. So, do you load a refresh list of clsid from the server every your program start or do you better approach?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform