Thank you for your reply.

You say to drag a text box onto the dialog.  I am quite familiar with
dialog boxes, messages and message handlers.  My question is: what
dialog?  The files I get automatically when I create an ActiveX control
project don't include a dialog.  They include a property sheet.  I did
find an example on the Internet that gives me a good idea of what to do
with the property page: one creates it by creating it dynamically and
then calling m_pPropertyPage->Create() in the control's OnCreate()
handler.  

But I don't understand why the default control you get when you create
an ActiveX control project just draws an ellipse in the control's
OnDraw() event.  Most people will want to drop elements onto some kind
of form and then write event handlers for those elements.  Is there a
template available on the Internet anyplace that automatically creates
an ActiveX control with an active element such as a pushbutton contained
on the control's property sheet?


Robert D. Richardson
Product Engineer Software
 
RAD-CON, Inc.
TECHNOLOGY: Innovative & Proven
Phone : +1.440.871.5720 ... ext 123
Fax:  +1.440.871.2948
Website:  www.RAD-CON.com
E-mail:  [email protected]


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Thomas Hruska
Sent: Thursday, March 25, 2010 12:53 AM
To: [email protected]
Subject: Re: [c-prog] How do I create an ActiveX control in C++ 2008?

interrobang wrote:
> Greetings!
> 
> I would like to create an ActiveX control using C++ in MS Visual
Studio 2008.  I created a new MFC ActiveX control project, but I don't
see where to draw anything!  The new project contains an about box and a
property page, but there's no place I know of to put any visual elements
that a user would see when he uses the control.
> 
> For example, let's say I want a dumb little control that contains a
single text box.  The control will have a single public function named
ShowString() that will take a string argument and will display that
argument in the text box.  Where do I put the text box?
> 
> Thank you very much.
> 
> RobR

I've never done ActiveX development, but I don't envision it to be much
different from most apartment-threaded ATL COM-based projects.

Have you worked with VS.NET products before?  And have you built a
simple GUI-based project (non-ActiveX) in VS2008 just to get your feet
wet?  ActiveX/ATL/COM is its own beast to tame/master.

As to getting a text box on a dialog, you drag the control onto the
dialog.  There should be a toolbar somewhere in the designer that
contains basic UI elements.  Connecting the text box to program logic is
usually a matter of selecting the element, finding the appropriate event
in the dropdown, and using the default handler name.  VS will generate
the correct code for the handler and drop you in the editor.  At least
that is what _usually_ happens.

--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/



------------------------------------

To unsubscribe, send a blank message to
<mailto:[email protected]>.Yahoo! Groups Links



Reply via email to