INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

EventHandler(OLEcontrol.ListImages, oEventHandler) fails

EventHandler(OLEcontrol.ListImages, oEventHandler) fails

(OP)
Hi,

Using an OLEcontrol with .OLEclass = 'MSComctlLib.ImageListCtrl.2', I try to bind events of the 'ListImages' collection to a VFP handler object (see test code below)

EventHandler() always return .F.

Any idea why?

Thanks

CODE --> foxpro

local oForm, ListImages_Handler

activate screen
clear

oForm = CreateObject('form')
? Datetime(), 'awOLEiml6', Iif(oForm.AddObject('awOLEiml6', 'awOLEiml6'), 'OK', 'KO :(') && aw.vcx!awOLEiml6 is an OLEcontrol with .OLEclass = 'MSComctlLib.ImageListCtrl.2'
&& ftp://foxincloud.com/ab/aw.vcx
&& ftp://foxincloud.com/ab/aw.vct

ListImages_Handler = CreateObject("ListImages_Handler") && see below
? Datetime(), 'ListImages_Handler', Iif(Vartype(m.ListImages_Handler) == 'O', 'OK', 'KO :(')

*suspend

? Datetime(), 'EventHandler()', iif(EventHandler(m.oForm.awOLEiml6.ListImages, m.ListImages_Handler), 'OK', 'KO :(')

? Datetime(), 'ListImages.add()', Iif(Vartype(m.oForm.awOLEiml6.ListImages.add(, Home(1) + 'Graphics\Bitmaps\Gauge\dome.bmp', LoadPicture(Home(1) + 'Graphics\Bitmaps\Gauge\dome.bmp'))) == 'O', 'OK', 'KO :(')


DEFINE CLASS ListImages_Handler AS session && OLEpublic

	IMPLEMENTS IImages IN "MSComctlLib.ImageListCtrl.2"

	PROCEDURE IImages_get_ControlDefault(Index AS VARIANT) AS VARIANT
	* add user code here
	ENDPROC

	PROCEDURE IImages_put_ControlDefault(Index AS VARIANT) AS VARIANT
	* add user code here
	ENDPROC

	PROCEDURE IImages_get_Count() AS INTEGER;
 				HELPSTRING "Returns the number of objects in a collection."
	* add user code here
	ENDPROC

	PROCEDURE IImages_put_Count(eValue AS INTEGER @);
 				HELPSTRING "Returns the number of objects in a collection."
	* add user code here
	ENDPROC

	PROCEDURE IImages_get_Item(Index AS VARIANT) AS VARIANT;
 				HELPSTRING "Returns a specific member of a Collection object either by position or by key."
	* add user code here
	ENDPROC

	PROCEDURE IImages_put_Item(Index AS VARIANT, Key AS VARIANT, Picture AS VARIANT) AS VARIANT
	&& 2017-09-19 thn -- {en} added for instantiation to succeed
	ENDPROC

	PROCEDURE IImages_Add(Index AS VARIANT, Key AS VARIANT, Picture AS VARIANT) AS VARIANT;
 				HELPSTRING "Adds a ListImage object to a ListImages collection and returns a reference to the created object."
	* add user code here
? 'IImages_Add()', m.key
	ENDPROC

	PROCEDURE IImages_Clear() AS VOID;
 				HELPSTRING "Removes all objects in a collection."
	* add user code here
	ENDPROC

	PROCEDURE IImages_Item(Index AS VARIANT) AS VARIANT;
 				HELPSTRING "Returns a specific member of a Collection object either by position or by key."
	* add user code here
	ENDPROC

	PROCEDURE IImages_Remove(Index AS VARIANT) AS VOID;
 				HELPSTRING "Removes a specific member from a collection."
	* add user code here
	ENDPROC

	PROCEDURE IImages__NewEnum() AS VARIANT
	* add user code here
	ENDPROC

enddefine 

Thierry Nivelet (French native speaker)
FoxInCloud, ZenBuyer, IntuiCat
http://foxincloud.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close