Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Windowless ActiveX Control - VC++

Windowless ActiveX Control - VC++

Scheduled Pinned Locked Moved ATL / WTL / STL
c++csharpjavacom
5 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Raphael Amorim
    wrote on last edited by
    #1

    Hey all, Some doubts: 1- How to make a property of an Activex Control(VC++), shows up at the "properties window" in Visual Basic. 2- How to set up the design-time image resource that will be drawn that represents the Control on the form, when the user drag it from the toolbox to the form. I know it's inside the OnDraw() event, isn't it? Remebering...all without MFC, just ATL. Raphael Amorim Dantas Leite VC++, VB, Java, .NET and eMbedded Programmer

    G 1 Reply Last reply
    0
    • R Raphael Amorim

      Hey all, Some doubts: 1- How to make a property of an Activex Control(VC++), shows up at the "properties window" in Visual Basic. 2- How to set up the design-time image resource that will be drawn that represents the Control on the form, when the user drag it from the toolbox to the form. I know it's inside the OnDraw() event, isn't it? Remebering...all without MFC, just ATL. Raphael Amorim Dantas Leite VC++, VB, Java, .NET and eMbedded Programmer

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      Hi, 1. Look for BEGIN_PROP_MAP documentation. Sample of usage is then: BEGIN_PROP_MAP(CMyClass) ... PROP_ENTRY("PropertyName",23, CLSID_NULL) END_PROP_MAP() where 23 is a number equal to DispID of your property (simple the id(23) in your IDL in the property definition) 2. For deciding if you are in design mode or runtime mode, use function GetAmbientUserMode( BOOL& bMode ); returning TRUE for run mode and FALSE for design mode. Hope this is what you meant and that it helps to you

      R 1 Reply Last reply
      0
      • G geo_m

        Hi, 1. Look for BEGIN_PROP_MAP documentation. Sample of usage is then: BEGIN_PROP_MAP(CMyClass) ... PROP_ENTRY("PropertyName",23, CLSID_NULL) END_PROP_MAP() where 23 is a number equal to DispID of your property (simple the id(23) in your IDL in the property definition) 2. For deciding if you are in design mode or runtime mode, use function GetAmbientUserMode( BOOL& bMode ); returning TRUE for run mode and FALSE for design mode. Hope this is what you meant and that it helps to you

        R Offline
        R Offline
        Raphael Amorim
        wrote on last edited by
        #3

        Thanks a lot geo_m. But Whenever I drag the component icon from toolbox to the form, in the OnDraw() event is drawn on the form as beveled window with "ATL 3.0 : ComponentName" written over it. I want to put the same icon that is in the toolbox instead of this, got it?

        G 1 Reply Last reply
        0
        • R Raphael Amorim

          Thanks a lot geo_m. But Whenever I drag the component icon from toolbox to the form, in the OnDraw() event is drawn on the form as beveled window with "ATL 3.0 : ComponentName" written over it. I want to put the same icon that is in the toolbox instead of this, got it?

          G Offline
          G Offline
          geo_m
          wrote on last edited by
          #4

          yep. Then you have to test if you are in the run-time mode or design time mode in the OnDraw (or store the result and only test it here) If you will be in design time mode, you can draw your icon using DrawIcon method, or any other of your choice. If you want to know which icon is on the VB toolbar, you can look into your resources, it is stored here, so you can access it and do with it whatever you like.

          R 1 Reply Last reply
          0
          • G geo_m

            yep. Then you have to test if you are in the run-time mode or design time mode in the OnDraw (or store the result and only test it here) If you will be in design time mode, you can draw your icon using DrawIcon method, or any other of your choice. If you want to know which icon is on the VB toolbar, you can look into your resources, it is stored here, so you can access it and do with it whatever you like.

            R Offline
            R Offline
            Raphael Amorim
            wrote on last edited by
            #5

            Thanks geo_m, you're the man!:-D

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups