FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OLEUninitialize()
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
OLEUninitialize()
Posted: Wed Dec 07, 2011 11:24 PM

Is the function OLEUninitialize() obsolete (ie. not required anymore)? I found it inside tcomobj.prg and testole.prg.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 11:24 AM
Enrico,

OLEUninitialize() is required when using OLE:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms691326(v=vs.85).aspx

but as we are using Harbour OLE support, Harbour automatically calls it, so we don't need to provide it
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 11:39 AM

So, it must be removed from tcomobj.prg and testole.prg?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 12:45 PM

Enrico,

Yes, I think that we could remove it though lets see if we can check it to be 100% sure about it.

Another choice is to include that function in those examples.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 02:28 PM
Antonio Linares wrote:Enrico,

Yes, I think that we could remove it though lets see if we can check it to be 100% sure about it.


Ok, keep me updated.

Antonio Linares wrote:Another choice is to include that function in those examples.


Ok, but the question is: is it required? If it is not why we need to include it in the samples?

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 05:42 PM
Enrico,

Harbour can implement atomatic "cleaning" when a variable is "destroyed", thats why some calls are no longer needed.

In example:
Code (fw): Select all Collapse
   METHOD Destroy()

   DESTRUCTOR Destroy()


That above means that if an object is made equal to nil, or simply exiting from a function or procedure where it is created, then such method is invoked and there we can do the cleaning. What I am not sure about is if xharbour implements it too. I think so.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OLEUninitialize()
Posted: Thu Dec 08, 2011 08:22 PM
Dear Antonio, suddenly I realize that I didn't say that the following sample doesn't compile because OLEUninitialize() doesn't exist:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    OLEUNINITIALIZE()

    RETURN NIL


EMG

Continue the discussion