After the application has created the LOGPALETTE structure, the next step is to create a logical palette by calling the CreatePalette function:
hPal = CreatePalette((LPSTR) pLogPal);
CreatePalette accepts a long pointer to the LOGPALETTE structure as its only parameter and returns a handle of the palette (HPALETTE).