FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help translating C++ to FWH
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: 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:

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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: 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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 06: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 06: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 11:02 AM
Try this:

oEPSTIPNet = CreateObject("EPSTIPNet")
? oEPSTIPNet:PAYMENTMODE_PayNow
? oEPSTIPNet:CHARGEMODE_Sale


EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 07: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 07:48 PM
I ran it using a TRY/CATCH to test from 0 to 100000 and it errored out for all values.

James

   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)))
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 07:52 PM
James Bott wrote:Enrico,

It errors out on the first line.


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

EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 07:58 PM

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 08: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?

 oCharge:Put_PM( oEPSTIPNet:Paymentmode_PayNow )


James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 08: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Help translating C++ to FWH
Posted: Sat Nov 08, 2008 08:39 PM
James Bott wrote:Are you thinking that there are two classes, the EPSTIPNet class


No. The string

"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