CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2006
    Posts
    15

    [RESOLVED] Using a dialog as an ocx

    Hi All,

    Currently, i'm trying to learn about creating OCX in Ms.Visual C++. All books that I've read always giving me an example about drawing something in the OnDraw function of class CxxxCtrl (xxx is the name of the project. CxxxCtrl is the child of class COleCtrl). I wonder if it is possible to use a dialog as an ocx control. If yes, then is it possible to add some controls on the dialog?

    The ocx control that I like to create is a digital clock. What I have in mind for the ocx control, is a simple dialog box, with three Static Text on there to represent Hour, Minute, and Second. Then I will apply the timer to change the number of the Hour, Minute and Second.

    Would anybody can give me any information, about how to add the dialog box into an ocx control, please.

    THanks.

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

    Re: Using a dialog as an ocx

    wouldnt it be better to just add the ocx to a dialog box and then access the controls methods there?

  3. #3
    Join Date
    Jun 2006
    Posts
    15

    Re: Using a dialog as an ocx

    The problem is, I like to create an ocx, A digital clock ocx. Therefore other programmer can create a digital clock, by just draging my ocx control into a dialog box. If possible, I like to use a dialog box and some built in control as my ocx.

  4. #4
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Re: Using a dialog as an ocx

    Quote Originally Posted by budihartanto
    The problem is, I like to create an ocx, A digital clock ocx. Therefore other programmer can create a digital clock, by just draging my ocx control into a dialog box. If possible, I like to use a dialog box and some built in control as my ocx.
    Check this:actveX
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  5. #5
    Join Date
    Jun 2006
    Posts
    15

    Re: Using a dialog as an ocx

    Quote Originally Posted by jayender.vs
    As a matter of fact, that's the exactly ocx that I like to create. Unfortunately, the above link, didn't give any explanation about the technique to create the ocx (not to use it).

    So, my problem actually is not in using the timer, but to create the timer ocx.

  6. #6
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Using a dialog as an ocx

    Gort...Klaatu, Barada Nikto!

  7. #7
    Join Date
    Jun 2006
    Posts
    15

    Re: Using a dialog as an ocx

    Quote Originally Posted by Mike Harnad
    It explains thing that I need.
    THanks.

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