Modify

Opened 16 years ago

Closed 15 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@… 15 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 Changed 16 years ago by Jpm

Just attach ypur sample MFC. Thanks

comment:2 Changed 16 years ago by Jpm

Bump
Can I have the MFC sample?

comment:3 Changed 16 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

Changed 15 years ago by rgreer@…

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 Changed 15 years ago by Valik

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 Changed 15 years ago by Jpm

  • Owner changed from Jpm to Valik

comment:6 Changed 15 years ago by Valik

  • Severity changed from None to Blocking

comment:7 Changed 15 years ago by Valik

  • Milestone set to 3.3.1.4
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed in version: 3.3.1.4

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Valik.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.