Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Excel automation from a worker thread Pin
CPallini1-Feb-07 10:39
mveCPallini1-Feb-07 10:39 
GeneralRe: Excel automation from a worker thread Pin
led mike1-Feb-07 11:07
led mike1-Feb-07 11:07 
GeneralRe: Excel automation from a worker thread Pin
BuckBrown1-Feb-07 12:10
BuckBrown1-Feb-07 12:10 
AnswerRe: Excel automation from a worker thread Pin
Jörgen Sigvardsson1-Feb-07 10:47
Jörgen Sigvardsson1-Feb-07 10:47 
GeneralRe: Excel automation from a worker thread Pin
BuckBrown1-Feb-07 12:09
BuckBrown1-Feb-07 12:09 
AnswerRe: Excel automation from a worker thread Pin
Roger Stoltz1-Feb-07 11:11
Roger Stoltz1-Feb-07 11:11 
GeneralRe: Excel automation from a worker thread Pin
BuckBrown1-Feb-07 12:10
BuckBrown1-Feb-07 12:10 
QuestionCommunicating dialog boxes Pin
kitty51-Feb-07 7:57
kitty51-Feb-07 7:57 
I've created 2 classes each with it's own dialog box in an MDI application
1. commanding class
2. picViewer class

the commanding class has a func load().
where i create a picViewer variable.
<br />
void commanding::load()<br />
{<br />
	UpdateData (TRUE);<br />
<br />
	FILE *pic, *pic1, *pic2;<br />
	picViewer cam1;	<br />
        pic = fopen("C:\\cv\\16bit.jp2", "rb");<br />
	pic1 = fopen("C:\\cv\\nature_50.jp2", "rb");<br />
	pic2 = fopen("C:\\cv\\8_8.jp2", "rb");<br />
	unsigned int numRead;<br />
	<br />
	int i = 0;<br />
	while(i < 3)<br />
	{<br />
		if(i == 0)<br />
			numRead = fread(buff, sizeof(BYTE), 100000, pic);<br />
		else if(i == 1)<br />
			numRead = fread(buff, sizeof(BYTE), 100000, pic1);<br />
		else<br />
			numRead = fread(buff, sizeof(BYTE), 100000, pic2);<br />
		cam1.showPicture(buff,numRead);<br />
		i++;<br />
		Sleep(2000);<br />
	}<br />
<br />
	fclose(pic);<br />
	fclose(pic1);<br />
	fclose(pic2);<br />
	UpdateData (FALSE);<br />
}<br />
<br />
the picViewer class has a func show().
<br />
void picViewer::show(BYTE bfr[], DWORD size)<br />
{<br />
	HBITMAP m_bitmap = NULL;<br />
	CImage image;<br />
	CJpeg2kDecoder imDec;<br />
	<br />
	image = imDec.Open(bfr, size);<br />
	m_bitmap = (HBITMAP)image;<br />
	m_nCam1img.SetBitmap(m_bitmap); <br />
        //m_nCam1img is the var of the picture control in the dialog <br />
        //box to show the bitmap image.<br />
}<br />

whenever I run the application i open up both dialog boxes hit run on the commanding dialog box i get an error when i get to "m_nCam1img.SetBitmap(m_bitmap); " which points to:
<br />
_AFXWIN_INLINE HBITMAP CStatic::SetBitmap(HBITMAP hBitmap)<br />
	{ ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }<br />

in afxwin2.inl
what does that mean? what am i doing wrong? what would i need to do in order to show a picture in a separate dialog box?

thanks!

Kitty5

AnswerRe: Communicating dialog boxes Pin
led mike1-Feb-07 8:19
led mike1-Feb-07 8:19 
GeneralRe: Communicating dialog boxes [modified] Pin
kitty51-Feb-07 8:30
kitty51-Feb-07 8:30 
GeneralRe: Communicating dialog boxes Pin
led mike1-Feb-07 8:41
led mike1-Feb-07 8:41 
GeneralRe: Communicating dialog boxes Pin
kitty51-Feb-07 8:50
kitty51-Feb-07 8:50 
GeneralRe: Communicating dialog boxes Pin
led mike1-Feb-07 9:01
led mike1-Feb-07 9:01 
GeneralRe: Communicating dialog boxes Pin
Mark Salsbery1-Feb-07 11:39
Mark Salsbery1-Feb-07 11:39 
AnswerRe: Communicating dialog boxes Pin
Hamid_RT1-Feb-07 21:20
Hamid_RT1-Feb-07 21:20 
GeneralRe: Communicating dialog boxes Pin
kitty52-Feb-07 2:33
kitty52-Feb-07 2:33 
GeneralRe: Communicating dialog boxes Pin
Hamid_RT2-Feb-07 4:32
Hamid_RT2-Feb-07 4:32 
QuestionDeclaration of CSemaphore fails Pin
BuckBrown1-Feb-07 7:57
BuckBrown1-Feb-07 7:57 
AnswerRe: Declaration of CSemaphore fails Pin
led mike1-Feb-07 8:06
led mike1-Feb-07 8:06 
GeneralRe: Declaration of CSemaphore fails Pin
BuckBrown1-Feb-07 8:21
BuckBrown1-Feb-07 8:21 
GeneralRe: Declaration of CSemaphore fails Pin
led mike1-Feb-07 8:44
led mike1-Feb-07 8:44 
GeneralRe: Declaration of CSemaphore fails Pin
BuckBrown1-Feb-07 9:32
BuckBrown1-Feb-07 9:32 
GeneralRe: Declaration of CSemaphore fails Pin
Zac Howland1-Feb-07 9:31
Zac Howland1-Feb-07 9:31 
GeneralRe: Declaration of CSemaphore fails Pin
BuckBrown1-Feb-07 12:19
BuckBrown1-Feb-07 12:19 
Questionfatal error C1083: Cannot open include file: 'X11/Xlib.h' Pin
Khoramdin1-Feb-07 6:09
Khoramdin1-Feb-07 6:09 

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.