Have you seen this behavior ?

Have you seen this behavior ?

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Have you seen this behavior ?

Postby nageswaragunupudi » Sat Oct 12, 2013 1: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: Select all  Expand view
//----------------------------------------------------------------------------//

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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Have you seen this behavior ?

Postby TimStone » Mon Oct 14, 2013 4: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Have you seen this behavior ?

Postby nageswaragunupudi » Mon Oct 14, 2013 4: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Have you seen this behavior ?

Postby TimStone » Mon Oct 14, 2013 4: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests