home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1706 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.6 KB  |  53 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!sun-barr!ames!kum.kaist.ac.kr!usenet
  3. From: hichoi@dbserver.kaist.ac.kr (Hwan-Ik Choi)
  4. Subject: Return value of RealizePalette() ??
  5. Message-ID: <1992Sep7.085852.4767@kum.kaist.ac.kr>
  6. Sender: usenet@kum.kaist.ac.kr (news)
  7. Organization: KAIST
  8. X-Newsreader: Tin 1.1 PL5
  9. Date: Mon, 7 Sep 92 08:58:52 GMT
  10. Lines: 41
  11.  
  12.  
  13. hi netters,
  14. I've tried to create my own color palette and use it in my applications. But
  15. when I tried to use it, ``RealizePalette()'' always returns ``NULL''.
  16.  
  17. The situation is:
  18.  
  19.     // Create Palette
  20.     hgPal = CreatePalette(....);        // no errors found
  21.  
  22.     // now do my job
  23.     hDC = GetDC(hWnd);
  24.     if( (hOldPalette = SelectPalette(hDC, hgPal, 0)) == NULL)
  25.     { // Never fall in this block    :)
  26.         ...    
  27.     }
  28.  
  29.     if (RealizePalette(hDC)==NULL)        // ???????
  30.     { // Always fall in this block  :(
  31.  
  32.     }
  33. Although ``RealizePalette'' returns an error, there are no anomolies in its
  34. execution. Is the return value of ``RealizePalette'' meaningless?
  35.  
  36. I have test the sample program in SDK (palette.c) and found that sample
  37. program also returns an error in ``RealizePalette'' whenever I resize 
  38. the window. (you can try this by parsing the return value of 
  39. ``RealizePalette'' in sample program).
  40.  
  41.  
  42. What's the my missing point?
  43.  
  44. ///////////////////////////////////////////////////////////////////////////////
  45. /    Hwan Ik, Choi                            e_mail: hichoi@dbserver.kaist.ac.kr
  46. /                                            02-42-869-3563
  47. /    Computer Science Dept., 
  48. -    Korea Advanced Institute of Science and Technology,
  49. \    373-1 Kusung-dong Yusong-gu Daejeon 305-701
  50. \    Korea
  51. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  52.  
  53.