|
Iam using a CComboBox control for selection.When i select a different item from the list , before updating i wish to check it for some conditions set by me and if it holds ,then only i need to update it,else the selection should reset to last selection. I tried messages CBN_SELENDOK, but iam not able to make use of it.Can anyone help me to solve this out.
|
|
|
|
|
ratishmon wrote: I tried messages CBN_SELENDOK, but iam not able to make use of it.Can anyone help me to solve this out.
What exactly is the problem? What have you achieved and what are you not able to do?
My suggestion is: Handle the CBN_SETFOCUS and store the current selection state by CComboBox::GetCurSel() . Then handle the CBN_SELCHANGE and again get the new selection. Validate against your criteria. If invalid, reset it to the previous one by using CComboBox::SetCurSel()
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
It would seem a better design if potentially-invalid entries were not part of the combobox to begin with. Is this approach not feasible?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
When can be an object ambiguous?. this is one of the questions i faced in one interview. What could be the ansers friends?...
KIRAN PINJARLA
|
|
|
|
|
You lack the basics man. Read a book. Now someone can answer this question. But this won't be repeated in the interview. You need to really know the basics first.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Mr. Bramha if u are unable to give answer of any question then don,t give any suggestions. First check ur knowledge.
sdssd
|
|
|
|
|
The correct answer is, of course, "Pshh...never! My objects are NEVER ambiguous!".
|
|
|
|
|
Hi
I need to move the data selected in the list control and some other additional data to the Excel sheet . Please give me a solution as how this can be done.
Thanks in advance.
Taruni
|
|
|
|
|
Taruni wrote: I need to move the data selected in the list control and some other additional data
You need to be sure of what you are going to have. Give some more details. Are you using OLE? Is excel within your application or not? Do you want to export data to a file and then open it with excel?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
During Debugging the application,
when a modal dialog is used,it popups and the
window is shown by Dialog.DoModal().
But if the same dialog(Form) when shown as a modeless window,
it cannot be popupped.
For example,
<br />
pGraphDlg=new CGraphDlg();<br />
pGraphDlg->Create(CGraphDlg::IDD,NULL);<br />
m_pMainWnd=pGraphDlg;<br />
pGraphDlg->ShowWindow(WM_SHOW);
Is there any way to show the modeless window during
debugging the application.
|
|
|
|
|
Dear All,
I need to do that taking remote host files from any LOCAL host using CFileDialog.
Can i use CFileDialog for getting remote host file lists ?
How can i do this ?
or
is there any other way to do this ?
Thanks.
Bye.
|
|
|
|
|
Sakthiu wrote:
Can i use CFileDialog for getting remote host file lists ?
\\use UNC paths in filename folder
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Where can I find the basics to start learning the usage of graphics library functions?Plz help.........
|
|
|
|
|
sheetal_06 wrote: the usage of graphics library
Which one ? There are several... GDI, DirectX, OpenGL, ...
Be more precise. If you don't know, maybe you could describe what you would like to do so we can help you choose the appropriate library.
|
|
|
|
|
if i want to list every file in one of my drives what type of varables do i need? and how many lines will a CListCtrl hold before it goes crazy?
|
|
|
|
|
Hi,
1st: mask should be "*.*"
CFileFind finder;
BOOL bWorking = finder.FindFile(_T("C:\\*.*"));
while (bWorking)
{
bWorking = finder.FindNextFile();
if (finder.MatchesMask(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))
_tprintf(_T("%s\n"), (LPCTSTR) finder.GetFileName());
}
2nd - i've no idea - never checked it.
-----------
Mila
|
|
|
|
|
ok look at it this way how can i list every file in my c drive and have it count the files and directorys in a dialog and not crash?
i know how to list the files.
i know how to count the files and directorys.
i know how to get all the sub directorys.
but at around 30000 it crashes.
|
|
|
|
|
Hi,
Try to check what exactly crashes - I made a little test with CListCtrl and it works fine with 2 x 64k items (checked with only 1 column and with VS2005). So maybe problem is with an item's data.
-----------
Mila
|
|
|
|
|
if i start the dialog then attach to process the debugger this is what i get.
unhandled exception in file count.exe(gdi32.dll): 0xC00000FD: stack overflow
|
|
|
|
|
Hi All,
Over the past few weeks I have been trying all sorts of different ZIP examples found in CodeProject but all of them I can seem to get going under Visual Studio 2005.
The application is a CLR Console App.
Anyone suggest one that can be successfully used under VS2005 ?
Cheers...
Pete
|
|
|
|
|
I want to create a window in which both the Non-Client and the Client are owner-drawn.
I know that I have to handle the WM_NCPAINT and WM_NCACTIVATE messages for Non-client drawing and WM_PAINT message for Client drawing.
For a simple test I added the following code in a Dialog based Application
BOOL COwnDrwDlg::OnNcActivate(BOOL bActive) <br />
{<br />
if (bActive)<br />
{<br />
CRect rect;<br />
GetWindowRect(&rect);<br />
<br />
CBrush FB(RGB(0, 80, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}<br />
<br />
return true;<br />
}<br />
<br />
void COwnDrwDlg::OnNcPaint() <br />
{<br />
CRect rect;<br />
GetWindowRect(&rect);<br />
<br />
CString str;<br />
str.Format(_T("OnNcPaint : Width = %d Height = %d"), rect.Width(), rect.Height());<br />
TRACE(str);<br />
<br />
CBrush FB(RGB(0, 80, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}<br />
<br />
void COwnDrwDlg::OnPaint() <br />
{<br />
CRect rect;<br />
GetClientRect(&rect);<br />
<br />
if (IsIconic())<br />
{<br />
CPaintDC dc(this);
<br />
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);<br />
<br />
int cxIcon = GetSystemMetrics(SM_CXICON);<br />
int cyIcon = GetSystemMetrics(SM_CYICON);<br />
int x = (rect.Width() - cxIcon + 1) / 2;<br />
int y = (rect.Height() - cyIcon + 1) / 2;<br />
<br />
dc.DrawIcon(x, y, m_hIcon);<br />
}<br />
else<br />
{<br />
CBrush FB(RGB(80, 0, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}
I thought this much code would result in a window having a green outer rectangle and a dark red inner rectangle, minus the system buttons.
But it did not happen. All I got was captionless grey window.
Where did I go wrong? Where I can get a good documentation regarding painting the non-client area efficiently?
Cutebug
|
|
|
|
|
You could try CWindowDC instead of CPaintDC in OnNcPaint. I don't think you need handle OnNcActivate, just check the state of the window in OnNcPaint (i.e. does it have the focus, etc).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
How do i write using SetItemData/GetItemData to link items listed in the droplist(combobox) to certain files(.txt)? Is there any examples i can refer to?
Thanks A Lot
|
|
|
|
|
cyn8 wrote: How do i write using SetItemData/GetItemData to link items listed in the droplist(combobox) to certain files(.txt)?
You question is not clear...
Do you want to see all the txt files in a directory listed in your combo box, then take a look at DlgDirListComboBox .
|
|
|
|
|
In my application i have another edit box and a browse button to find a file and load it. But I want to be able to create a link from the droplist to the edit box to load the respectful files according to the item listed in the combobox droplist.
for example...
in the drop list, it has:
item1
item2
item3
by selecting one of them, eg. "item1".....
Item1 will be directed to location example "c://File1.txt"
the edit box will also show "c://File1.txt" and the file will be automatically load it
May i know how to do this?
Thanks
|
|
|
|