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: | 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:1 by , 17 years ago
comment:3 by , 17 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
by , 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 , 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 , 17 years ago
| Owner: | changed from to |
|---|
comment:6 by , 16 years ago
| Severity: | None → Blocking |
|---|
comment:7 by , 16 years ago
| Milestone: | → 3.3.1.4 |
|---|---|
| Resolution: | → Fixed |
| Status: | assigned → closed |
Fixed in version: 3.3.1.4

Just attach ypur sample MFC. Thanks