Jump to content
Sign in to follow this  
severino

Problem with MFC based ActiveX controls

Recommended Posts

severino

Hello,

we develop software components in ActiveX and .NET format.

One of our customers reported us that it cannot use our ActiveX controls within AutoIt because when he tries to call one of the control's methods (for example the AboutBox) he gets the following error:

C:\temp\test.au3 (32) : ==> The requested action with this object has failed.:

$oTest.AboutBox()

$oTest.AboutBox()^ ERROR

The simple source code used is the following:

#include <GUIConstants.au3>

#include <Constants.au3>

; ;Create reference to COM object

; ;Create GUI

$Main_Window = GUICreate ("My Window", 600, 600, 100, 100, $WS_POPUP)

$oTest = ObjCreate ("TESTAX.TestAxCtrl.1")

$AboutC = GUICtrlCreateButton('About',105,177,70,20)

$GUIActiveX = GUICtrlCreateObj ($oTest, 100, 100, 10, 10)

GUISetState ()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $AboutC

$oTest.AboutBox()

EndSelect

Wend

GUIDelete ($Main_Window)

$Recorder = 0

Our controls are based upon the MFC framework and are actually compatible with most control containers available on the market: are you aware of any issue with ActiveX developed using the MFC framework? We have tried to develop a new basic control from scratch, simply having an AboutBox method inside, using Visual C++ 6 and we experienced exactly the same issue; on the other hand controls developed using Visual Basic 6 work as expected inside AutoIt: any help on this issue would be much appreciated.

Thanks in advance and Kind Regards

Severino Delaurenti

MultiMedia Soft

http://www.multimediasoft.com

Share this post


Link to post
Share on other sites
lsakizada

Hello,

we develop software components in ActiveX and .NET format.

One of our customers reported us that it cannot use our ActiveX controls within AutoIt because when he tries to call one of the control's methods (for example the AboutBox) he gets the following error:

C:\temp\test.au3 (32) : ==> The requested action with this object has failed.:

$oTest.AboutBox()

$oTest.AboutBox()^ ERROR

The simple source code used is the following:

I tested your code and it's worked on my XP system. :shocked:

EDIT: woops .... it did not worked for me since there is no TESTAX.TestAxCtrl.1 progid on my machine ...

Edited by lsakizada

Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
severino

I tested your code and it's worked on my XP system. :shocked:

EDIT: woops .... it did not worked for me since there is no TESTAX.TestAxCtrl.1 progid on my machine ...

Hello,

you can download the mentioned test control from the following link:

http://www.multimediasoft.com/temp/TestAx.zip

it has no dependencies because MFCs are linked statically so you can copy the contained TestAx.ocx control wherever you want inside your system and register it using RegSvr32.exe

This code works perfectly with Visual Basic 6 generated controls but, as you will see, the same code will not work with MFC based controls: quite weird...

Kind regards

Severino Delaurenti

MultiMedia Soft

http://www.multimediasoft.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×