Highlighted
Absent Member.
Absent Member.
1103 views

[archive] Com Object .def File

[Migrated content. Thread originally posted on 25 July 2006]

Hi All - Attached is a .def file created by the AXDEFGEN utility for a COM object .dll that I'm trying to utiliize in a cobol program. Can anyone tell me if this .def file is usuable and possibly were to begin coding. I added it to the SPECIAL-NAMES section, used create and modify statements to try to invoke the PromptCreditCardEntry function found in the object. After several days of trial and error, I finally called tech support and they were not able to tell me if the .def file is usable or not.
ANY clues will be GREATLY appreciated!
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Com Object .def File

Generally speaking; It is not a good idea to manipulate the .def file. Yes, as long as it is syntaxically correct, the compiler should take it. Nevertheless, manipulating it, is a source of error.

In this case I think the problem is not due to the formatting though, but using incorrect method to invoke it.

You refer to this as a COM object, thus I assume you have used the CREATE verb. When I read the file it appears to be an ActiveX control. A distinction between the two is that the latter must be made with a DISPLAY statement, whereas COM is made with the CREATE verb.

Also, apparently this is a windowless control, which means that it might seem rational to avoid a ACCEPT statement, note however that without an ACCEPT statement, the runtime will not process events from the control. Hence, you should have an ACCEPT statement going idle to process messages.

Now, when I read the def file further, I realise there are no events there. Quite an odd thing really. I would sort of expect an event to get back the validation status of the card.

Anyways, this should get you going.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Com Object .def File

Thank you for your response. To further clarify my dilemma, I am not trying to manipulate the .def file, I was asking if it 'looked' usuable. It was generated by the AXDEFGEN utility and it does not look like other .def files I've reviewed.

You are certainly correct in thinking that my method of invocation is the issue. I am totally clueless about ActiveX and Com Object programming. I am told by the vendor (and their documentation) that it is indeed a Com Object. The function that I am trying to invoke is the PromptCreditCardEntry. This function is supposed to display an entry window that allows the user to enter credit card information and then connect to the CC processing server for approval. It returns a true value if the transaction was approved.

The documentation for the function prototype is as follows:

VARIANT_BOOL PromptCreditCardEntry(long hHandle, BSTR Caption,[INDENT]VARIANT_BOOL RequireZIPIfKeyed, VARIANT_BOOL RequireAddressIfKeyed, VARIANT_BOOL RequireCVVIfKeyed, BSTR* RawSwipe, BSTR* Track1, BSTR* Track2, BSTR* CC, BSTR* CCTypeName, BSTR* ExpirationMonth, BSTR* ExpirationYear, BSTR* Name, BSTR* ZIP, BSTR* Address, BSTR* CVV)[/INDENT]

I have tried using create, display, modify, accept, etc in various syntax fashions and still not able to get it to work. The vendor provided working VB, Delphi, and C+ sample programs. These run correctly on my PC, indicating that I have installed and registered the .dll properly. The .dll is presented in the selection box for AXDEFGEN and the previously zipped XCHARGE.def file is the result.

Any further assistance you can provide will be greatly appreciated.:confused:
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Com Object .def File

create @XChargeTransaction handle in xcharge-handle

modify xcharge-handle Property 20 = (Screen1-Handle, "TEST", '0', '0', '0')

When the MODIFY statement is executed (XCHARGE.def attached to original message), I receive an exception errror "member not found".

If I use the actual function name PromptCreditCardEntry, the compiler complains that it is an undefined data item. Using the method number - 20 - compiles but produces the exception.

Any help out there? Still very....:confused:
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Com Object .def File

I am sorry about statement about the .def file, yes indeed it looks different so I presumed you had formatted it to your standards. I can understand that, does such things myself.

As far as your implementation, I can tell for sure that you have to stop using the CREATE verb as I said in my first response. You should use DISPLAY, and only DISPLAY. Like:


*You can remove the LINE, COL, SIZE and LINES later, now is for show.
DISPLAY XChargeTransaction LINE 1 COL 1 SIZE 10 LINES 10
            handle in xcharge-handle


Then the rest should be straight forward.

If you still don't get it to work, you will have to contact your account manager at Acucorp, Inc and ask for PSO. Implementing 3rd party controls requires studying documentation and access to the control, using resources beyond the mandate of this forum and tech support.

I can understand your vendor states it is a COM object, it really is a philosophical discussion. Strictly technical speaking there is no such thing as ActiveX, it is a marketing tag. But it is so commonly used that it has become an accepted term. Nevertheless, there is a technical distinction between "ActiveX" and COM, according to this .def file, this is a "ActiveX", at least for ACUCOBOL-GT.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.