Página 1 de 1

CreateObject and events

Publicado: Mar Oct 08, 2013 11:14 am
por Timm
Hi!
I want to use this code:
local cut1d := CreateObject( "optimal1dx.Optimization1DX" )
cut1d:BladeWidth := 12
for i := 1 to 12
cut1d:SetDemandPiece( i-1, i * 21, 90, 90, i-1 )
next
for i := 1 to 2
cut1d:SetRepositoryPiece( i-1, i * 110, i-1 )
next
cut1d:OnFinish := {|| MsgInfo( cut1d:TotalWaste ) }
cut1d:Start()
Everything works fine except that the OnFinish event is not fired.
I get this error message:
Xailer-Version: Xailer 3.1.0
Compiler: Harbour 3.2.0dev (Rev. 18854)
C/C++-Compiler: MinGW GNU C 4.7.1 (32-bit)
Windows-Plattform: Windows 7 6.1.7601 Service Pack 1
Untersystemaufruf: WINOLE
Systemcode: 1008
Default-Status: .F.
Beschreibung: No exported variable
Operation: ONFINISH
Argumente: [ 1] = Typ: B Wert: {|| ... }
Involvierte Dateien:
DOS-Fehlercode: -2147352570
Aufgerufene Programmteile:
WIN_OLEAUTO:_ONFINISH (0)
TFORM1:LOADOPTIDLL (381)
Any idea?
Many thanks is advance!
Best regards, Timm.

CreateObject and events

Publicado: Mié Oct 09, 2013 9:30 am
por jfgimenez
Timm,
> I want to use this code:
>
> local cut1d := CreateObject( "optimal1dx.Optimization1DX" )
>
> cut1d:BladeWidth := 12
>
> for i := 1 to 12
> cut1d:SetDemandPiece( i-1, i * 21, 90, 90, i-1 )
> next
> for i := 1 to 2
> cut1d:SetRepositoryPiece( i-1, i * 110, i-1 )
> next
>
> cut1d:OnFinish := {|| MsgInfo( cut1d:TotalWaste ) }
>
> cut1d:Start()
>
> Everything works fine except that the OnFinish event is not fired.
I'm affraid that events are not supported for OLE automation servers.
Events are only available for OCX (OLE controls)
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

CreateObject and events

Publicado: Mié Oct 09, 2013 9:58 am
por Timm
Hi Jose,
is this a Xailer/Harbour issue?
Do you plan to add the support of events?
Best regards, Timm.

CreateObject and events

Publicado: Mié Oct 09, 2013 10:13 am
por jfgimenez
Ingo,
> is this a Xailer/Harbour issue?
Harbour provides OLE support, but doesn't support events. ITOH, Xailer
provides OCX support, which does support events, since it's a requisite
for OCX.
IMO, the problem is that original OLE automation servers didn't support
events. It was an enhancement by MS when they develop helper characters
for XP (like Merlin). But it never was widely adopted by developers,
excepting a few pieces of software.
> Do you plan to add the support of events?
It's not in our plans for now, sorry.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info