Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OleInitialization in Delphi

Are there any downsides to adding OleInitialization calls to the main form of a project? eg:

initialization
  OleInitialize(nil);
finalization
  oleuninitialize;

(added to the main form of the application) appears to be a necessary addition to allow copying selected text from a TWebBrowser (on another form) to the clipboard. But I'm wondering if there are any unexpected consequences I might face in my program based on whether or not I add those lines? MSDN's description of OleInitialize indicates there are effects on the threading/concurrency model, but I don't totally understand the significance of those differences.

like image 730
Jessica Brown Avatar asked Aug 07 '26 09:08

Jessica Brown


1 Answers

Here's an article from Embarcadero that confirms that you do need to call OleInitialize: http://edn.embarcadero.com/article/20468

There's no problem calling it the way you do. That is how it is meant to be done.

like image 80
David Heffernan Avatar answered Aug 10 '26 07:08

David Heffernan