CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: ActiveX control

  1. #1
    Join Date
    Aug 2003
    Location
    Azerbaijan ,Baku
    Posts
    59

    ActiveX control

    I use MFC Doc/View arch.
    i have control (MapX Mobile), this control use entire view part of window
    i want do next things:
    when i click on the control(view) i want create context menu but control have own function that is hiden inside. how i can process this event myself ?

    thanks in advance

    PS
    i use Microsoft eMbedded Visual Studio 4 sp 30
    Last edited by Mabbus; August 16th, 2005 at 12:50 PM.

  2. #2
    Join Date
    Jul 2003
    Posts
    147

    Re: ActiveX control

    I have done several different things to get around this depending on what the control allows and what functionality you need from the control. A lot of controls have a right click event you can handle, which is obviously the easiest solution. Otherwise, if the control can be disabled and still display properly, you can disable the control and handle the events in the parent window. Alternatively, if the control has a draw method that allows you to simply pass a DC to it and it renders itself, you can simply hide the control window and forward the events you don't care about to it. I have done this using OnWndMsg() and PostMessage().

    Just some thoughts ... hope this helps.

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: ActiveX control

    Quote Originally Posted by Mabbus
    I use MFC Doc/View arch.
    i have control (MapX Mobile), this control use entire view part of window
    I do not know MapX Mobile but are you sure it is an ActiveX contro?
    Quote Originally Posted by Mabbus
    i want do next things:
    when i click on the control(view) i want create context menu but control have own function that is hiden inside. how i can process this event myself ?
    If active control has event that fires upon receiving mouse click just handle it. I think you are confusing event with windows message handling.
    The whole idea is to find how this control is architectured. It can contain several nested windows. You would have to find window that is receiving mouse messages and subclass it.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  4. #4
    Join Date
    Aug 2003
    Location
    Azerbaijan ,Baku
    Posts
    59

    Re: ActiveX control

    Quote Originally Posted by JohnCz
    I do not know MapX Mobile but are you sure it is an ActiveX control?
    I think so.
    Quote Originally Posted by JohnCz
    I think you are confusing event with windows message handling.
    that's true after i reed through this topic i review sample code and found in CMyView this DECLARE_EVENTSINK_MAP() after little more review of code i found in Control file CMapX.h defined number for some events and i am close now to what i am doing thanks.

    (Control display map and and there is a lot of tool like pan and zoom which i need use too)

    but if control not support some event that i need, is it posible to add them ? - as i read in both posts answer is yes, is it posible to point me on some example or guides on how to do this with full explanations

  5. #5
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: ActiveX control

    If you find top window that may be a part of set of nested windows, you probably could by subclassing or hooking that window.

    The question remains: what would you do from message handlers; is control exposing interfaces and their methods that can be used by you?

    Besides I think if map control does not handle zooming, panning e.t.c would make me think twice before I use it.

    Check documentation it is possible that you have missed something.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  6. #6
    Join Date
    Aug 2003
    Location
    Azerbaijan ,Baku
    Posts
    59

    Re: ActiveX control

    I add MapX mobile sample project for Microsoft eMbedded Visual Studio wich i use as backbone of my program .
    if you not mind please look at it, becouse i am not good know ActivX Technology and can not answer or ask question with all need information .



    Besides I think if map control does not handle zooming, panning e.t.c would make me think twice before I use it.

    this stuff handle it (didnot write full idea last time )
    if i handle Click event, control own function must not process this event right? if yes it' meens i misunderstood something, when i Click on the control two reaction arise one is my OnClick function and second standart control reaction onClick wich is not needed.


    i write program for pocket PC.
    and Click event is fo example, in the PocketPC when you tap and hold stylus rise some message i didnt found which yet . as result i want to add context menu wich is pup when i tap and hold stylus in the control area
    Attached Files Attached Files
    Last edited by Mabbus; August 17th, 2005 at 09:12 AM.

  7. #7
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: ActiveX control

    Since I am on the road and I do not have embedded VS on my laptop I will not be able to test your project.

    I hope that somebody else will be able to do it for you.
    It may also be beneficial for you to post your issue in Wireless/Mobile Development forum.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  8. #8
    Join Date
    Aug 2003
    Location
    Azerbaijan ,Baku
    Posts
    59

    Re: ActiveX control

    Sorry i am not asking for testing, you asked this question

    is control exposing interfaces and their methods that can be used by you?

    but i can not answer that why i posted last message

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