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

Hi,

kann mir einer vielleicht sagen warum ich jedesmal wenn ich die Funktion

ChooseColor() aufrufe, eine Access Violation bekommme und das Programm

abstürzt?


COLORREF rgbColor=RGB(0,0,0);
CHOOSECOLOR cc;

memset(&cc,0,sizeof(CHOOSECOLOR));
cc.lStructSize = sizeof(CHOOSECOLOR);
cc.hwndOwner = hMainWindow;
cc.Flags = CC_FULLOPEN;
cc.rgbResult = rgbColor;

ChooseColor(&cc);
[/PHP]

Gruß

Guybrush

  • Autor

Woher weißt du das denn? In der msdn steht das nämlich nicht.

Es geht aber trotzdem nicht.


COLORREF rgbCust[16];

for (int i=0; i<16; i++)
rgbCust[i] = RGB(0,0,0);
[/PHP]

Bei der Zuweisung akzeptiert der Compiler das Array irgendwie nur wenn ich

ein * davor setzte, aber die Adresse würde doch ohne übergeben werden, oder?

[PHP]
cc.lCustData = *rgbCust;

Die Acces Violation tritt trotzdem auf.

Original geschrieben von Guybrush Threepwood

Woher weißt du das denn? In der msdn steht das nämlich nicht.

lpCustColors

Pointer to an array of 16 COLORREF values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values. To preserve new custom colors between calls to the ChooseColor function, you should allocate static memory for the array.

Da steht nicht, dass das NULL sein darf. Übrigens war meine Info falsch, den Array musst du immer mit angeben, nicht nur bei CC_FULLOPEN.

cc.lCustData = *rgbCust;

lpCustColors, nicht lCustData ;)

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.