FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Have you seen this behavior ?
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Have you seen this behavior ?
Posted: Fri Oct 11, 2013 11:13 PM

This is a problem occurring at one site with a software version built with xHarbour / FWH 13.07. I cannot duplicate the problem on my computer, nor is it reported on any other sites with the same software running.

The problem occurs when the client processes a credit card payment. It works fine, but it is a performed using an object ( CreateObject( ). Once the transaction is completed, the next time the client uses the Codejock appointment system ( also using CreateObject( ) ), an error occurs and Windows shuts down the program. The error is not logging.

I tried the exact same procedure on my computer and it works just as it should.

Has anyone seen similar behavior ? Do you have any ideas about what I can look at to try and resolve this ?

Thanks.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Have you seen this behavior ?
Posted: Sat Oct 12, 2013 01:35 AM
Instead of using CreateObject(...), can you please try using
FWGetOleObject( cApp ) // available in FWH olefuncs.prg

or

TOleAuto():New( cApp )

This is the code of FWGetOleObject( cApp )

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

function FWGetOleObject( cApp )

   local oObj

   TRY
      oObj  := GetActiveObject( cApp )
   CATCH
      TRY
         oObj  := CreateObject( cApp )
      CATCH
      END
   END

return oObj

//----------------------------------------------------------------------------//

You notice the difference when you see the code above
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Have you seen this behavior ?
Posted: Mon Oct 14, 2013 04:39 PM

I made the change and the code works but I will need to test it on my client's site to see if it makes a difference. I have not had a problem here.

I have an additional question. When creating oObj as a LOCAL, when I complete the function, shouldn't I use oObj:close( ) ? If I do, I get an error, but my error system is having problems and doesn't give me the exact error.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Have you seen this behavior ?
Posted: Mon Oct 14, 2013 04:44 PM
shouldn't I use oObj:close( )

Depends on the object. We should know whether that object has Close method or not.
Some objects have close() method and some have end() method.

I suggest you do not use either.
Next time when you need that application, the instance is created from GetActiveObject()
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Have you seen this behavior ?
Posted: Mon Oct 14, 2013 04:55 PM

OK ... thanks.

I was using errorsw_ and it has not been working. It used to, but more recently it does not display the error. It was more useful than errorsys.

Maybe it just doesn't report errors with Ole objects.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion