We have an MFC standalone application.
On of the views contains a ActiveX control.
The recorded testscript recognizes the control in the GUIObject and is able to send mouseclicks etc.
What I want to do is map the control to a variable so that I can use all the native properties of that control.
I think I shoud do it using the TActiveX object.
Does anyone have a suggestion.
How to map a GUIObject to the native activeX ojbect. It concerns an Apex TrueDBGrid and I would like to phisically manipulate and verify date in certain cells.
If you are using 5.1.1, you should look for a patch on Compuware's Frontline. I had a problem where ActiveX controls that were contained in frames were being seen as GUIObject. The patch I installed fixed that problem and then I could use the TActiveX object.
If that doesn't work, try using TGUIObject instead of TActiveX. You will still need to use the .object method.
You can access all the properties of a control by referencing it. In code you then declare an TActiveX and set that control to this object variable. You also declare an variable as the activeX type. Then you can set the TActiveX.Object equal to this variable. You will then see all the properties in intelisence.
Ok, so I have tried a lot.
Using the TGUIObject I can attach, but the object property is empty ( Nothing ).
The ActiveX method doesn't work for the TrueDBGrid it seems. When I add the control in the asset map ( using "Identify" ) I cannot get the ActiveX method to return the activex control.
It keeps saying :
Run-time error '-2147467259 (80004005)';
Failed to find the attach name:
tdbGridOCX is the name I gave the control in the assetmap.
Somehow the "Name" property is not supported.
I know the Attachname consists of Classname, Name and application.
I am using the ComponentOne TrueDBGrid. Did anyone have the same problems?
Yes I did apply the patch, I believe it is service pack 2.
Anyway, I got it to work only on a test program.
I wrote a simple mfc application with the view layout of our main app. In my test app it all works, I'm able to use the ActiveX method because
the Assetmap recognizes the control as ActiveX.
In our main app the control is still seen as a GUIObject.
So I'll just go through the app and see where the differences are.
I would like to thank everybody for their contribution.