Help translating C++ to FWH

Postby James Bott » Sat Nov 08, 2008 12:20 am

Antonio,

>Make a search for them everywhere in the code and header files. They have to be there, somewhere.

The only code samples I have are snippets in a documentation file. There are no header files included with the SDK--or at least, I didn't get any.

>They seem related to that specific COM object, not with .NET

Yes there are dozens of them, and they are all specific to the credit card processing application.

I am currently Googling "enum values" to see if there is some way to read the values from the COM object or the registry.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Nov 08, 2008 12:28 am

Antonio Linares wrote:Make a search for them everywhere in the code and header files. They have to be there, somewhere.

They seem related to that specific COM object, not with .NET


Yes, of course. But we need to see a complete sample. This is not complete because there's no declaration for EPSTIPNet class:

Code: Select all  Expand view
EPSTIPNet::_ChargeNowPtr ptr("EPSTIPNet.gutil.Forms.ChargeNow");
   ptr->init();
   ptr->put_PM(EPSTIPNet::PAYMENTMODE_PayNow);
   ptr->put_CM(EPSTIPNet::CHARGEMODE_Sale);
   ptr->Show();


Or if it is complete then what I said could be true: the platform provides, after the registration of the class module, the implicit declared class. We can see something similar in VB and its "references": there's no need of CreateObject as objects like Excel are predefined and types like ADO.Recordset are predeclared.

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

Postby Enrico Maria Giordano » Sat Nov 08, 2008 12:31 am

And I add: the values for PAYMENTMODE_PayNow and CHARGEMODE_Sale may not be visibles at all, just like we can't drive Word via OLE without reading its documentation.

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

Postby Enrico Maria Giordano » Sat Nov 08, 2008 12:33 am

James Bott wrote:I am currently Googling "enum values" to see if there is some way to read the values from the COM object or the registry.


I'm afraid not. A COM object is a compiled module. Do you have the source code?

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

Postby James Bott » Sat Nov 08, 2008 12:42 am

Enrico,

>I'm afraid not. A COM object is a compiled module.

I have seen a number of references on how to create a list of the enum values and their string counterparts for use in creating a drop-down list. All the code has been in either C++ or C# so I can't understand it or compile it. Perhaps this can only be used if you have the source for the app.

>Do you have the source code?

No, I have no source code. I just got an install program to install the SDK.

I have a contact at the company, but he doesn't seem to be a programmer. If I was to ask for what I need, what exactly should I ask for--a header file, a table of enum values and their names, or?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sat Nov 08, 2008 6:09 am

Antonio,

>Make a search for them everywhere in the code and header files. They have to be there, somewhere.

There is no code except for what I have written. There are no header files either.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Sat Nov 08, 2008 6:22 am

James,

In case they are enumerations, try with values: 0, 1, 2, etc...

If that not work, then I would suggest to use 2 ^ n, where n is 0, 1, 2, etc...

Shooting in the dark :-)

Can't you contact the manufacturer ?

Also, open the COM object as a binary file and search for those strings inside it. You can use your source code editor for it, probably. UEStudio does it fine.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sat Nov 08, 2008 11:02 am

Try this:

Code: Select all  Expand view
oEPSTIPNet = CreateObject("EPSTIPNet")
? oEPSTIPNet:PAYMENTMODE_PayNow
? oEPSTIPNet:CHARGEMODE_Sale


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

Postby James Bott » Sat Nov 08, 2008 7:05 pm

Enrico,

It errors out on the first line. If I change it to:

oEPSTIPNet := CreateObject("EPSTIPNet.gutil.Forms.ChargeNow")
oEPSTIPNet:init()
? oEPSTIPNet:PAYMENTMODE_PayNow
? oEPSTIPNet:CHARGEMODE_Sale

I get this error:

Error description: Error EPSTIPNet.gutil.Forms.ChargeNow/0 S_OK: PAYMENTMODE_PAYNOW
Args:

There is nothing shown on the Args: line.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sat Nov 08, 2008 7:48 pm

I ran it using a TRY/CATCH to test from 0 to 100000 and it errored out for all values.

James

Code: Select all  Expand view
   do while ! lSuccess .and. i != 100000
   i++
   try
      oCharge:put_PM( i )
      lSuccess:=.t.
      msgbeep()
   catch
      lSuccess:=.f.
   end try
   enddo

   writeFile("test.log", alltrim(str(i)))
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Nov 08, 2008 7:52 pm

James Bott wrote:Enrico,

It errors out on the first line.


You have to found the way to instantiate EPSTIPNet class...

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

Postby James Bott » Sat Nov 08, 2008 7:58 pm

I ran it up to 1 million and all values errored out. I am guessing the expected values are not numeric.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sat Nov 08, 2008 8:07 pm

Enrico,

>You have to found the way to instantiate EPSTIPNet class...

Are you thinking that there are two classes, the EPSTIPNet class and the ChargeNow class and that the ChargeNow:Put_PM( ) has to be initialized by the oEPSTIPNet:Paymentmode_PayNow value?

Code: Select all  Expand view
oCharge:Put_PM( oEPSTIPNet:Paymentmode_PayNow )


James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Nov 08, 2008 8:36 pm

James Bott wrote:I ran it up to 1 million and all values errored out. I am guessing the expected values are not numeric.

James


Yes, it maybe.

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

Postby Enrico Maria Giordano » Sat Nov 08, 2008 8:39 pm

James Bott wrote:Are you thinking that there are two classes, the EPSTIPNet class


No. The string

Code: Select all  Expand view
"EPSTIPNet.gutil.Forms.ChargeNow"


seems to mean that ChargeNow object is a property of Forms object that is a property of gutil object that, in turn, is a property of EPSTIPNet object.

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests