|
See these codes and in the end you must release memory with calling DeleteObject.
//////For button///////
HBITMAP hbitmap;
hbitmap=(HBITMAP)LoadImage(NULL,_T("e:\\1234.bmp"),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
m_Button.ModifyStyle(0,BS_BITMAP);
m_Button.SetBitmap(hbitmap);
//////////For Static control
HBITMAP hbitmap;
hbitmap=(HBITMAP)LoadImage(NULL,_T("e:\\1234.bmp"),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
m_Static.ModifyStyle(0,SS_BITMAP|SS_NOTIFY);
m_Static.SetBitmap(hbitmap);
also you can use of CBitmapButton class.
|
|
|
|
|
Eranga Thennakoon wrote: Any suggestions for me.
Try this.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks pal.
I appreciate your help all the time...
Eranga
|
|
|
|
|
The function I wanted is when a subitem contains some text, I use some textcolor to show the subitem.
my code are:
first map the message
BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
END_MESSAGE_MAP()
void CMyListCtrl::OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
LPLVNMCUSTOMDRAW lplvcd = (LPLVNMCUSTOMDRAW)pNMHDR;
int iItem = lplvcd->nmcd.dwItemSpec;
int iSubItem = lplvcd->iSubItem;
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
return;
case CDDS_ITEMPREPAINT:
{
*pResult = CDRF_NOTIFYSUBITEMDRAW;
return;
}
case CDDS_SUBITEM | CDDS_ITEMPREPAINT:
{
CString strSubItem;
strSubItem = GetItemText(iItem, iSubItem);
if (strSubItem.Find(_T("loop")) != -1)
{
lplvcd->clrText = RGB(200, 200, 0);
}
<big>
else
lplvcd->clrText = ::GetSysColor(some nornal color);
</big>
*pResult = CDRF_DODEFAULT;
return;
}
}
}
-- modified at 21:14 Wednesday 7th November, 2007
|
|
|
|
|
|
If you found the solution by yourself, It would be nice that you post it, it can maybe usefull for other people.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello All,
I prepared a SDI application by using MFC and Directx 3D now i have to add functionality of print.
for that i am using print command which is default provided by editor it shows print diaolog and command fire to the printer also but i am not getting any contents or picture printed out. printer out a blank paper.
can anybody tell me what i have to do for taking printout of which is shown into the view area of my application.
thanks
Bankey
|
|
|
|
|
And you asked the same question twice. When you already have (at least) two answers (one of them, mine). So why ask another time without checking if your previous question was already answered?
And for the future... Noone here is an employee in forum (but the owners of site), they help because they want it. So BE PATIENT, this is one of the fastest forums I have ever seen, but the people work in other things, eat, sleep, have family and so on...
And there is people of the whole word, so timing can be very different. And when you post, although it is active time for you, is the "quiet" part in forum.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Can you structurate your message a bit better? I dont understand you correctly, having it difficult to answer you
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I am trying to record a wave file using "winmm.dll" from a web application.
I am able to record that .WAV file in 11025 samplespersec, 16 bit, mono format. But my requirement is to record that in 8000 samplespersec, 16 bit, mono format (wave format). How do I meet my requirement ? Is there any other DLLs or ActiveX control to meet my specifications ?
thank u all....
with regards,
kiran
|
|
|
|
|
Have you got a copy of Goldwave? I'm not sure if it's open source these days but it is the business when it comes to audio formats.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
kadkir wrote: But my requirement is to record that in 8000 samplespersec, 16 bit, mono format (wave format).
You can simply change these things in the header that is prepared for recording as well as file writing. Have you look at the code in deep?
- NS -
|
|
|
|
|
I did the same using set command string (passed as param to mcisendstring function). But I am getting "value out of range exception..", what to do with this ?
thank u,
kiran.
|
|
|
|
|
kadkir wrote: I am trying to record a wave file using "winmm.dll"
So you're using the waveIn___() APIs?
If so, you can specify the format you want to record in your
call to waveInOpen() (see the WAVEFORMATEX struct parameter).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone,
I have a large data set of integers (about several Million), all of them are positive integers from experiment. They are stored on a file on local machine. I want to select the largest 1000 values then make analysis based on the 1000 values.
Could anyone suggest some efficient solutions? I think sorting the several M data in memory is not feasible.
thanks in advance,
George
|
|
|
|
|
use map for initially storing the integers
use this map to write integers to file
Using map will unsure that integers are sorted even when written to file
read first 1000 values from file ....now you will get them as storted
|
|
|
|
|
Hi ccpptrain,
What do you mean map?
regards,
George
|
|
|
|
|
|
Thanks abhijit,
I think you mean put all several hundred Million data samples into a memory based data structure Map. I think the memory will be used out.
Do you have any other ideas?
regards,
George
|
|
|
|
|
It is a generalization of your hand-crafted container. There are several C++ classes implementing it, see, for instance:
std::map [^]
and
MFC CMap [^.]
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks CPallini,
I have read through the MSDN reference. I think the memory will be used out if I choose to make all data in pure memory based data structure Map. If I have only several hundred or several thousand of data samples to select, it will be ok to use Map. But now I have several Million data samples.
Any ideas to save memory and do not degrade performance too much? (I think using Map could have very good performance if the total memory is enough.)
regards,
George
|
|
|
|
|
George_George wrote: What do you mean map?
learn C++ containers
but, hey !!!! where's my answer bloody lamer ?
|
|
|
|
|
why map ?
map forbids to have 2 keys identical, and FWI understand, there no need for a pair of (key; value).
vector is good enough then...
|
|
|
|
|
You don't need to sort the values, you have just to pick the 1000 largest ones, hence only a traversal of the whole set is needed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi CPallini,
I think you mean I use sorted Map right? I have used Map before for small amount of data, e.g. several hundred or something like this. But in current situation, I have several Million data samples and I will have more in the future.
I am afraid that we can not put all the data (such a big volumn) into memory based data structure Map.
Any comments or ideas? I am looking for some other ways which consume less memory (maybe we only store a part of the data set into Map?), and which also does not degrade performance too much.
regards,
George
|
|
|
|