OLEUninitialize()

OLEUninitialize()

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: OLEUninitialize()

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OLEUninitialize()

Postby Enrico Maria Giordano » Thu Dec 08, 2011 11:39 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: OLEUninitialize()

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OLEUninitialize()

Postby Enrico Maria Giordano » Thu Dec 08, 2011 2: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: OLEUninitialize()

Postby Antonio Linares » Thu Dec 08, 2011 5:42 pm

Enrico,

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

In example:
Code: Select all  Expand view
  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
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OLEUninitialize()

Postby Enrico Maria Giordano » Thu Dec 08, 2011 8: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: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    OLEUNINITIALIZE()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests