Click here to Skip to main content
15,909,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDSN doesn't show up in Data Source Admin Pin
Craig Miller23-Apr-02 7:39
Craig Miller23-Apr-02 7:39 
GeneralSearch binary file fro string Pin
Xtorpia23-Apr-02 7:08
Xtorpia23-Apr-02 7:08 
GeneralRe: Search binary file fro string Pin
Bill Wilson23-Apr-02 7:24
Bill Wilson23-Apr-02 7:24 
GeneralRe: Search binary file fro string Pin
Albert Pascual23-Apr-02 7:37
sitebuilderAlbert Pascual23-Apr-02 7:37 
GeneralCharacter sets Pin
albean23-Apr-02 6:50
albean23-Apr-02 6:50 
GeneralRe: Character sets Pin
jbarton23-Apr-02 7:19
jbarton23-Apr-02 7:19 
GeneralCToolBar VS CToolBarCtrl Pin
dazinith23-Apr-02 6:22
dazinith23-Apr-02 6:22 
GeneralRe: CToolBar VS CToolBarCtrl Pin
Shog923-Apr-02 8:35
sitebuilderShog923-Apr-02 8:35 
If all you want is more than 16 colors, that is easily possible with the normal MFC toolbar support. Here is the process:

  1. Create the toolbar normally in the resource editor
  2. Edit the toolbar bitmap manually, converting it to high color
  3. The bitmap will be converted to 16 colors by MFC when it is loaded, so you will use the following code (nResourceId is the toolbar resource identifier, and m_toolbar is the CToolBar object):
    // load bitmap first, to prevent unwanted color conversion.
    HBITMAP hBmp = static_cast<HBITMAP>(LoadImage(AfxGetResourceHandle(),
    MAKEINTRESOURCE(nResourceId), IMAGE_BITMAP,
    0, 0, LR_SHARED | LR_LOADMAP3DCOLORS));
    
    // use default toolbar loading code
    m_toolbar.LoadToolBar(nResourceId);
    
    // set the bitmap, which can now contain more than 16 colors.
    m_toolbar.SetBitmap(hBmp);
    

Smile | :)

--------

And we die young.
Faster we run.

Alice in Chains, We Die Young


GeneralRe: CToolBar VS CToolBarCtrl Pin
dazinith24-Apr-02 4:20
dazinith24-Apr-02 4:20 
GeneralCreate CScrollBar into the CEdit Pin
Eugene Pustovoyt23-Apr-02 6:18
Eugene Pustovoyt23-Apr-02 6:18 
GeneralRe: Create CScrollBar into the CEdit Pin
Roger Allen23-Apr-02 6:42
Roger Allen23-Apr-02 6:42 
GeneralRe: Create CScrollBar into the CEdit Pin
Eugene Pustovoyt23-Apr-02 9:18
Eugene Pustovoyt23-Apr-02 9:18 
GeneralRe: Create CScrollBar into the CEdit Pin
Roger Allen23-Apr-02 21:38
Roger Allen23-Apr-02 21:38 
GeneralRe: Create CScrollBar into the CEdit Pin
Eugene Pustovoyt24-Apr-02 7:58
Eugene Pustovoyt24-Apr-02 7:58 
GeneralRe: Create CScrollBar into the CEdit Pin
Ravi Bhavnani24-Apr-02 8:06
professionalRavi Bhavnani24-Apr-02 8:06 
Questionhoow to owner draw controls? Pin
DiegoValdevino23-Apr-02 5:36
DiegoValdevino23-Apr-02 5:36 
AnswerRe: hoow to owner draw controls? Pin
Mazdak23-Apr-02 5:40
Mazdak23-Apr-02 5:40 
AnswerRe: hoow to owner draw controls? Pin
Thomas Freudenberg23-Apr-02 5:55
Thomas Freudenberg23-Apr-02 5:55 
QuestionIncrement an int value in a char array? Pin
23-Apr-02 5:33
suss23-Apr-02 5:33 
AnswerRe: Increment an int value in a char array? Pin
Tim Smith23-Apr-02 5:55
Tim Smith23-Apr-02 5:55 
GeneralRe: Increment an int value in a char array? Pin
23-Apr-02 7:10
suss23-Apr-02 7:10 
GeneralUser defined Message Pin
act_x23-Apr-02 5:19
act_x23-Apr-02 5:19 
GeneralTransparent windows. Pin
23-Apr-02 5:11
suss23-Apr-02 5:11 
GeneralRe: Transparent windows. Pin
Paul M Watt23-Apr-02 5:20
mentorPaul M Watt23-Apr-02 5:20 
GeneralRe: Transparent windows. Pin
23-Apr-02 5:27
suss23-Apr-02 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.