Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: To avoid to re-register COM object on the server

$
0
0
Re: To avoid to re-register COM object on the server
Web Connection 5.0
Re: To avoid to re-register COM object on the server
04/25/2012
04:06:12 PM
3HK0YIMFS Show this entire thread in new window
Gratar Image based on email address
From:
Rick Strahl
To:
Attachments:
None

If you don't change any properties on the actual wwServer instance (ie. yourAppServer class derived from wwServer) and add any properties to the oResources object or dynamically to yourAppServer direct (using AddProperty) then there should be no re-registration required.

Options are (where THIS is your wwServer instance):

* this.oResources.AddProperty("NewProperty","value") && this.oResources.NewProperty
* AddProperty(oResources,"NewProperty",value) && this.oResources.NewProperty
* this.oResources.Add("Key","Value") && this.oResources.Item("Key")
* AddProperty(THIS,"NewProperty","value") && this.NewProperty

If you use any of these your COM server does not change and no re-registration should be necessary.

+++ Rick ---



Dear Rick,
in your last "Global Values in Web Connection" web log you said:

"Using wwServer instance properties works and reasonably clean, but if you are running in COM mode, anytime you add a property to your class the ClassIds change for your COM server. This means you have to re-register your COM object on the server, which is a bit of a pain."

So I updated Web Connection to 5.62 version, then moved custom properties in oResources object:

DEFINE CLASS MyAppServer AS WWC_SERVER OLEPUBLIC ... PROTECTED FUNCTION OnLoad ... WITH this.oResources .AddProperty("cProperty1") .AddProperty("cProperty2") .AddProperty("cProperty3") .AddProperty("cProperty4") ENDWITH ENDFUNC * OnLoad

So if I add some new property, do I modify the MyAppServer class in MyAppMain.prg file and do I have to re-register my COM object on the server? Is this setting correct?

Also, at the end of same MyAppMain.prg file I initialize settings which must be read from INI file:

DEFINE CLASS BackofficeProcessConfig as wwConfig cHTMLPagePath = "c:\inetpub\wwwroot\Backoffice\" cDATAPath = "" cVirtualPath = "/Backoffice/" cSetting1="" cSetting2="" cSetting3="" ENDDEFINE

So if I add some new setting in INI file, do I modify the MyAppServer class in MyAppMain.prg file and do I have to re-register my COM object on the server? Is this setting correct?
Thank you very much




Rick Strahl
West Wind Technologies

Making waves on the Web

from Maui, Hawaii


Viewing all articles
Browse latest Browse all 10393

Trending Articles