Board index » cppbuilder » Strange behaviour: OCX (CppBuilder and Delphi written) used outer space (=Omnis Studio)

Strange behaviour: OCX (CppBuilder and Delphi written) used outer space (=Omnis Studio)


2006-06-30 11:04:45 PM
cppbuilder65
Hello World!
What are the differencies between an ActiveX Form developed with CPPBuilder
2006 and Delphi 2006?
Last week I got the assignment to develop a simple ActiveX component for use
in our company's erp system which is developed with "Omnis Studio" - a
simple interpreter language (see www.omnis.net).
I did this with Delphi 2006, CPPBuider 2006 and CPPBuilder 6 as well: All
three versions cause pain when executed in Omnis, but the same three version
run trouble-free when used in Delphi or Visual Basic.
In the end I reduced all three vesions to a simple "Hello World" consisting
of a simple TActiveForm with a TButton. Using the TLB Editor I made the
TButton OnClick Event "visible" outside the ActiveX Component and called
that Event "OnMyClick".
All three versions work as expected when placed into a Delphi or VB
Application: No exceptions and the OnMyClick fires correctly.
Placing the same three Components into my Omnis Form they show very
different behaviours:
A) Delphi:
The Event is NOT fired. I have tried several different ways of
implementations but the behaviour stays always the same: In my VB or Delphi
host applications the event is fired - in Omnis it's not.
B) CPPBuilder (both Versions - 6 and 2006):
The Event IS FIRED (gee!). VB and Delphi host applications: Everything works
like in my Delphi example.
But in omnis: switching a SECOND time from design time to runtime and
clicking onto the Button (or just onto the component) fires an exception:
"Invalid Window Handle, Code 1400".
I am not really sure who or what that exception fires and how to debug that
(any ideas?).
I know that Omnis is an interpreter language. It looks like Omnis tries to
assign a wrong window handle id to the OCX on the second call. What are
possible reasons for that and why is this different to Delphi??? Using Spy++
I recognized that switching between run- and designtime (Omnis) always
causes a renew of the control's HWND - in Delphi AND Cpp version.
The interesting thing is the different behaviour between Delphi and
CPPBuilder regarding Events and/or that window handle exception. Maybe some
Delphi/CppBuilder/ActiveX guru can give me the right hint.
The possible solutions I already considered:
* Write the component with VB: that is impossible because I need to re-use
VCL components I've already written.
* Contact Omnis support. I already did that...
* Rewrite my company's erp system with Delphi. No: We need a solution before
2011.
* Rewrite my company's erp system with CPPBuilder. No: We need a solution
before 2021.
* Blow up my company's headquarter and live on the insurance money. Nor.
I would appreciate ANY hint, suggesion or lottery price.
Thanks,
Herwig
 
 

Re:Strange behaviour: OCX (CppBuilder and Delphi written) used outer space (=Omnis Studio)

"Herwig Huber" < XXXX@XXXXX.COM >ha scritto nel messaggio
Hi :)
I'm italian, so pls excuse my poor english.
Quote
All three versions work as expected when placed into a Delphi or VB
Application: No exceptions and the OnMyClick fires correctly.
Placing the same three Components into my Omnis Form they show very
different behaviours:
I've got the same problems with RSView32, which i think is something similar
to your Omnis.
Look carefully on how these apps works with OCXs: as example, while VB
destroys and recreates the OCX while changing from design to run (this is a
"standard" windows behaviour) RSView just fires am AmbientChange event, so
you must treat this event as a sort of "re-initialize" event.
Maybe your Omnis does some strange things when going in Run.
Quote
"Invalid Window Handle, Code 1400".
I am not really sure who or what that exception fires and how to debug
that (any ideas?).
Have you tryed some TRACE (or ATLTRACE) in all your events to see what's
happening?
Ciao :)