|
If this code is in a secondary thread, then the following statement is a recipe for failure:
int item=pList->InsertItem(pList->GetItemCount(),lpszUser); Instead you should be posting a message to the main thread (the one that owns the GUI). See here for why.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
How to load more than one image in a particular cell ( for a single item) in a listctrl report view .
Can I arrange the text and images in any order in that cell(eg: image1 text image2 image3)
Remember for a single cell(Item)
Thanking you
SANDEEP A.C
Sanc
|
|
|
|
|
Only way is to draw it yourself....and you mentioned the way you want it to appear....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
hi
I want to check for Invalid Mail Address in MFC. I have used SMTP to connect & send a mail but if i give inavlid mail id it doesn't display error message.
Can anyone provide me links or code???
Thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Chcek out this link:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html
Cheers
"Peace of mind through Technology"
|
|
|
|
|
check this out:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html
Cheers
"Peace of mind through Technology"
|
|
|
|
|
How to make the edit display the value by hex string?
such as
....
m_spin.SetBase(16);
m_spin.SetRange(0,0xFF);
m_spin.SetPos(0x2F);
...
the edit display "0x002F",what I want is just the string "2F" only.
ps:I tried to format m_edit in the function OnUpdateEdit(), but failed.
|
|
|
|
|
What is this m_spin ? A Progress bar ?
It has nothing to do with the edit control !
What you put in the edit control, it's up to you to format it correctly.
|
|
|
|
|
It may be an object of CSpinButtonCtrl..
nave
|
|
|
|
|
yes
CSpinButtonCtrl m_spin;
CEdit m_edit;
..
m_spin.SetBuddy(&m_edit)
...
|
|
|
|
|
yes
CSpinButtonCtrl m_spin;
CEdit m_edit;
..
m_spin.SetBuddy(&m_edit)
...
|
|
|
|
|
zeus_master wrote: How to make the edit display the value by hex string?
If "2F" is already in s string-type variable, just use CEdit::SetWindowText() :
m_edit.SetWindowText("2F"); If not, please explain more clearly what you are after.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
In fact, I want to build a simple tool to debug some registers. the registers value range is from "0x00" to "0xFF". only display the string from the hex value
please see sketch map below:
____
|DE | // edit value display is 00,01,02.......,0A,0B,....0F,...1E...FF
<||> // spin left<- ->right
|
|
|
|
|
Now I understand. Unfortunately, the only solution I can think of is to make the edit control right-justified and just wide enough to hold FF.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
what you mean is this function m_edit.SetWindowsText("FF")?
would you tell me the way of you setting?
thank you
|
|
|
|
|
I assumed you simply wanted to know how to set the text of an edit control.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
yes, it is also a problem for me.
how to set the text/string of edit control that display the value from "00" to "FF"?
|
|
|
|
|
Why don't you set it through code?
Remove the style UDS_SETBUDDYINT .
Handle the notification for spin control.
Now get the current integer value of the spin control and get it in hex format using Format function of CString or by using sprintf .
for ex:
sprintf(buf, "%x", spinVal);
Nibu thomas
Software Developer
|
|
|
|
|
thank you very much for your suggestion,
I removed the style UDS_SETBUDDYINT, and added the code below.
void CFlexgridDlg::OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
BYTE str;
str = m_UpDown.GetPos();
m_edit.Format("%02x",str);
m_edit.MakeUpper();
UpdateData(false);
*pResult = 0;
}
the text of the edit display the hex string I want now.
but I met another problem is if how to limit input value from keyboard of the edit is hex string format.
CEdit m_edit1Ctrl;
CString m_edit;
void CFlexgridDlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
char chartemp;
char edit1sel;
UpdateData(TRUE);
edit1sel = m_edit1Ctrl.GetSel();
if(edit1sel)
chartemp = m_edit.GetAt(edit1sel-1);
else
chartemp = 0x00;
if(!(isxdigit(chartemp)))
{
m_12.SetSel(edit1sel-1,edit1sel);
m_12.Clear();
}
UpdateData(false);
}
the code can work well while the edit is not a buddy of the spin, if set edit as a buddy of the spin. the error occurs, UpdateData() cann't work here?
|
|
|
|
|
zeus_master wrote: but I met another problem is if how to limit input value from keyboard of the edit is hex string format.
Subclass CEdit and handle WM_CHAR .
Check for valid hex characters.
If not valid hex characters eat the message else display char.
Nibu thomas
Software Developer
|
|
|
|
|
thank you.
|
|
|
|
|
zeus_master wrote: how to set the text/string of edit control that display the value from "00" to "FF"?
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
hi
i just starting using cv++ express and i find a problem with DATABASE reading.
i have an access database that i fill it with information ,but i got a problem to read from my database in the other version of vc++ i can use CRecordSet,but with vc++ express its not possible.i am lloking for help to read from my database?
thank u
|
|
|
|
|
1. r u using cdaodatabase, cdaorecordset class?
2. Access database version ?
|
|
|
|
|
aguest wrote: ...in the other version of vc++ i can use CRecordSet,but with vc++ express its not possible.
Right, because MFC is not available with the Express edition. You will need to do what MFC is doing behind the scenes for you. See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|