Click to See Complete Forum and Search --> : VC++ MFC ActiveX and Excel question
Roger Rowland
May 3rd, 1999, 06:11 AM
I'm writing a non-rectangular ActiveX control primarily for use in MS Excel 97. I'm using VC6 and the MFC ActiveX wizard. I have two problems which I can't seem to find a way around.
1. My control works fine in the Test Container but the controls properties are not accessible from MS Excel. Any idea what I might have missed?
2. I'm using windowless activation and displaying the control transparently using a mask. This works fine most of the time but when the Excel sheet is scrolled one row/column at a time and my control starts to move off-screen, it seems like the control receives an OnDraw event *before* Excel has refreshed it's underlying display. This means I include an unwanted portion of my control in the mask area and so replicate the corruption until the control disappears offscreen. Is there some way I can tell my control to wait until Excel has finished redrawing before
Steve Wheatley
May 24th, 1999, 08:18 AM
Hi Roger,
I too am getting funky behaviour with my windowless ActiveX control. My container apps are created using MFC and VBA. If I use VB to create a container app I do not get any problems. It appears that my MFC and VBA containers do not support the IOleInPlaceSiteWindowless interface. Have you had any news / progress from your end you could share?
Cheers
Steve Wheatley
ESRI (UK) Ltd
Edinburgh
UK
Roger Rowland
May 24th, 1999, 03:33 PM
Hi Steve,
I'm glad I'm not alone and that someone has read my posting ;-)
I've had no contact from anyone but you and you seem to be in a similar mess. If I get anywhere, I'll let you in on the secrets ....
Kind regards,
Roger
RMR Systems Limited
Suffolk, UK
Hussam
May 25th, 1999, 02:52 AM
Hello!
I do not know what the second problem is but I have an answer to the first.
VBA( in all office applications also Office 2000) does not refresh a library it creates first time it loads a library (ex. OCX).
If you write your ActiveX in VB and choose "Binary compatibility" this problem will not appear. But if you use any other programing language you will not get the VBA (Office) to recognize the changes you made. The solution is the following :
Search in your entire computer for files named *.exd and *.twd. Usually you find one "your libraray.exd" and two "*Form*.twd". Those files are created first time Office loads up your library. Just delete them ( it does not make any damage). Now you are ready to use the updated OCX ( all new events and methodes will be shown).
Good luck
Hussam
Steve Wheatley
May 25th, 1999, 05:29 AM
Hi Roger,
I've had a few leads in my inbox this morning - you may want to follow these up too.
http://www.codeguru.com/atl/windowless.shtml
I logged a support request with Microsoft and this is what they said:
>> Does MFC 4.2 support windowless ole control containment?
Unfortunately, MFC does not support Windowless control containment.
>> How do I add the necessary interfaces such as IOleInplaceSiteWindowless to the COleControlSite class to support windowless control containment?
There are three sources on how to override MFC control container functionality.
The first is the MSDN sample that can be used as a basis for implementing the desired interface:
TSTCON: ActiveX Control Test Container
The second is the KB article on how to override MFC control containment:
HOWTO: Override the MFC Default Control Containment [visualc] ID: Q196835
Finally, there is the Interface documentation in the Platform SDK. You will also find additional information in the ActiveX '96 spec which was
distributed on '96-'97 MSDN and VC CDs.
Hope this helps you too - I haven't had a chance to look at it just yet.
Good luck
Steve
ESRI(UK) Ltd
Edinburgh
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.