Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:30
Mark Salsbery22-Jun-07 13:30 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 13:40
sstainba22-Jun-07 13:40 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:54
Mark Salsbery22-Jun-07 13:54 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 14:13
sstainba22-Jun-07 14:13 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 14:23
Mark Salsbery22-Jun-07 14:23 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 14:29
Mark Salsbery22-Jun-07 14:29 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 15:05
sstainba22-Jun-07 15:05 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 7:30
Mark Salsbery23-Jun-07 7:30 
sstainba wrote:
I tried asking this questiong on CodeGuru and this one guy was acting like I was an idiot for even thinking such a thing could be done.


Laugh | :laugh: Yeah - I was pretty much called stupid for asking a question on the Microsoft boards the
first time I went there. Geez, if you're tired of answering "stupid" questions then don't answer!
I personally believe the only stupid question is one that isn't asked (I don't know where I heard
that....maybe read it on a Starbucks cup or something Laugh | :laugh: )

sstainba wrote:
He said that the resource name wasn't stored in the dll file (WTF?).


I wonder how he thought resources were located Smile | :)

sstainba wrote:
PS. I don't suppose you know how to get a CToolTipCtrl to work do you? I followed the MSDN but it never shows up...


For a dialog window, right? I'll steal an example right from the MFC sample code:
// Add this to the dialog class' message map
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
...
// Add this to OnInitDialog(), after the base class OnInitDialog() is called
EnableToolTips(TRUE);
...
// Add the OnToolTipNotify() handler to the dialog class...
 
// In the .h file
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR * pNotifyStruct, LRESULT * result);
...
// In the .cpp file
BOOL CMyDlg::OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
   // need to handle both ANSI and UNICODE versions of the message
   TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
   TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
   CStringA strTipText;
   UINT nID = pNMHDR->idFrom;
   if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
      pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
   {
      // idFrom is actually the HWND of the tool
      nID = ::GetDlgCtrlID((HWND)nID);
   }
 
   if (nID != 0) // will be zero on a separator
      strTipText.Format("Control ID = %d", nID);
 
   if (pNMHDR->code == TTN_NEEDTEXTA)
      strncpy(pTTTA->szText, strTipText, sizeof(pTTTA->szText));
   else
      ::MultiByteToWideChar( CP_ACP , 0, strTipText, -1, pTTTW->szText, sizeof(pTTTW->szText) );
   *pResult = 0;
 
   return TRUE;    // message was handled
}

Note that this just shows a normal tooltip with text "Control ID = xxxx". You'd probably want to
map the control ID to a meaningful string.

Cheers Beer | [beer]
Mark


"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski

GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 7:47
Mark Salsbery23-Jun-07 7:47 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba23-Jun-07 11:27
sstainba23-Jun-07 11:27 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 13:51
Mark Salsbery23-Jun-07 13:51 
QuestionQuestion About Serial Port in Visual C++ 2005 Pin
Jason Daniel Cohn22-Jun-07 9:35
Jason Daniel Cohn22-Jun-07 9:35 
AnswerRe: Question About Serial Port in Visual C++ 2005 Pin
SimplCodr22-Jun-07 10:15
SimplCodr22-Jun-07 10:15 
QuestionPrint from buffer Pin
dellthinker22-Jun-07 8:15
dellthinker22-Jun-07 8:15 
AnswerRe: Print from buffer Pin
David Crow22-Jun-07 8:43
David Crow22-Jun-07 8:43 
GeneralRe: Print from buffer Pin
dellthinker22-Jun-07 9:07
dellthinker22-Jun-07 9:07 
GeneralRe: Print from buffer Pin
David Crow22-Jun-07 10:17
David Crow22-Jun-07 10:17 
Questionin hash tables Pin
mido++22-Jun-07 8:06
mido++22-Jun-07 8:06 
QuestionBase and derived classes Pin
ForNow22-Jun-07 6:32
ForNow22-Jun-07 6:32 
AnswerRe: Base and derived classes Pin
Mark Salsbery22-Jun-07 7:34
Mark Salsbery22-Jun-07 7:34 
AnswerRe: Base and derived classes Pin
David Crow22-Jun-07 8:56
David Crow22-Jun-07 8:56 
GeneralRe: Base and derived classes Pin
ForNow22-Jun-07 12:13
ForNow22-Jun-07 12:13 
GeneralRe: Base and derived classes Pin
David Crow30-Jun-07 8:26
David Crow30-Jun-07 8:26 
GeneralRe: Base and derived classes Pin
ForNow30-Jun-07 15:47
ForNow30-Jun-07 15:47 
QuestionDoes a CListCtrl accepts a member variable name in edit mode? Pin
Arris7422-Jun-07 5:37
Arris7422-Jun-07 5:37 

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.