15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Bitmap in DLL

Brijesh Kumar Mishra -- brijesh@aditya.pune.gssl.ernet.in
Tuesday, September 10, 1996

	 Environment: Win95, VC++ 4.0

	 I have a DLL, having its own copy of resource. The 
	 resource comprises of a dialog box and a bitmap. The
	 dialog box has one static control to display this bitmap.
	 The Bitmap ID is assigned to this control, visible attribute
	 is set. Now from my application i loaded the dll, set the 
	 resource handle for my application to this DLL's instance 
	 using 
		AfxSetResourceHandle(HINSTNACE) 
	 and then invoked the dialog box. The diaolg box comes up but
	 the bitmap is not seen.

	 It is to note that, when the resource is in the .EXE file, all
	 is happening as it should have been. Perfectly alright. I feel
	 there is some problem in MFC - it is not able to display a bitmap
	 loaded from a DLL.

	 Any help would be highly appreciated. ThanX in advance.

	 - brij


-------------------------------------------------------------------------
	One can't change the past but one can ruin a perfectly good
	present by worrying about the future.

Brijesh Kumar Mishra
e-mail : brijeshm@gssl.ernet.in
-------------------------------------------------------------------------





David Lowndes -- David.Lowndes@bj.co.uk
Wednesday, September 11, 1996

>	 I have a DLL, having its own copy of resource. The 
>	 resource comprises of a dialog box and a bitmap. The
>	 dialog box has one static control to display this bitmap.
>	 The Bitmap ID is assigned to this control, visible attribute
>	 is set. Now from my application i loaded the dll, set the 
>	 resource handle for my application to this DLL's instance 
>	 using 
>		AfxSetResourceHandle(HINSTNACE) 
>	 and then invoked the dialog box. The diaolg box comes up but
>	 the bitmap is not seen.

If you test the dialog in the design environment, does the bitmap
display properly there?

[Moderator's note: The paragraph that followed in the original message
said that it worked fine if the bitmap was in the EXE instead of
the DLL.]

Maybe this is a situation where AfxSetResourceHandle is insufficient,
and you need to use AFX_MANAGE_STATE.




| Вернуться в корень Архива |