|
hi,
i want to ask how to call or load the .bmp file into c++ programme?
what command should i use?
tq....
|
|
|
|
|
For starters:
LoadBitmap()
LoadImage()
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Add a bitmap resource with an ID of IDB_MYBITMAP (or whatever ID you want) to your project. With App Studio, you can do this by either creating a new bitmap resource and setting the ID, or by choosing Resource, Import, and importing an already created bitmap with a .BMP extension.
Using LoadBitmap() to load bitmap in your resource, example
void CMyDlg::OnPaint()
{
CPaintDC dc( this ); // Device context for painting
CBitmap bmp, *poldbmp;
CDC memdc;
// Load the bitmap resource
bmp.LoadBitmap( IDB_CORPLOGO );
// Create a compatible memory DC
memdc.CreateCompatibleDC( &dc );
// Select the bitmap into the DC
poldbmp = memdc.SelectObject( &bmp );
// Copy (BitBlt) bitmap from memory DC to screen DC
dc.BitBlt( 10, 10, 47, 47, &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( poldbmp );
// Do not call CDialog::OnPaint() for painting messages
}
-----------------
conglt
|
|
|
|
|
hi,
why'll the foll. error occur,
cannot open Debug/last.exe for writing ,wher last is my project name.
Pls let me know,
bye
swapna_signsin
|
|
|
|
|
Because your program is still running so it is normal that it cannot be replaced by a new version while still running.
|
|
|
|
|
swapna_signsin wrote: why'll the foll. error occur,
cannot open Debug/last.exe for writing
Because last.exe is running. Close it down, and then do a recompile.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all,
I have an mdi application ,and here i have about 11 toolbars .All these toolbar are created a variable of
CToolBar and then using the CreateEx() in the mainframe.cpp file,loaded all the toolbar .
Now i have a menu called "Toolbar" in my application which selects/checks the toolbar WS_VISIBLE and checks/unchecks the toolbar .So when i check ,say any one toolbar,it shows at first instance,and if i uncheck ,it hides.
Now i want to save these settings, so that once i close
the application and opens it again,i get only the toolbar shown which are selected initially before the application closes.
"In short,I want to display next time,only the toolbar which are checked .
Please get me out of these problem(;
|
|
|
|
|
CFrameWnd::SaveBarState should do the trick. However keep in mind that this thing fails if you will delete one of toolbars or change ID.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
You can use function GetBarInfo & SetBarInfo
-----------------
conglt
|
|
|
|
|
I have 2 edit control named "Name" and "Location". the "Location" control already contains the text as "C:\DesktopSearch\Index\". Now when i type text into "Name" field,it has to be appended with "Location" control's text i.e. eg
if i type into "Name" ,a text called hello, the "location" field shud be appended with this text i.e
"C:\DesktopSearch\Index\hello".
i have put the code in onchange event of "Name" edit control. The following is the code
void CCreateDlg::OnChangeEnterName()
{
CString csText,cs1,cs2;
m_name.GetWindowText(csText);
m_Enter_Location.GetWindowText(cs1);
cs2 = cs1 + csText;
m_Enter_Location.SetWindowText(cs2);
UpdateData(FALSE);
}
But when i type text into "Name" the characters are repeated.
m_name and m_Enter_Location are member variables for "Name" and "Location" edit controls respectively
how to solve this ? pls help
|
|
|
|
|
you have to store first the content of the "location". then, use this data and append it with what has been written in the name field.
|
|
|
|
|
whenever Location changes, get a copy of the text and store it in a member variable.
add Name to that member variable (not to the current text in the Location control) and set that as the text of the control
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
sudeep_br wrote: UpdateData(FALSE);
Not necessary.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I want to disable an Item of the CTreeCtrl,displaying the Item
with gray color.How should I do?Thank you!
|
|
|
|
|
|
Hi,
I actually have 2 comboboxes,say 1 combobox company,so in the next company,I've to display products of that company.I can have any no.of companies.
I've used 2 tables say company and products.I said like "select * from company,products where company.pcode=products.pcode".So,do I need to use addstring for 2nd combobox and how do I display the corrseponding products.
pls hlp
swapna_signsin
|
|
|
|
|
When a change is made in the first combobox, issue the query, and add the results of that query to the second combobox. If you are using MFC, use the CComboBox::AddString() method.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi.
I need to develop code that will be ported to several platforms (windows, embedded, ...) and I need to work with the serial port (which is of course platform specific). So I need to design an hardware abstraction layer. I was wondering what is the best way to go for that.
For now, what I have in mind is declare my class in a header file. The handle of the port and things that are related to the target platform are enclosed into preprocessor tags (#ifdef) so that they are not 'viewed' by the compiler if not required.
Then for the implementation of the class, I will have a cpp file for each platform. Each cpp file will be enabled (or disabled) by the preprocessor tags.
Like that, I don't have to bother of my target platform, I have a generic class that can be created without checking for the target platform.
Is this a good way to achieve that ? Or is there other methods ?
Thanks for your advices.
|
|
|
|
|
yes.
-Prakash
|
|
|
|
|
hai to all
i would like to know about how to work on threads .ie.,how to create a thread
how to start a thread
how to stop a thread
|
|
|
|
|
This is a too vast subject to answer simply in a message. You can find more informations on Google[^]
|
|
|
|
|
Try to search CWinThread on MSDN or Google. This class is used to create and handle threads in VC++.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
|
|
You come into MSDN, read topic related to CWinThread
-----------------
conglt
|
|
|
|