|
Vinay wrote: Hi Laxman,
I cant change the file path,because the items in the list box contains a data like
D:\Parichay\Box01\00000301\0123.txt
Can u please tell me how to open the file ???
void CSearchDlg::OnDblclkSout()
{
int d;
d=m_SOUT.GetCurSel();
CString FName;
m_SOUT.GetText(d,FName);
modify the FName path here as above post
ShellExecute(m_hWnd, "open", FName, NULL, NULL, SW_SHOWNORMAL);
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
I dont know how to do that can u please tell me how to alter the file name in the runtime...
|
|
|
|
|
vinaycool wrote: I dont know how to do that can u please tell me how to alter the file name in the runtime...
Sorry , this is too much
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
vinaycool wrote: how to alter the file name
#include <cstdio><br />
int rename(const char* oldname, const char* newname);
Maxwell Chen
|
|
|
|
|
This answer is not correct. The double backslash is only neccessary if you use a literal string in your programming code. Here you just read the name entered in a listbox. I recoomend to use the source level debuger and place some breakpoints. You should always check following things: is the function actually called? Does the Listbox provide the correct handle? (I also recommend to handle LB_ERR so you see it if something is wrong)Do you get the correct string back from the listbox? Is your call to ShellExecute handled correctly? Does it give back an error message?
I really do not understand why you need to ask such a question in the forum. You reaaly should invest some time to learn how to use the source level debugger and how to read the documentation.
|
|
|
|
|
Can you tell me how to use graphics in a console application(Ex : Draw a line or something)!I can do that in turbo C but in VC++ I dont know any function or any thing to do that!Please help me!
Thank!
|
|
|
|
|
Take a look here[^], I think you'll find what you are looking for. Especially the beginners section.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
kflrei wrote: Can you tell me how to use graphics in a console application(Ex : Draw a line or something)!
Well you have to grab the device context of the Console Application. Then use normal SDK paint functions to paint to this device context.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
kflrei wrote: !I can do that in turbo C but in VC++ I dont know any function or any thing to do that!Please help me!
you have to learn Windows Programming to DRAW in Windows World!
"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
|
|
|
|
|
Thank for your advice!I'll think about that!
(I only want to create some program that can run before windows start!Graphics only to make it easy to use!)
|
|
|
|
|
Hi,
I have 2 edit box in my dialog m_INDEX_FILE & m_WORD & a Search button.
on the OnSearch()i want to check if the user has entered data or not if the user has not entered data then i want to disply a message box for that i have used below code. but the problem is below code has no effect ...can u please tell what changes has to be made....
void CSearchDlg::OnSearch()
{
UpdateData(TRUE);
if (m_INDEX_FILE.GetLength() < 0 )
{
MessageBox("Select the Index File before searching !","Asis Search Engine",MB_OK | MB_ICONINFORMATION);
return;
}
if (m_WORD.GetLength() < 0 )
{
MessageBox("Enter the word to be searched","Asis Search Engine",MB_OK | MB_ICONINFORMATION);
return;
}
}
Regards,
Vinay Charan.
|
|
|
|
|
what is m_INDEX_FILE ?CString and m_WORD
whitesky
|
|
|
|
|
check equality too... zero length strings
m_INDEX_FILE.GetLength() <= 0
|
|
|
|
|
<br />
void CAnswerDlg::OnBnClickedMybutton()<br />
{<br />
CString str;<br />
m_Edit1.GetWindowText(str);<br />
if(str.IsEmpty())<br />
MessageBox("Empty");<br />
else<br />
MessageBox("not");<br />
}<br />
<br />
whitesky
|
|
|
|
|
Hi ,
Instead of UpdateData() try using GetWindowText():
void CSearchDlg::OnSearch()
{
CString szCaption;
m_INDEX_FILE.GetWindowText(szCaption);
if (!szCaption.IsEmpty())
MessageBox("Select the Index File before searching !","Asis Search Engine",MB_OK | MB_ICONINFORMATION);
return;
}
Regards,
Eli
|
|
|
|
|
Vinay wrote: I have 2 edit box in my dialog m_INDEX_FILE & m_WORD & a Search button.
on the OnSearch()i want to check if the user has entered data or not if the user has not entered data then i want to disply a message box for that i have used below code. but the problem is below code has no effect ...can u please tell what changes has to be made....
Try the following Code.
void CSearchDlg::OnSearch()
{
UpdateData(TRUE);
if (m_INDEX_FILE.IsEmpty())
{
MessageBox("Select the Index File before searching !","Asis Search Engine",MB_OK | MB_ICONINFORMATION);
return;
}
if (m_WORD.IsEmpty())
{
MessageBox("Enter the word to be searched","Asis Search Engine",MB_OK | MB_ICONINFORMATION);
return;
}
UpdateData(FALSE);
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello All,
I got the solution I used below code,its working fine.
void CSearchDlg::OnSearch()
{
UpdateData(TRUE);
if (m_INDEX_FILE.GetLength() <= 0 )
Thank you very much ......
|
|
|
|
|
vinaycool wrote: on the OnSearch()i want to check if the user has entered data or not if the user has not entered data then i want to disply a message box for that i have used below code. but the problem is below code has no effect ...can u please tell what changes has to be made..
what about handlling NM_CHNAGE MESSAGE, and setting flag accordingly
"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
|
|
|
|
|
Hi,
Im Delevoping a GUI in MFC.
I am facing the following problem in Output Window of my GUI.
I used stringray SECTabWnd class as my base class .My problem is ,When i click on the arrow head button on the scroll bar the text in the output window is getting scrolled but When I use the rectangle box(Thumb buttom) inside the scroll bar the thumb button ramins inactive(not getting scrolled as with the text).Can any body give me appropriate solution for this..Thanx.
Regards,
Hari
|
|
|
|
|
D.Srihari wrote: Can any body give me appropriate solution for this
Hey, we are not here for providing solutions ,but to show the way HOW to get solution .
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
void CChildView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
int p=GetScrollPos(SB_HORZ);
switch(nSBCode)
{
case SB_LINELEFT:
p-=1;
break;
case SB_LINERIGHT:
p+=1;
break;
case SB_PAGELEFT:
p-=5;
break;
case SB_PAGERIGHT:
p+=5;
break;
case SB_THUMBTRACK:
p=nPos;
break;
}
SetScrollPos(SB_HORZ,p);
CWnd ::OnHScroll(nSBCode, nPos, pScrollBar);
}
i think u might have forgot the highlighted code
E-Ramu
|
|
|
|
|
Hi All,
I want to Iterate a folder for specific files.I am given with only the filetype. Can anybody help me to achieve this.
Thanks in advance,
Poornima
|
|
|
|
|
Look up CFileFind .
A sample[^].
Or you can use
FindFirstFile --> Look up this in MSDN you will get two samples there.
FindNextFile
Nibu thomas
Software Developer
Programming Tips[^] My site[^]
|
|
|
|
|
atimpoo wrote: I want to Iterate a folder for specific files.I am given with only the filetype. Can anybody help me to achieve this.
try Modified version of CFileFind:-
http://www.codeproject.com/file/CFileFindEx.asp[^]
"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
|
|
|
|
|
How we can create our own fonts without inherting from existing one?
SaRath
|
|
|
|