Click here to Skip to main content
15,568,455 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can a modeless dialog box be a main window Pin
ForNow30-Jan-13 8:31
ForNow30-Jan-13 8:31 
QuestionAnyone heard of an Anonymous Statistics / User Experience API or Toolkit Pin
Blake Miller29-Jan-13 7:11
Blake Miller29-Jan-13 7:11 
QuestionHow to load a png image in PictureControl? Pin
VCProgrammer29-Jan-13 2:41
VCProgrammer29-Jan-13 2:41 
QuestionRe: How to load a png image in PictureControl? Pin
Richard MacCutchan29-Jan-13 4:33
mveRichard MacCutchan29-Jan-13 4:33 
AnswerRe: How to load a png image in PictureControl? Pin
yu-jian29-Jan-13 16:40
yu-jian29-Jan-13 16:40 
GeneralRe: How to load a png image in PictureControl? Pin
VCProgrammer30-Jan-13 23:19
VCProgrammer30-Jan-13 23:19 
GeneralRe: How to load a png image in PictureControl? Pin
yu-jian1-Feb-13 5:04
yu-jian1-Feb-13 5:04 
GeneralRe: How to load a png image in PictureControl? Pin
VCProgrammer4-Feb-13 2:24
VCProgrammer4-Feb-13 2:24 
LPCTSTR szResourceName =MAKEINTRESOURCE(IDB_PNG1);
	LPCTSTR szResourceType=_T("PNG");
	HMODULE hresModule=AfxGetResourceHandle(); 

	HRSRC hPicture = FindResource(hresModule,szResourceName,szResourceType);
	HGLOBAL hResData;

	// Load the dialog box into global memory.
	if (!hPicture || !(hResData = LoadResource(hresModule,hPicture)))
	{
		TRACE(_T("Load (resource): Error loading resource %s\n"),szResourceName);
		return ;
	};
	DWORD dwSize = SizeofResource(hresModule,hPicture);	

	// hResData is not the real HGLOBAL (we can't lock it)
	// let's make it real

	HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD,dwSize);
	if (!hGlobal)
	{
		TRACE(_T("Load (resource): Error allocating memory\n"));
		FreeResource(hResData);
		return ;
	};
	
	char *pDest = reinterpret_cast<char *> (GlobalLock(hGlobal));
	char *pSrc = reinterpret_cast<char *> (LockResource(hResData));
	if (!pSrc || !pDest)
	{
		TRACE(_T("Load (resource): Error locking memory\n"));
		GlobalFree(hGlobal);
		FreeResource(hResData);
		return  ;
	};

	//IStream* pStream;
	ULONG ulWritten=0;
	ulWritten = 0;

	CopyMemory(pDest,pSrc,dwSize);

	HRESULT hr = ::CreateStreamOnHGlobal(hGlobal,FALSE,&pStream);
	pStream->Write(pDest, dwSize, &ulWritten);

	FreeResource(hResData);
	GlobalUnlock(hGlobal);

	Bitmap oBmp(pStream,0);

  	m_Image_ics.Load(pStream);
	HDC memdc;
	CRect rect;
	this->GetClientRect(&rect);     
	//=====
	HBITMAP hBmp;
	oBmp.GetHBITMAP(0, &hBmp);
	::SendMessage(png_bnr->GetSafeHwnd(),STM_SETIMAGE,IMAGE_BITMAP,(LPARAM)hBmp);

QuestionIn win7 ,how to modify registry with Non - administrator permission Pin
haha_c28-Jan-13 22:08
haha_c28-Jan-13 22:08 
AnswerRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt28-Jan-13 22:38
professionalJochen Arndt28-Jan-13 22:38 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
haha_c28-Jan-13 23:02
haha_c28-Jan-13 23:02 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt28-Jan-13 23:57
professionalJochen Arndt28-Jan-13 23:57 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
haha_c29-Jan-13 0:18
haha_c29-Jan-13 0:18 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt29-Jan-13 0:33
professionalJochen Arndt29-Jan-13 0:33 
QuestionGet CBitmap from CDib Pin
_Flaviu28-Jan-13 21:30
_Flaviu28-Jan-13 21:30 
AnswerRe: Get CBitmap from CDib Pin
Jochen Arndt28-Jan-13 22:31
professionalJochen Arndt28-Jan-13 22:31 
QuestionAbout virtual function Pin
EhtishamArshad28-Jan-13 20:40
EhtishamArshad28-Jan-13 20:40 
AnswerRe: About virtual function Pin
Jibesh28-Jan-13 20:51
professionalJibesh28-Jan-13 20:51 
GeneralRe: About virtual function Pin
EhtishamArshad28-Jan-13 23:32
EhtishamArshad28-Jan-13 23:32 
AnswerRe: About virtual function Pin
Richard MacCutchan28-Jan-13 23:48
mveRichard MacCutchan28-Jan-13 23:48 
Questionwhere can download comment macro? Pin
yu-jian28-Jan-13 16:36
yu-jian28-Jan-13 16:36 
AnswerRe: where can download comment macro? Pin
Jibesh28-Jan-13 20:48
professionalJibesh28-Jan-13 20:48 
QuestionFilter the EN_KILLFOCUS message from CIPAddressCtrl Pin
zhangyoung28-Jan-13 15:53
zhangyoung28-Jan-13 15:53 
AnswerRe: Filter the EN_KILLFOCUS message from CIPAddressCtrl Pin
Code-o-mat28-Jan-13 23:27
Code-o-mat28-Jan-13 23:27 
GeneralRe: Filter the EN_KILLFOCUS message from CIPAddressCtrl Pin
zhangyoung29-Jan-13 4:04
zhangyoung29-Jan-13 4:04 

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.