CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Join Date
    Apr 1999
    Posts
    3,585

    Re: draw method of activex

    As requested...
    Attached Files Attached Files
    Gort...Klaatu, Barada Nikto!

  2. #17
    Join Date
    Mar 2007
    Posts
    238

    Re: draw method of activex

    HI Mike, Thanks for the file. While comparing your files with mine, I noticed that enable simple frame wasn't a default in my wizard. I tried creating another control with that ticked, and i still get the winocc.cpp 307 error...

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

    Re: draw method of activex

    What version of Visual Studio are you using? I created my test program using Visual Studio 2005.
    Gort...Klaatu, Barada Nikto!

  4. #19
    Join Date
    Mar 2007
    Posts
    238

    Re: draw method of activex

    vs2005 and vc++2005. I tried in my vmware which has vs2008 beta.... i get the same error message when i attach the activex.

    I have a feeling it's my computer libraries which is causing this problem. I wish i know what?

    When i try to debug the error in vs, it goes to afxwin2.inl line 104 (movewindow() function). And the values of lpRect->left 0, top->0, right -50, bottom-50, so nothing wrong with the values ibeleive. and cwnd::movewindow from winocc.cpp line 307

    Code:
     assert(::ISWindow(m_hwnd) // I can see it says expression can't be evaluated.
    I believe that's where the problem starts or rather ends.

    THanks

  5. #20
    Join Date
    Apr 2013
    Posts
    5

    Re: draw method of activex

    Hi,

    I'm trying to do the same thing demonstrated by the article:

    Quote Originally Posted by Mike Harnad View Post
    Is this what you're trying to do?
    But keep getting errors, i'm using vs2010, my project is identical as the one posted here, did you guys figured out what was the problem?

    Thanks in Advance!

  6. #21
    Join Date
    Apr 2013
    Posts
    5

    Thumbs up Re: draw method of activex

    Hello,

    After few days researching i've found out the solution.

    The ActiveXCtrl must be a Control Container, this setting resolve the problem:

    Put AfxEnableControlContainer() right before the creation of the attached control in the handler of WM_CREATE (::OnCreate).

    Cheers!
    Last edited by plac88; April 11th, 2013 at 12:21 PM.

  7. #22
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: draw method of activex

    Quote Originally Posted by plac88 View Post
    The ActiveXCtrl must be a Control Container
    It must not, in case your dialog styles include WS_CHILD. See the sample as a proof.
    Last edited by Igor Vartanov; April 15th, 2013 at 03:09 AM.
    Best regards,
    Igor

  8. #23
    Join Date
    Apr 2013
    Posts
    5

    Re: draw method of activex

    Well, if you're saying.

    I'm shallow at mfc development, just posting what works out for my problem.

    But anyway thanks for the correction! i'll try not to misguide people (unwittingly) again, haha.

    Thanks for the post link, this will surely help me with other issues.

    Cheers!

Page 2 of 2 FirstFirst 12

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