|
Are you using the Viusal C++6.0? If you are good at her.Could you introduce some advantges and the yields of her domaining?
|
|
|
|
|
wanlim0817 wrote: Are you using the Viusal C++6.0?
Yes, exclusively.
wanlim0817 wrote: If you are good at her.
My copy is gender-neutral.
wanlim0817 wrote: Could you introduce some advantges...
Compared to what? It's 8-12 year-old technology so comparing it to a 1-2 year-old tool is hardly fair.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Friends,
I want to enumerate all the files of extension *.mp3 in a certain folder. The folder may contains subfolders and more subfolders inside subfolders. What i want is that i enumerate files upto certain "depth" of subfolders in the given folder. How can i do so ?
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote: I want to enumerate all the files of extension *.mp3 in a certain folder.
If you are using MFC, use the CFileFind class. Otherwise, use the FindFirstFile ()/FindNextFile () pair.
Imtiaz Murtaza wrote: What i want is that i enumerate files upto certain "depth" of subfolders in the given folder. How can i do so ?
This can easily be handled via recursion.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have just begin with VC++, Can any body help me use MS FlexGrid control? In my lab session I use Grid to add the location of Mouse (x, y) in Dialogbase. Many thanks for your help
|
|
|
|
|
It will be very difficult to help you if you don't provide any information. What are you trying to do and where are you stuck exactly ?
|
|
|
|
|
Next time, I suggest you use a more descriptive title than "help".
The title should say what you want help with - "Help using MS FlexGrid" or something like that.
|
|
|
|
|
Can any body help me use MS FlexGrid
|
|
|
|
|
Hello,
is there any funktion to convert a current time to CString?
regards
break;
|
|
|
|
|
Hi,
this is my try:
<code>
CTime t = CTime::GetCurrentTime();
CString csTime;
csTime.Format("%d:%d:%d", t.GetYear(), t.GetMonth(), t.GetDay());
</code>
thanx
break;
|
|
|
|
|
There are also formatting functions directly in the CTime class.
|
|
|
|
|
What is the standard coding practice for using the keyword virtual? I know that a base class can call a method in a derived class through virtual functions, but what if you simply want to over ride the default behaviour of a function? The virtual keyword is not always necessary but all the articles/tutorials say to use it. Also, when over riding a virtual method I sometimes see and sometimes don't see the use of virtual again in the derived class. Is there some rule about using this keyword or is it simply 'under advisment'?
|
|
|
|
|
It all depends on whether you use the base pointer, or the derived pointer
class CBase1
{
virtual void Message() { cout << "CBase!1"; }
}
class CDerived1 : public CBase1
{
virtual void Message() { cout << "CDerived1!"; }
}
class CBase2
{
void Message() { cout << "CBase2!"; }
}
class CDerived2 : public CBase2
{
void Message() { cout << "CDerived2!"; }
}
CBase1* obj1 = new CBase1();
obj1->Message();
CBase1* obj2 = new CDerived1();
obj2->Message();
CDerived1* obj3 = new CDerived1();
obj3->Message();
CBase2* obj4 = new CBase2();
obj4->Message();
CBase2* obj5 = new CDerived2();
obj5->Message();
CDerived2* obj6 = new CDerived2()
obj6->Message();
So if you have a complex class hierarchy, with lots of objects derived from a single base class, and you want to store a vector of objects, and have each perform their unique operations, you'll need to use virtual, since your vector doesn't know what type the objects are, it just thinks of them all as base class objects
|
|
|
|
|
You are talking about polymorphism, which doesn'a answer my question about when and when not virtual should be used.
|
|
|
|
|
Personally, I use virtual so I know at a glance that it may be an override.
It's your choice. It only needs to be used at the base class.
|
|
|
|
|
Looking at samples of other peoples code, I guessed this was the case. I have to admit it is handy to know quickly which methods you are overriding, but the keyword virtual here and there in the header file tends to make it a little unreadable. I like to group my function types and evenly space them, makes scanning the header a lot easier. I guess I will have to devise a method of incorporating virtual into my coding style.
|
|
|
|
|
It depends entirely on how your classes will be used. If the callers will be using polymorphism, then you need virtual on the methods that you want to be polymorphic.
virtual is only necessary in the base class. When a derived class overrides a virtual method, it's still virtual. You can write virtual in the derived class, but it's not required.
|
|
|
|
|
Hello,
I want to assign a string stored in a CString to char data type. I am unfamiliyar with char data types. They are, somehow, totally beyond my understanding!
Basically, I am getting the path of a file in strFileName. I want to extract only the file name from it. This is what I am trying to do:
if (dlg.DoModal() == IDOK)
{
strFileName.Format("%s",dlg.GetPathName());
AfxGetApp()->AddToRecentFileList(strFN);
char filePath[_MAX_PATH];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
filePath = strFN;
_splitpath( filePath, drive, dir, fname, ext );
CString st; st.Format("%s%s",fname,ext);
SetWindowText(st);
pDoc->IsNew = FALSE;
}
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: I am unfamiliyar with char data types. They are, somehow, totally beyond my understanding!
Yet you understand CString ??
Tara14 wrote: strFileName.Format("%s",dlg.GetPathName());
Why not simply:
strFileName = dlg.GetPathName(); Tara14 wrote: filePath = strFN; // ---> this is wrong. Plz can you tell me the correct way. _splitpath( filePath, drive, dir, fname, ext );
Should be:
_splitpath(strFileName, NULL, NULL, fname, NULL);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Should be:
_splitpath(strFileName, NULL, NULL, fname, NULL);
As simple as that! ! Silly me. Trying unnecessary stuff!!
Thank you.
Fortitudine Vincimus!
|
|
|
|
|
Hello,
is this an CFileDialog Object, right???
Use:
CString csFileName = FileOpenDlg.GetFileName();
regards
break;
|
|
|
|
|
Hi,
Please tell me how to access the PoolNonPagedBytes from the Win32_PerfFormattedData_PerfProc_Process for only one process.
Please help me.
Thanks in advance.
Regards,
Suresh
|
|
|
|
|
|
Hi Mark Salsbery,
I know this. But the problem is how to access the objects of that class. And the what are the steps to access the objects.
Please provide me some tips.
Thanks,
Suresh
|
|
|
|
|
Hi,
I have an simple MFC single document application(e.g TestApp). When application stop working for little time it shows in task bar icon not responding(i.e TestApp(NotResponding)). If I go in TaskManeger then I can find that status of my application is not responding.
Then after some little time my application again runs normally but task bar icon still shows not responding(i.e TestApp(NotResponding)) though it was supposed to show only application name (i.e TestApp).I can verify that application is running normally by seeing the status in TaskManeger.The name in TaskBar Icon remains until I exit from application.
In short I want the the application name only in task bar icon when application returns to normal state. Can anybody help me out?
Thanks:-
Mike
|
|
|
|