Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 93265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:19:02+00:00 2026-05-10T23:19:02+00:00

I have a weird error in my C++ classes at the moment. I have

  • 0

I have a weird error in my C++ classes at the moment. I have an ActiveX wrapper class (as part of wxWidgets) that i added a new virtual function to. I have another class that inherits from the ActiveX one (wxIEHtmlWin) however the ActiveX class always calls its own function instead of the one in wxIEHtmlWin which overrides it.

I can’t work out why this is happening. I made the function pure virtual and now the program crashes when it does the function call but compiles fine otherwise. Is there any way to disable virtual functions or have I found a bug in Visual Studio?

ActiveX class

protected: virtual FrameSite* getNewFrameSite()=0; 

wxIEHtmlWin class

class wxIEHtmlWin : public wxActiveX { protected:     FrameSite* getNewFrameSite(); }  FrameSite* wxIEHtmlWin::getNewFrameSite() {     return new gcFrameSite(this); } 

Edit: I’ve added another test function (returns an int) and still screws up.

Link to code in question: http://lodle.net/public/iebrowser.rar

Edit:

OK thanks to the answer below i got it to work. What i did was create the activex class in two parts (like suggested) however in wxIEHtmlWin i called the second part in the constructor code. Like so:

wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id, const wxPoint& pos,const wxSize& size,long style, const wxString& name) : wxActiveX() {     wxActiveX::Create(parent, PROGID, id, pos, size, style, name);     SetupBrowser(); } 

Now i know why wxWidgets supports two part construction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:19:03+00:00Added an answer on May 10, 2026 at 11:19 pm

    You are calling the virtual method from within the class’s constructor (via another call). This will call the method on the current class as the sub-class hasn’t been constructed yet. The fix is to use an init() method and call it after constructing the class.

    i.e something like this:

    class wxActivex {   wxActivex() {}   virtual void init() {     getNewFrame();   } };    // in the code that uses these classes:   wxActivex *activex = new IEHtmlFrame();   activex->init(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird date rounding problem that hopefully someone can solve. My client
I have a weird issue that only seems to be affecting IE 7. The
I have some extremely weird behavior that seems to result in silent exceptions. How
I have this weird crash that only happens when running the app on the
I'm having trouble with classes in haskell. Basically, I have an algorithm (a weird
I'm getting a compiler error saying that Acme.Business.User is not defined. I have a
We have a weird intermittent problem with saving from Word 2007 to our SharePoint
i have a weird problem. i would like to delete an assembly(plugin.dll on harddisk)
I have a weird problem with images in visual web developer, I cant change
We have a semi-weird issue for our site. Consistently, from 1 anonymous* user the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.