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.

[CLI/C++] C3767 bei OnClick-Handler

Empfohlene Antworten

Veröffentlicht

Hi :)

Ich erzeuge zur Laufzeit neue Instanzen einer Form, und möchte beim Click auf einen Button aus der Instanz eine Methode aus meiner Main-Form aufrufen, kann also nur zur Laufzeit einen neuen Handler hinzufügen. Mein bisheriger Code sieht so aus:


	private:

		void ButtonNo_Click(System::Object^  sender, System::EventArgs^  e)

		{

			// verschiedene Anweisungen

		}

und:

   DYNWindow->ButtonNo->OnClick(gcnew System::EventHandler(this, &Form1::ButtonNo_Click));

Beim compilen bekomme ich allerdings immer folgenden Fehler:

error C3767: "System::Windows::Forms::Button::OnClick": Auf mögliche Funktion(en) kann nicht zugegriffen werden.

Falls jemand eine Lösung parat hat, oder sogar eine einfachere Lösung hat, bitte posten =)

Danke fürs Lesen ;)

-- _41L_2_0pHt3N

Moin.

[...] Mein bisheriger Code sieht so aus:


	[COLOR="#ff0000"]private:[/COLOR]

		void ButtonNo_Click(System::Object^  sender, System::EventArgs^  e)

		{

			// verschiedene Anweisungen

		}

und:

   DYNWindow->ButtonNo->OnClick(gcnew System::EventHandler(this, [COLOR="Red"]&Form1::ButtonNo_Click[/COLOR]));

Beim compilen bekomme ich allerdings immer folgenden Fehler:

error C3767: "System::Windows::Forms::Button::OnClick": Auf mögliche Funktion(en) [COLOR="Red"]kann nicht zugegriffen[/COLOR] werden.

Falls jemand eine Lösung parat hat, oder sogar eine einfachere Lösung hat, bitte posten =)

Danke fürs Lesen ;)

-- _41L_2_0pHt3N

Dir ist schon klar, daß man nicht einfach so auf private-Funktionen von außen zugreifen kann? :mod:

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.