Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe (immer noch) das Problem, dass ich es einfach nicht fertig bringe, eine wxApp aus einer statischen Bibliothek im Hauptprogramm zu implementieren. Dabei entstanden stets Memoryleaks, wobei ich nicht weiß, ob das tatsächlich die Ursache dafür ist, dass die ganze App nicht läuft.

Durch Auskommentieren habe ich festgestellt, dass es nicht an einer Anweisung innerhalb des App-Quellcodes scheitert, sondern schon beim implementieren, also durch die Anweisung "IMPLEMENT_APP".

Da nicht mehr viel Code übrig geblieben ist, zitiere ich den hier jetzt komplett:

Zum einen das Hauptprogramm "Controller.exe"

Controller.h


#include <ViewDeclaration.h>


#include <stdlib.h>

#include <crtdbg.h>


#ifndef _CONTROLLER_H_

#define _CONTROLLER_H_


using namespace ModelClasses;


class Controller

{


public:

	Controller() throw(...);

	~Controller();

};


#endif

Controller.cpp

#include "Controller.h"


#include <iostream>


using namespace std;


IMPLEMENT_APP(View);


Controller::Controller()

{


}


Controller::~Controller()

{


}


void main()

{

	Controller();

}

Zum anderen die View als Bibliothek "View.lib" ViewDecalaration.h

#include <wx\wx.h>


#ifdef __WXMSW__

#include <wx/msw/msvcrt.h>

#endif


#ifndef _VIEWDECLARATION_H_

#define _VIEWDECLARATION_H_


using namespace std;


class View : public wxApp

{

public:

	View();

	~View();

};


#endif

View.cpp

#include <ViewDeclaration.h>


View::View()

{


}


View::~View()

{


}

Es soll also eigentlich bei der Version noch überhaupt nichts passieren - trotzdem schon Memoryleaks. Es muss also, schätze ich, an der "IMPLEMENT_APP"-Anweisung liegen, respektive am Programmaufbau, da es funktioniert hat, als ich alles innerhalb eines Programmes ohne Bibliotheken getestet habe. Wie bekomme ich es jetzt hin, dass das auch als Bibliothek funktioniert? Eignet sich das Makro überhaupt für einen Aufruf an dieser Stelle? Welche Alternativen gibt es? Ich habe schon gesucht und bin dabei auf solches gestoßen:

wxApp::SetInstance( new MyWxApp() );

wxEntryStart( argc, argv );

wxTheApp->OnInit();


// you can create top level-windows here or in OnInit()

...

// do your testing here


wxTheApp->OnRun();

wxTheApp->OnExit();

wxEntryCleanup();

Das habe ich schon versucht, hat den gleichen Effekt.

Bitte helft mir.

Gruß

PL1994

  • 1 Monat später...

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.