Modify

#906 closed Bug (Fixed)

ActiveX Control on a GUI gets incorrect size information when queried

Reported by: rgreer@… Owned by: Valik
Milestone: 3.3.1.4 Component: AutoIt
Version: 3.3.0.0 Severity: Blocking
Keywords: Cc:

Description

If an MFC ActiveX Control makes a call to

COleControl::GetControlSize(int* pcx,
   int* pcy )

, it is supposed to return the control's width and height.
If the control is attached to an AutoIT GUI:

Local $oObject = ObjCreate("MFCActiveX.Control.1")
Local $GUIMain = GUICreate("Test", 800,600,0,0)
GUICtrlCreateObj($oObject, 0,0,800,600)
GUISetState()

It always returns x=100, y=50.

In any other container (.NET, VB, C++/MFC), this control correctly gives the height/width.

I can attach a sample MFC project that demonstrates this, or you can create one from scratch and add the following code somewhere in the control:

int iControlWidth, iControlHeight;
CString sControlDimensions;
	
GetControlSize(&iControlWidth, &iControlHeight);

sControlDimensions.Format(L"Width: %d Height: %d",iControlWidth, iControlHeight);

MessageBox(sControlDimensions);

Attachments (1)

ExampleControl.zip (50.9 KB ) - added by rgreer@… on Jun 11, 2009 at 11:41:19 PM.
Example files that show the problem. Register the ocx in ExampleControl\debug, and run the included ExampleControl.au3. The control itself is told from the container that it's 100x50, when it's clearly not that size.

Download all attachments as: .zip

Change History (8)

comment:1 by Jpm, on Apr 24, 2009 at 6:56:38 AM

Just attach ypur sample MFC. Thanks

comment:2 by Jpm, on May 12, 2009 at 9:29:39 AM

Bump
Can I have the MFC sample?

comment:3 by Jpm, on May 12, 2009 at 2:08:14 PM

Owner: set to Jpm
Status: newassigned

by rgreer@…, on Jun 11, 2009 at 11:41:19 PM

Attachment: ExampleControl.zip added

Example files that show the problem. Register the ocx in ExampleControl\debug, and run the included ExampleControl.au3. The control itself is told from the container that it's 100x50, when it's clearly not that size.

comment:4 by Valik, on Jun 16, 2009 at 8:10:21 PM

I found the source of the 100,50 size - it's in some of the MFC code. Clearly we are doing something wrong or not calling an optional interface that updates the size MFC returns. I need to find the documentation on ActiveX and go over it looking at all the interfaces that need implemented.

comment:5 by Jpm, on Jun 17, 2009 at 4:08:13 AM

Owner: changed from Jpm to Valik

comment:6 by Valik, on Oct 17, 2009 at 12:51:43 AM

Severity: NoneBlocking

comment:7 by Valik, on Oct 17, 2009 at 1:30:04 AM

Milestone: 3.3.1.4
Resolution: Fixed
Status: assignedclosed

Fixed in version: 3.3.1.4

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.