multiple controls into a control–frame

Samj

Member
Hey all!

I'm trying to connect to second (and a third) COM object in an OCX and I really don't know how to go about it. The Progress COM Object Viewer lists all three. My program can access properties and methods assoc. with the main control but when errors are encountered I need to connect to a second control within the OCX to view the error numbers and msgs.

I've checked my registry. All three controls are there.

The COM Viewer shows Progress syntax for the second connection as:
CREATE "USAePayXCharge2.clsError" <com-handle> [ CONNECT [TO <filename> ] ].

I'm not sure if I should use the [CONNECT [TO <filename>]] options or not. And I don't know what the <filename> should be.

The OCX's main control has a property that returns a com-handle if errors exist:
[ Com-Handle-Var = ] <maincom-handle>:Errors.

and I've assigned the value returned from that to a COM-HANDLE data-type variable. But the 'CREATE' statment generates an error msg:

'Class not registered.' with the Progress error number: (5894)

I'm using Progress version 8.3B. The on-line reference for the LoadControls( ) Method states that a furture release will load multiple controls into a control-frame. But I guess this version doesn't?

Could I get some help? TIA

Sam
 

Samj

Member
Interesting development

For those of you that have read this I found something, maybe it'll help you. Maybe not.

The ActiveX object I'm using is for a creditcard validation application. It has three controls contained within it. The main control has dozens of methods and properties for all of the tasks that it performs. The other two controls deal with errors. These kick in when the ComObject:process() method is invoked.

As I wrote earlier, even though all three ActiveX controls loaded separately in my system registry the LoadControls() method in the load_control procedure didn't load them all. I tried dropping the the OCX on the main frame three times and changing the ClsID for each of the new control frames in the UIB generated code section to the actual registry values, but that didn't work. Only the main control loaded each time.

After looking at the control definitions for the Excel.OLB object I came up with an idea. If it was possible to access the Excel.Workbook and Excel.Sheet controls from something like:

CREATE "Excel.Application" chApplication.
and
chWorkbook = chApplication:Workbooks - chSheets = chApplication:Sheets If those worked to access those controls then why not try something similar.

The other two controls for my OCX are:
clsError - with two properties, ErrorCode and ErrorText
and
clsErrors - with six methods Add(), ClearAll(), Count(), Delete(), Exists() & item().

So I assigned the a second Com-Handle variable the value: ch2 = ComObect:Errors. This is a property of the main control described as: A collection of error objects containing error numbers (.ErrorCode) and error descriptions (.ErrorText) and I tried messaging ch2:Count() and actually got a number and not a Progress error.

Then I though it was interesting that the first letter of the clsErrors control method 'item()' wasn't capitalized. So I defined another Com-Handle variable and assigned it: ch3 = ch2:item(ndx) where ndx was an integer variable that I could loop through 1 to ch2:Count() times and message ch3:ErrorCode and ch3:ErrorText. And I got error codes and descriptions!

Lucky stumble I guess.
 
Top