Problem with Door library and Native Image

HARRY

Active Member
Licensed User
Longtime User
Hi,

I need to add some events to an Native image. I use the following code:

NImage1.New1("TextPhoto",20,90,200,200)
NImage1.Color=BackColor
doorobj.New1(False)
*** doorobj.FromControl("NImage1")
eventobj1.New1(doorobj.value,"MouseDown")
eventobj2.New1(doorobj.value,"MouseMove")
eventobj3.New1(doorobj.value,"MouseUp")

NImage1 is a NativeImage
doorobj is an object from the door library
eventobj1, 2 and 3 are events from the door library

On the marked line I get the following error message:

On the PC

"An object of type DBasic.Other.SWrapObject can not be converted to type System.Windows.Forms.Control." (Translated from dutch)

On the device:
Invalid cast exception

Am I doing somethging wrong?

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hi Erel,

As far as I can see a NativeImage has the ControlRef property; no Value propertry

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hi Erel and Andrew,

The following code is accepted:

doorobj.FromControl(NImage1.ControlRef)
eventobj1.New1(doorobj.value,"MouseDown")
eventobj2.New1(doorobj.value,"MouseMove")
eventobj3.New1(doorobj.value,"MouseUp")

I still have tot test whether it really works.

Thanks for your help

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hi,

Again a problem for me with the door library.


I want to add a mouse down event to a WEB control.

Based on the foregoing discussion I try to do it as follows:

WEB1.New1("FollowForm",0,0,240,240)

WEBMouseDownEvent.New1(WEB1.ControlRef,"MouseDown")

WEBMouseDownEvent is an Event of the door library.

I get the error message: (translated from dutch):

"The target/purpose(?) of a call has caused an exception."

Am I doing something wrong or is this not possible at all?

Does another method exist to raise an event when the user touches the WEB

control?


Harry
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…