#906 closed Bug (Fixed)
ActiveX Control on a GUI gets incorrect size information when queried
| Reported by: | 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)
Change History (8)
comment:3 by , on May 12, 2009 at 2:08:14 PM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
by , 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 , 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 , on Jun 17, 2009 at 4:08:13 AM
| Owner: | changed from to |
|---|
comment:6 by , on Oct 17, 2009 at 12:51:43 AM
| Severity: | None → Blocking |
|---|
comment:7 by , on Oct 17, 2009 at 1:30:04 AM
| Milestone: | → 3.3.1.4 |
|---|---|
| Resolution: | → Fixed |
| Status: | assigned → closed |
Fixed in version: 3.3.1.4

Just attach ypur sample MFC. Thanks