Windowless ActiveX Control - VC++
-
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 -
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 ProgrammerHi, 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 functionGetAmbientUserMode( BOOL& bMode );
returningTRUE
for run mode andFALSE
for design mode. Hope this is what you meant and that it helps to you -
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 functionGetAmbientUserMode( BOOL& bMode );
returningTRUE
for run mode andFALSE
for design mode. Hope this is what you meant and that it helps to youThanks 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? -
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?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. -
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.Thanks geo_m, you're the man!:-D