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.

[C#] Probleme mit Pinvoke (Stabel ist gstört..)

Empfohlene Antworten

Veröffentlicht

Hi,

ich verzweifle grade an einem Pinvoke und hab schon diverse Dinge ausprobiert.

Aktuell sieht das so aus.

Funktion aus der dll die Invoked werden soll:


extern "C" __declspec(dllexport) HBITMAP GetSubRect(int x, int y, int witdh, int height)

{

//ein paar Dinge...

}

Das ist der letzte stand der C# Signatur. Die auch Fehlschlägt...

        private static extern IntPtr GetSubRect([MarshalAs(UnmanagedType.I4)] int x,

                                                                 [MarshalAs(UnmanagedType.I4)] int y,

                                                                 [MarshalAs(UnmanagedType.I4)] int witdh,

                                                                 [MarshalAs(UnmanagedType.I4)] int height);

Der Fehler der beim Aufruf auftritt sieht wie folgt aus:

Ein Aufruf an die PInvoke-Funktion "Invoketest!Invoketest.Form1::GetSubRect" hat das Gleichgewicht des Stapels gestört. Wahrscheinlich stimmt die verwaltete PInvoke-Signatur nicht mit der nicht verwalteten Zielsignatur überein. Überprüfen Sie, ob die Aufrufkonvention und die Parameter der PInvoke-Signatur mit der nicht verwalteten Zielsignatur übereinstimmen.

Leider mach ich das verhältnismäßig selten und kenne mich daher nicht so gut aus.

Sieht einer von euch den Fehler?

lg

Gateway

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.