<div>Point of interest - something basic&nbsp;for me and possibly others to learn.</div>
<div>&nbsp;</div>
<div>I've only ever used unit&nbsp;'initialization and finalization' &quot;blindly&quot; since Delphi 3 days for Activex / OLE type&nbsp;stuff, as just someting that you have to do - without understanding.</div>
<div>&nbsp;</div>
<div>initialization<br>&nbsp; OleInitialize(nil);<br>&nbsp;</div>
<div>finalization<br>&nbsp; OleUninitialize;</div>
<div>&nbsp;</div>
<div>Otherwise I've used the <strong>onFormComplete</strong> and <strong>onDestroy</strong>&nbsp;to set intial stuff up and then release stuff. </div>
<div>&nbsp;</div>
<div>But I am guessing that <strong>Finailization</strong> is a better place to release stuff (<strong>help avoid memoery leakage under certain circumstances</strong>?), but <strong>Initialization</strong> would have to be used for 
<strong>Finalization</strong> to be acceptable..</div>
<div>&nbsp;</div>
<div>I've read the Delphi 2005 help and googled a bit, but am not yet sure just what sorts of code can be put in the Initialization and Finalization.</div>
<ol>
<li>Can anything declared as a unit <strong>VAR</strong> or <strong>CONST</strong> be dealt with or used in Initialization ? it appears so to me from what&nbsp;I see (below).<br></li>
<li>Could I safely .<strong>create</strong> and .<strong>free</strong> objects respectively?</li></ol>
<div>
<div>I&nbsp;&nbsp;was reading through a <strong>Unit</strong> the other day and saw all sorts of things in <strong>Initialization</strong> &nbsp;there that surprised me.</div></div>
<div>&nbsp;</div>
<div>Can any one please point me to a good reference on this, or in our new learning sharing attitude, explain it for every ones benefit here?</div>
<div>&nbsp;</div>
<div>initialization<br>&nbsp; FillChar(BrowserData,SizeOf(BrowserData),#0);<br>&nbsp; OleInitialize(nil);<br>&nbsp; New(PtrWGUID);<br>&nbsp; New(PtrMGUID);<br>&nbsp; New(PtrDGUID);<br>&nbsp; PtrWGUID^:=CGID_WebBrowser;<br>&nbsp; PtrMGUID^:=CGID_MSHTML;<br>
&nbsp; PtrDGuid:=PGUID(nil);<br>&nbsp; GetBrowserData(BrowserData);<br>&nbsp; IEStr:=IEVerStr;<br>&nbsp; OnMessageCompNo:=0;<br><br>finalization<br>&nbsp; Dispose(PtrWGUID);<br>&nbsp; Dispose(PtrMGUID);<br>&nbsp; Dispose(PtrDGUID);<br>&nbsp; OleUninitialize;<br>
<br>end.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>