Why do you want to set a palette? With 16 bit screen depths, you don't set palettes directly with LoadRGB32(), as you don't get any change on screen until the new colours you've set are actually used (unlike on 8 bit or less screens, where the whole display updates immediately).
If you want to use pens, use ObtainPen() and make your own local palette that way, for example:
WORD mypal[ numcolours ];
...
for( i=0; i{
mypal[ i ] = ObtainBestPen( r, g, b, TAG_DONE );
}
... use your palette here, e.g. SetAPen( win->RPort, mypal[ col ] ) ...
for( i=0; i{
if( mypal > -1 ) ReleasePen( mypal;
}
Alternatively, do all your graphics directly in highcolour, and you don't need to set any palettes or use any pens. The only restriction is that (AFAIK) P96 and cybergraphics offer no way to use graphics.library/Text() with an arbitary highcolour value (ie, you need to get a pen for text).