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.

Was ist HINSTANCE?

Empfohlene Antworten

Veröffentlicht

Guten Morgen!

Is vielleicht ne dumme Frage, aber was ist eigentlich HINSTANCE?

Und wie kann ich den Typ vergleichen?

Beispiel:


HINSTANCE test = ShellExecute( NULL, "open", "irgendwas.exe", NULL, NULL, SW_NORMAL );

if (test == ERROR_FILE_NOT_FOUND)

{

In der MSDN Library steht dass ShellExecute diese Werte zurückgibt

0 The operating system is out of memory or resources.

ERROR_FILE_NOT_FOUND The specified file was not found.

ERROR_PATH_NOT_FOUND The specified path was not found.

ERROR_BAD_FORMAT The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image).

Verstehen tu ichs aber nicht. Vielleicht kann es mir jemand erklären?

In der MSDN Library steht dass ShellExecute diese Werte zurückgibt
Und genau da steht auch folgendes:

The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an int and compare it with the value 32 or one of the error codes below.

aha :confused:

und wie geht das?

Ich habs so versucht:

int x = static_cast<int>(test);

Aber kein Erfolg:

'struct HINSTANCE__ *' kann nicht in 'int' konvertiert werden

Wie macht man das richtig?

Sorry, klingt jetzt etwas hart, aber:

Sag mal liest du die Compilerausgaben auch?

'struct HINSTANCE__ *' kann nicht in 'int' konvertiert werden

Einen Zeiger in einen int zu casten wird nie funktionieren! Nimm mal einen "int *"...

Doch. Und genau das ist hier notwendig (leider). Stichwort reinterpret_cast.

Danke Dir, so gehts :-)

aber diese HINSTANCE ist ein seltsames ding :cool:

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.