本文介绍了使用线程我无法将.jpg图像显示给文本控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我在基于对话框的应用程序中创建线程,其中我在线程中调用一个函数,该函数应将.jpg图像显示给静态文本控件.但是我无法在使用线程的静态文本控件上显示它.我在以下代码中犯了什么错误,

无效Fun()
{
CreateThread(0,0,myThread,&myCounter,0,NULL);
}

DWORD WINAPI myThread(LPVOID lpParameter)
{
unsigned int&myCounter = *(((unsigned int *)lpParameter);
CRecognitionDlg * pDlg =(CRecognitionDlg *)lpParameter;
pDlg-> PictureCount = 0;
pDlg-> iCount = 0;
while(myCounter< 0xFFFFFFFF)
{
pDlg-> ShowFacesForEnrollement();
如果(pDlg-> sFlag == FALSE)
{
休息;
}
}

CloseHandle(myHandle);

返回0;
}
CPictureCtrl m_pFaceImages;
无效dlg ShowFacesForEnrollement()
{
m_pFaceImages.Load(CString(_T("Normal.jpg")));
}

在上面我做错了的代码中,任何人都可以帮帮我.

预先感谢.

Hello,

I am Crating a thread in dialog based application where i am calling a function in the thread which should display the .jpg image to the static text control. but i am unable to display it on the static text control using thread. what is mistake i am doing in the below code,

void Fun()
{
CreateThread(0, 0, myThread, &myCounter, 0, NULL);
}

DWORD WINAPI myThread(LPVOID lpParameter)
{
unsigned int& myCounter = *((unsigned int*)lpParameter);
CRecognitionDlg* pDlg = (CRecognitionDlg*)lpParameter;
pDlg->PictureCount = 0;
pDlg->iCount = 0;
while(myCounter < 0xFFFFFFFF)
{
pDlg->ShowFacesForEnrollement();
if (pDlg->sFlag == FALSE)
{
break;
}
}

CloseHandle(myHandle);

return 0;
}
CPictureCtrl m_pFaceImages;
void dlg ShowFacesForEnrollement()
{
m_pFaceImages.Load(CString(_T("Normal.jpg")));
}

in the above code where i am doing wrong can anyone help me out.

Thanks in advance.

推荐答案


这篇关于使用线程我无法将.jpg图像显示给文本控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 22:19