|
I am using following code to set the picture(.bmp File) in Picture control. But not getting any picture in picture control.
HBITMAP hBitmap = LoadBitmap(hInst,(LPCWSTR)IDB_BITMAP1);
HWND hWndStatic = GetDlgItem(hWndDlg,IDC_pic);
SetWindowLong(hWndStatic,GWL_STYLE,GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON);
SendMessage(hWndStatic,STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap);
Please help me. Thnx in advance ..
|
|
|
|
|
:-D1.if it is NOT mandatory for you to load it in runtime(through code), then, you can map it statically from the properties box of the control.
:-D2.to load it through code, even i have put more efforts but in vain.
:-D3.so at last, i had to design my own active X control to load an image dynamically. but here, i had to provide the path of the bmp say, "c:\\images\\bitmap1". that was ok for me to fulfil my requirement.
:-D4.if this is ok for you, then i dont mind to share that control(.ocx) with you. but keep in touch through my email id, for me to forward it.
:-D5.it would be great, if anybody answers this question, such that, i can use that logic in most of my future programs.
gudluck.
|
|
|
|
|
This line is totally wrong
SetWindowLong(hWndStatic,GWL_STYLE,GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON); refer the definitions of the Static Control Constants in WinUser.h
#define SS_BITMAP 0x0000000E
#define SS_ICON 0x00000003
#define SS_ENHMETAFILE 0x0000000F
#define SS_TYPEMASK 0x0000001F
so by using (GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON) you are actually setting the style to SS_ENHMETAFILE. use ((GetWindowLong(hWndStatic,GWL_STYLE) & ~SS_TYPEMASK) | SS_BITMAP) instead.
also shouldnt it be MAKEINTRESOURCE(IDB_BITMAP1) and not (LPCWSTR)IDB_BITMAP1 ?
|
|
|
|
|
Hi Guys
I want to stop USB Bluetooth deviceso how can it be possible to stop.
with Regards
RYK
|
|
|
|
|
VC_RYK wrote: I want to stop USB Bluetooth device...
Stop them from what? If you mean disabling, see here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
pls check CM_Request_Device_EjectW()
Ajay
|
|
|
|
|
hi,
u can disable the usb devices, while changing the registry values
the follwing location have the usb device service set to 3.by changing that value 3 to 4. u can desiable the usb device.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor and double click on "start" word it will show value 3 then u can edit.
this implementation can be done through regstry api which is provided by vc++
ram
Continues learner
|
|
|
|
|
Hello,
My MSDN files are affected when I downloaded new version of internet explorer.
When I press F1 I get the message saying "One or more ActiveX controls could not be displayed"
My MSDN files are now HTML files .
What Should I do to revert them back?
Thanks
Prithaa
|
|
|
|
|
try uninstalling your new internet explorer or reinstalling the msdn and see.
or better put this post in the OS and system admin forum.
gud luck.
|
|
|
|
|
Hi All,
I add tab control on the window area(Not on DialogBox). Which function of CFrameWnd class needs to be override to get the which tab is clicked by user. I want to do all this code in CMainFrame class which is derived from CFrameWnd class. If anybody any solution then please forward it to me.
Thanks in Advance
Atul
|
|
|
|
|
Hit the 'next' button on the forums a few times. This topic has come up 3 or 4 times in the last week. I'm guessing it's part of a homework assignment somewhere...
Waldermort
|
|
|
|
|
Hi,
In my application im displaying bitmap in my view. But now i want animated giff file to display.I searched in net but i get solution to display only in dialog. i want to display in view.Pls help me out.
Anu
|
|
|
|
|
Take thsame steps you used to display the bitmap, but for a GIF you will need to include extra code to load the .gif file and render each frame to a DC. In the case of animated GIF's you may also want to use a timer.
Search on CP, there are numerous articles concerning loading and displaying GIF files.
Waldermort
|
|
|
|
|
thanks for your post.
i would like to learn from you, how you could manage it in dialogs.
please respond, because, i will use in my dialog based applications for better representations.
thank you.
|
|
|
|
|
|
|
|
|
Hello All,
I have problem with Accessing the HDC variable.
I am using MFC Application.(Dialog Based)
When i am going to use that variable like..........
/////////////////////////////////////
if (!m_hrootdc)
m_hrootdc = ::GetDC(NULL);
///////////////////////////////////////
Error shows at the line of If Condition like below.............
//////////////////////////////
TestRTMP.exe: 0xC0000005: Access violation reading location 0xccccccdc.
////////////////////////////////
I have declared this HDC variable in the class header file(RTMPDesk.h) and I have used it in the file (RTMPDesk.cpp) and CTestRTMP is the main Dialog Class.
so plz help me .
Thanks in Advanced.
Ashish Bhatt
|
|
|
|
|
I highly doubt the code you posted is the cause of your problem. Your code is trying to read a variable that has not been initialized 0xCCCCCCCC and because there is a 0xDC at the end of that hex, I am guessing that the instance of your class has not been initialized.
You can verify this by placing a breakpoint on the code and checking the value of the this pointer.
Waldermort
|
|
|
|
|
Thank you All
I have have got the Solution. I did not initialize the object of class.
|
|
|
|
|
Did you initialize m_hrootdc?m_hrootdc=NULL;
|
|
|
|
|
when i use this link to customize the title bar..........<b>http://www.codeproject.com/gdi/customcaption.asp</b>.Its demo was working fine but there is a bug,when first time click the minimize button it works fine but after that its not working and what we saw when i click the half left part of the maximize button,the window will minimize and when i click the right half part of the maximize button then the window will maximize.how to fix that bug.plz anybody fix the bug. i am a novice programmer.
Anurag Gupta
Sofware Engg.
NetStudio pvt. ltd.
|
|
|
|
|
Without looking at any code it's kinda hard to say. But to hazard a guess, I would say the NCHITTEST message is being handled incorrectly and that the rectangles of the buttons are improperly positioned.
Waldermort
|
|
|
|