I have checked my application class code against a working version in wxMSW and the two applications make the same calls. I am using wxGTK.
What is wrong?
I can post code if needed, but it is such a basic application that I don't know if it is necessary.
Thanks!
Jon
-LN
That is the problem - what virtual functions?
There are no virtual functions that I have defined in any of my classes. The only ones are found in wxApp. But which one is causing the issue? Why would wxApp cause this problem in wxGTK?
I have overridden OnInit() and OnExit(). I have also tried overriding the functions one by one, but to no avail (I haven't done them all since there are about 20 or 30 functions in the wxApp class).
Has anyone seen this before? If it helps, here are copies of my application class code: (Note that there is no destructor. I have tried overriding the dtor with the same result).
Jon
/*
* arssgseapp.hpp
*
* Created on: Aug 4, 2008
* Author: jhaws
*/
#ifndef ARSSGSEAPP_HPP_
#define ARSSGSEAPP_HPP_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "arssgseapp.hpp"
#endif
/** wxWidgets Includes */
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
/** Project Includes */
/** System Includes */
/** Shared Includes */
/** ArssGseApp class declaration */
class ArssGseApp : public wxApp
{
DECLARE_CLASS(ArssGseApp)
public:
/** Constructor */
ArssGseApp();
/** Called by wxWidgets to initialize the application.
* @return true if initialization was successful.
*/
virtual bool OnInit();
//TODO: Add functions to initialization of application
protected:
/** Called by wxWidgets to cleanup initialization
* @return exit code
*/
virtual int OnExit();
private:
//TODO: Add any private information to the application class
};
/** Application Instance declaration */
DECLARE_APP(ArssGseApp)
#endif /* ARSSGSEAPP_HPP_ */
/********************************************************************/
/*
* arssgseapp.cpp
*
* Created on: Aug 4, 2008
* Author: jhaws
*/
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "arssgseapp.hpp"
#endif
/** Project Includes */
#include "arssgseapp.hpp"
#include "arssgse.hpp"
#include "Version.hpp"
/** Shared Includes */
#include "Sdbase/wxSDL/Msglog.hpp"
#include "Includes/MsgLvl.hpp"
/** wxWidget Includes */
/** System Includes */
/** Namspace */
using namespace std;
/** Application instance implementation */
IMPLEMENT_APP(ArssGseApp)
/** ArssGseApp type definition */
IMPLEMENT_CLASS(ArssGseApp,wxApp)
/** Constructor for ArssGseApp */
ArssGseApp::ArssGseApp()
{
}
/** Initialization for ArssGseApp */
bool ArssGseApp::OnInit()
{
if(!wxApp::OnInit()) //cmd line parsing done in wxApp::OnInit()
return false;
SetVendorName(COMPANY_NAME);
SetAppName(PACKAGE_NAME);
//Set working directory to location of executable
wxSetWorkingDirectory(wxPathOnly(wxGetApp().argv[0]));
//Get IP address to connect to (NOT IMPLEMENTED YET)
//Create Server UI main frame and show it
ArssGse* pFrame = new ArssGse(NULL, wxID_ANY, GetAppName(),
wxDefaultPosition, wxDefaultSize);
SetTopWindow(pFrame);
//Log version
//Msglog::displayMsg(MSGLVL_INFO,"%s version: %s\n",PACKAGE_NAME,VERSION_STR);
return true;
}
int ArssGseApp::OnExit()
{
return wxApp::OnExit();
}
JH> #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
JH> #pragma interface "arssgseapp.hpp"
JH> #endif
You need to remove this and the matching pragma in .cpp. Why did you
add them?
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
To be honest, I don't know why those were in the code. They are remnants from previous code that was working fine, but got overlooked. Once they were removed, the problem is solved.
Thanks VZ!
Jon