Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMenu Bar Button Pin
shakumar_2222-Jun-08 20:23
shakumar_2222-Jun-08 20:23 
AnswerRe: Menu Bar Button Pin
ThatsAlok23-Jun-08 1:06
ThatsAlok23-Jun-08 1:06 
AnswerRe: Menu Bar Button Pin
Hamid_RT23-Jun-08 18:26
Hamid_RT23-Jun-08 18:26 
QuestionDisplaying Jpeg Image in MFC Pin
Shivarudrayya H22-Jun-08 20:06
Shivarudrayya H22-Jun-08 20:06 
AnswerRe: Displaying Jpeg Image in MFC Pin
SandipG 22-Jun-08 20:38
SandipG 22-Jun-08 20:38 
AnswerRe: Displaying Jpeg Image in MFC Pin
Hamid_RT23-Jun-08 18:22
Hamid_RT23-Jun-08 18:22 
QuestionUse of Check box in TreeCtrl. Pin
Le@rner22-Jun-08 19:08
Le@rner22-Jun-08 19:08 
QuestionSharing a HBITMAP between 2 applications [modified] Pin
Llasus22-Jun-08 18:41
Llasus22-Jun-08 18:41 
Hello and good day. I have 2 applications wherein I want the 1st which creates a graph send its image to the 2nd which will display it. I searched for some ways and ended up using a MFC shared DLL wherein I have a HBITMAP which the 1st one will write image on, and the 2nd one will read (using WM_COPYDATA for signalling, and mutex for synch). It's declared as the ff:
#pragma bss_seg("MFCDLLSample")
	TESTDLL_API HBITMAP DLLImageBmp;
#pragma bss_seg()

Now, I checked first if it works by having the 1st app make a graph then display it on another picture box (same app) and it actually worked. When I tried to display it in the 2nd, it does not display. I coded it like this in the 2nd app:
//obtain the CDC handle for the picture box
PicWnd = GetDlgItem(IDC_PICBOX);
PicDC  = PicWnd->GetDC();

oldBmp = (HBITMAP)PicDC->SelectObject(DLLImageBmp);

PicPaintDC.BitBlt(0, 0, 404, 404, PicDC, 0, 0, SRCCOPY);
CDialog::OnPaint();

Can anyone help me out with this? I really need to know what might be wrong with my code or implementation.

Thank you in advance for the help and time!

--added contents:
I forgot, TESTDLL_API's definition is this:
#ifdef TESTDLL_EXPORTS
#define TESTDLL_API __declspec(dllexport)
#else
#define TESTDLL_API __declspec(dllimport)
#endif


Thanks again!

modified on Monday, June 23, 2008 12:48 AM

AnswerRe: Sharing a HBITMAP between 2 applications Pin
Naveen22-Jun-08 19:09
Naveen22-Jun-08 19:09 
GeneralRe: Sharing a HBITMAP between 2 applications Pin
Llasus22-Jun-08 19:30
Llasus22-Jun-08 19:30 
GeneralRe: Sharing a HBITMAP between 2 applications[modified] Pin
Naveen22-Jun-08 19:55
Naveen22-Jun-08 19:55 
GeneralRe: Sharing a HBITMAP between 2 application Pin
Llasus22-Jun-08 20:12
Llasus22-Jun-08 20:12 
GeneralRe: Sharing a HBITMAP between 2 application Pin
SandipG 22-Jun-08 20:32
SandipG 22-Jun-08 20:32 
GeneralRe: Sharing a HBITMAP between 2 application Pin
Llasus22-Jun-08 20:47
Llasus22-Jun-08 20:47 
GeneralRe: Sharing a HBITMAP between 2 application Pin
SandipG 22-Jun-08 20:33
SandipG 22-Jun-08 20:33 
GeneralRe: Sharing a HBITMAP between 2 application Pin
Naveen22-Jun-08 20:55
Naveen22-Jun-08 20:55 
AnswerRe: Sharing a HBITMAP between 2 applications Pin
Hamid_RT23-Jun-08 18:21
Hamid_RT23-Jun-08 18:21 
GeneralRe: Sharing a HBITMAP between 2 applications Pin
Llasus24-Jun-08 20:25
Llasus24-Jun-08 20:25 
Questionbizarre problem with files Pin
lahom22-Jun-08 17:25
lahom22-Jun-08 17:25 
AnswerRe: bizarre problem with files [modified] Pin
Saurabh.Garg22-Jun-08 17:58
Saurabh.Garg22-Jun-08 17:58 
GeneralRe: bizarre problem with files Pin
lahom23-Jun-08 6:08
lahom23-Jun-08 6:08 
GeneralRe: bizarre problem with files Pin
Saurabh.Garg23-Jun-08 14:39
Saurabh.Garg23-Jun-08 14:39 
AnswerRe: bizarre problem with files Pin
CPallini23-Jun-08 0:24
mveCPallini23-Jun-08 0:24 
GeneralRe: bizarre problem with files Pin
lahom23-Jun-08 6:10
lahom23-Jun-08 6:10 
GeneralRe: bizarre problem with files Pin
CPallini23-Jun-08 6:42
mveCPallini23-Jun-08 6:42 

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.