CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Location
    UK
    Posts
    10

    VC++ MFC ActiveX and Excel question

    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

  2. #2
    Join Date
    May 1999
    Posts
    3

    Re: VC++ MFC ActiveX and Excel question

    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


  3. #3
    Join Date
    May 1999
    Location
    UK
    Posts
    10

    Re: VC++ MFC ActiveX and Excel question

    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

  4. #4
    Join Date
    Apr 1999
    Location
    Norway
    Posts
    19

    Re: VC++ MFC ActiveX and Excel question

    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


  5. #5
    Join Date
    May 1999
    Posts
    3

    Re: VC++ MFC ActiveX and Excel question

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured