Modify

Opened 17 years ago

Closed 16 years ago

#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@… 17 years ago.
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 J-Paul Mesnage, 17 years ago

Just attach ypur sample MFC. Thanks

comment:2 by J-Paul Mesnage, 17 years ago

Bump
Can I have the MFC sample?

comment:3 by J-Paul Mesnage, 17 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

by rgreer@…, 17 years ago

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, 17 years ago

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 J-Paul Mesnage, 17 years ago

Owner: changed from J-Paul Mesnage to Valik

comment:6 by Valik, 16 years ago

Severity: NoneBlocking

comment:7 by Valik, 16 years ago

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.