Consultor Eletrônico



Kbase P132342: 4GL/ABL: Automation Object method that work in Visual Basic fails in 4GL.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/13/2009
Status: Unverified

SYMPTOM(s):

4GL/ABL: Automation Object method that work in Visual Basic fails in 4GL.

Some DivaSDK.DivaSystem objects are successfully created using the CREATE statement but fail to have a VALID-HANDLE when derived from a parent COM object using a method.

This code fails to create a DivaSDK.DivaDevice COM object using the GetDevice() method. The parent COM object here is the DivaSDK.DivaSystem and the called method is its GetDevice() method. The VALID-HANDLE() function returns FALSE:

DEFINE VARIABLE chDivaSystem AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chDevice AS COM-HANDLE NO-UNDO.
CREATE "DivaSDK.DivaSystem" chDivaSystem.
chDevice = chDivaSystem:GetDevice(1) NO-ERROR.
MESSAGE VALID-HANDLE(chDevice)
VIEW-AS ALERT-BOX INFO BUTTONS OK.

This code fails to create a DivaSDK.DivaInstance COM object when invoking a parent's method. The parent COM object here is the DivaSDK.DivaSystem and the called method is its CreateInstance() method. The VALID-HANDLE() function returns FALSE:
DEFINE VARIABLE chDivaSystem AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chInstance AS COM-HANDLE NO-UNDO.
CREATE "DivaSDK.DivaSystem" chDivaSystem.
chInstance = chDivaSystem:CreateInstance(1,1,4,2048) NO-ERROR.
MESSAGE VALID-HANDLE(chInstance)
VIEW-AS ALERT-BOX INFO BUTTONS OK.

FACT(s) (Environment):

This code succeeds in creating the DivaSDK.DivaDevice COM object using the CREATE statement. The VALID-HANDLE() function returns TRUE as expected:
DEFINE VARIABLE chDevice AS COM-HANDLE NO-UNDO.
CREATE "DivaSDK.DivaDevice" chDevice NO-ERROR.
MESSAGE VALID-HANDLE(chDevice)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
This Visual Basic Studio code succeeds in creating a DivaSDK.DivaDevice COM object using the GetDevice() method:
Set DivaSys = CreateObject("DivaSDK.DivaSystem")
set Dev = DivaSys.GetDevice(1)
nChannels = Dev.Channels
wscript.echo nChannels
This code succeeds in creating the DivaSDK.DivaInstance COM object using the CREATE statement. The VALID-HANDLE() function returns TRUE as expected:
DEFINE VARIABLE chInstance AS COM-HANDLE NO-UNDO.
CREATE "DivaSDK.DivaInstance" chInstance NO-ERROR.
MESSAGE VALID-HANDLE(chInstance)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
This VB Script code succeeds in creating the DivaSDK.DivaInstance COM object using the CreateInstance() method:
Set DivaSys = CreateObject("DivaSDK.DivaSystem")
set Dev = DivaSys.CreateInstance(1,1,4,2024)
Dev.LocalNumber = "6046837669"
wscript.echo Dev.LocalNumber
Windows
OpenEdge 10.1x
Windows

CAUSE:

Bug# OE00170079

FIX:

Upgrade to OpenEdge 10.1C03 or later