Hi, here is how I used std::mapmapVar; void Myfun1() { ... CString strTemp = "str1"; mapVar[strTemp] = myStructObj1; } void MyFun2() { map<CString, CMyStruct>::const_iterator itr; Cstring strTemp = "str1"; itr = mapVar.find(strTemp); .... } Sometimes it is working fine but sometimes it is not working.
Lakshmi_p
Posts
-
Probelm with std::ma find function -
Probelm with std::ma find functionHello everyone, I am using std::map in my application. I am searching for CMyStruct based on the CString using find function. But sometimes find function is returning null iterator even when there is strcture obj with specified key. Can anyone help me in finding the solution?
-
Messagebox problemhi, Thanks for ur reply. Can we get the handle of messagebox default icon based on its its styles.
-
Messagebox problemHi, I want to replace the message box icon with my own icon. But i don't know how to get the Handle to message box icon. Any suggestions are welcome.:)
-
[SOLVED] Enabling a button after previous button click.hi, Try this one... Disable the button in OnInitDialog of your dialog class eg: GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(FALSE); Enable that button in OnBnClickedOpen function void CSRFToolDlg::OnBnClickedOpen() { char* ReadFileName = "G:\\Work On\\CPP\\SRFTool\\text_file.txt" ; if(openFile.Open(ReadFileName, CFile::modeCreate | CFile::modeReadWrite)) { AfxMessageBox("File creates successfully", MB_OK) ; GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(TRUE); } else { AfxMessageBox("Error in file opening", MB_OK) ; } } Again Disable the button in OnBtnClickedClose() void CSRFToolDlg::OnBnClickedClose() { openFile.Close() ; GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(FALSE); } If you the control variable of Close button, the user that variable in place of GetDlgItem(UR_CLOSE_BUTTON_ID)
-
hiHi, Its working. Thanks for ur reply:)
-
hiHi all, How can i know that the user has pressed ALT+F4 key combination . Thanks in advance.
-
How to change the main frame shape in MFCHow can i change the main frame shape in MFC?