[Migrated content. Thread originally posted on 15 January 2008]
I am having problems calling a method in a COM object and need some help.Below is the DEF file that was created from the DLL when I used AXDEFGEN.EXE.
>>IMP(ACU-CBLFLAGS=-Sa)
* C:\\Jim's activeX test\\xcharge.def - OLE object definitions
* Generated: Monday, January 07, 2008
* Typelib..: C:\\XCharge\\X-Charge Tech
OBJECT @eXpressLink
* Dispatch interface for XCeXpressLink Object
* IXCeXpressLink
CLASS @IXCeXpressLink
CLSID, 06277D48-1071-4380-8A0A-8D5A304B10FE
NAME, "IXCeXpressLink"
* IsXCClientRunning
METHOD, 1, @IsXCClientRunning,
"boolean*" @Future, TYPE 16395
OPTIONAL 1
RETURNING "long", TYPE 3
* ExecuteXCClient
METHOD, 2, @ExecuteXCClient,
"BSTR" @Parameters, TYPE 8,
"boolean" @Wait, TYPE 11
RETURNING "long", TYPE 3
* ActivateXCClient
METHOD, 3, @ActivateXCClient,
"boolean" @Future, TYPE 11
OPTIONAL 1
RETURNING "long", TYPE 3
* XCeXpressLink Object
*** Primary Interface ***
* XCeXpressLink
CLASS @XCeXpressLink
CLSID, 93A21EF1-A8F0-4C1B-82C9-A7A1BF180DED
NAME, "XCeXpressLink"
PRIMARY-INTERFACE
DEFAULT-INTERFACE, "IXCeXpressLink"
* IsXCClientRunning
METHOD, 1, @IsXCClientRunning,
"boolean*" @Future, TYPE 16395
OPTIONAL 1
RETURNING "long", TYPE 3
* ExecuteXCClient
METHOD, 2, @ExecuteXCClient,
"BSTR" @Parameters, TYPE 8,
"boolean" @Wait, TYPE 11
RETURNING "long", TYPE 3
* ActivateXCClient
METHOD, 3, @ActivateXCClient,
"boolean" @Future, TYPE 11
OPTIONAL 1
RETURNING "long", TYPE 3
I am trying to execute the IsXCClientRunning method but I get the following compile error.
program.cbl, line 68: Warning: '.' expected, INPUT-OUTPUT found
program.cbl, line 2405: Undefined data item: ISXCCLIENTRUNNING
Here is some code sniplets that I have in my program.
This is were I have added my DEF copybook as per some of the examples and
I am getting the first warning on this code. Does the DEF need to be in the
SPECIAL-NAMES heading?
CONFIGURATION SECTION.
SOURCE-COMPUTER. RealWorld.
OBJECT-COMPUTER. RealWorld.
SPECIAL-NAMES.
COPY "XCHARGE.DEF".
INPUT-OUTPUT SECTION.
This is defining the return code and the Handle.
01 EXPRESSLINK-STATUS PIC X(4) COMP-N.
88 EXPRESSLINK-IS-FALSE VALUE 0.
01 XCHARGE-HANDLE USAGE IS HANDLE.
This is where I am creating the Class and trying to use a method in the Class and this is where I am getting the other compile error.
CREATE IXCeXpressLink HANDLE IS XCHARGE-HANDLE.
INQUIRE XCHARGE-HANDLE IsXCClientRunning
IN EXPRESSLINK-STATUS.
DESTROY XCHARGE-HANDLE.
Please forgive my ignorance of the correct terminology but this is the first time I have tried to call a VB object.
Thanks and please let me know if there is any other information that you need.
Jim



