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 möchte eine Toolbar erstellen, wie es hier beschrieben wird: https://msdn.microsoft.com/en-us/library/hh298381(v=vs.85).aspx.

Wie andere Tutorials zeigen, brauche ich dafür den Header "CommCtrl.h" und muss "Comctl32.lib" verlinken. Das habe ich getan.

Beim Erstellen bekomme ich jetzt allerdings etliche Fehlermeldungen, alle bezogen auf den Header "prsht.h".

Da gibt es fehlende Typspezifizierer, unzählige Syntaxfehler und letztlich die Meldung: "Mehr als 100 Fehler gefunden; Kompilierung wird abgebrochen".

Kann es sein, das ich noch andere Bibliotheken brauche? Wenn ja, welche? Wenn nein, woran kann das dann liegen?

Gruß

PL1994

  • Autor

Vielen Danke schon mal für die Antwort.

Nein, die habe ich nicht vergessen - wäre ja auch zu schön gewesen ...

Entwicklungsumgebung ist Visual Studio Express 2013.

Das Folgende ist nur ein Teil des gesamten Programmes, aber ich schätze, dass das Problem da liegen müsste:

View.h


#pragma once


#define STRICT


#define EXIT_ITEM 0


#include <CommCtrl.h>

#include <windows.h>


class View

{

public:

	View();

	~View();


	void create(), hide(), show();


	const int imageListId = 0, numToolbarButtons = 4, toolbarImageSize = 48;


	HIMAGELIST hImageList;

	HMENU hMenu, hMenubar;

	HWND hWnd, hWndToolbar;

	WNDCLASS wndCls;

};

View.cpp (Wahrscheinlich irrelevant, da ich außer "include" und der Definition einer "HIMAGELIST" noch gar nichts mit der Bibliothek gemacht habe)

#include "Resources.h"

#include "View.h"


View::View()

{

	wndCls.style = CS_HREDRAW | CS_VREDRAW;

	wndCls.cbClsExtra = 0;

	wndCls.cbWndExtra = 0;

	wndCls.hInstance = GetModuleHandle(0);

	wndCls.hCursor = LoadCursor(NULL, IDC_ARROW);

	wndCls.hIcon = LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(PROGRAM_ICON));

	wndCls.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

	wndCls.lpszClassName = "Anwendung";

	wndCls.lpszMenuName = NULL;

}


View::~View()

{


}


void View::create()

{

	hWnd = CreateWindow("Anwendung", "Anwendung", WS_OVERLAPPEDWINDOW, GetSystemMetrics(SM_CXSCREEN)/2-400, GetSystemMetrics(SM_CYSCREEN)/2-300, 800, 600, NULL, NULL, GetModuleHandle(0), NULL);


	hMenu = CreateMenu();

	hMenubar = CreateMenu();


	AppendMenu(hMenu, MF_STRING, EXIT_ITEM, "Schließen");

	AppendMenu(hMenubar, MF_POPUP, (UINT_PTR)hMenu, "Datei");


	SetMenu(hWnd, hMenubar);

}


void View::hide()

{

	ShowWindow(hWnd, SW_HIDE);

	UpdateWindow(hWnd);

}


void View::show()

{

	ShowWindow(hWnd, SW_SHOW);

	UpdateWindow(hWnd);

}

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.