|
If I use a class which has 10 methods and 10 attributes, but I only access/use 5 methods and 5 attributes from that class in my program, will the resultant executable also include code/data for the other 5 methods and attributes ?
I suppose I'm asking if the linker is clever enough to discard unused functions and data.
PS. I'm using Visual C++ 6.
|
|
|
|
|
At one point in time very long ago, I seem to remember that the linker would remove unused code from EXEs but not from DLLs. How it works today is unknown to me. Is this causing an issue with you?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It's not a big problem. I'm new to C++ having come from a C background. With the availablility of all the classes on CodeProject (and other sites), it's easy to just drop in classes to facilitate easier programming. However, if I only use a small fraction of the functions in the different classes, then I'm thinking that my application will end up being unnecessarily bloated with code that never gets executed and data members that never get accessed.
I suppose can test it easily enough by creating a test app and then seeing if the code size is larger or the same size when I access more class member functions/variables. I was just curious if anyone knew and had a bit more info on how it works.
|
|
|
|
|
With the exception of a few isolated cases (e.g., EPROM with KBytes of RAM), this exercise would be a complete waste of time with little to no benefit/payback. Most of the time, this "smaller is better" idea is fostered by incorrectly-interpreted information. What you should be concentrating on is how big the program's data is.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
HI!!!
i'm doing my Msc... and want to do a project.. develop any application in MFC/C++... can you please suggest some good topics.. for the project - THANKS! -V.G
|
|
|
|
|
any particular personal interest ?
does it have to be in any particual field ? graphics, database, computational, multimedia, web-related ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
hi!! sorry for being so late.. actually i'm just a beginer..but the project has to be good.. can u suggest any good project for beginners...we r a teamof five.
|
|
|
|
|
How can you be a beginner if you are doing your Msc (I assume this is a computer-related Master's degree)?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes, I'm doing MSC... but am new to the subject i.e Programming in windows
|
|
|
|
|
What about my suggestion here?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Great that you have embarked on using MFC to do your project . But the fact is there has to be a core technology that MFC can revolve around . you could use MFC almost anywhere there is any engineering / business
here is a quick list that i could think about
Database related
Networking related
OS related
Hardware related - serial port communication
testing related
The sky is the limit
Engineering is the effort !
|
|
|
|
|
Have you asked for input from your project/thesis advisor?
In any case, read this article, especially the paragraphs from jury member Richard Morris.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello:
I am developing a library that must automatically detect new files in a certain directory and then process them.
If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed.
How can I check wether the file has been opened by any process in the local machine or even remotely?
Is it possible to get a notification when the file is closed by the user?
I should work out the problem using no MFCs.
Any help will be really welcomed.
Jose M.
Just re-entering programming world after a long break.
|
|
|
|
|
look for CFile::shareExclusive in MSDN
regards
Rajesh
|
|
|
|
|
|
Can I manually insert an activeX into to an existing activeX?
|
|
|
|
|
I’m about to implement multi-select in my derived CTreeCtrl class. I have problem with the default expand behaviour of the CTreeCtrl.
1. I only want the tree to expand when left clicking (not right clicking) it
2. I only want the tree to expand when clicking the plus-sign (not the item text)
All tips are welcomed!!
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi
In order to help, I've built a CTreeView-derived view to play with and have found;
Right-clicking doesn't expand tree items in my test app (??) - might be the version of common controls I'm using, but more importantly, I've overridden the OnLButtonDown member in the view, like so;
void CTreeTestView::OnLButtonDown(UINT nFlags, CPoint pnt)
{
UINT uFlags = 0;
HTREEITEM hSelectedItem = GetTreeCtrl().HitTest(pnt, &uFlags);
switch (uFlags)
{
case TVHT_ONITEMLABEL:
//mk GetTreeCtrl().SelectItem(hSelectedItem);
return;
}
_RPT3(_CRT_WARN, "## LButtonDown (x=%d, y=%d) returns %x\n", pnt.x, pnt.y, uFlags);
CTreeView::OnLButtonDown(nFlags, pnt);
}
which then gobbles the click whenever you click on the label, and everything else, like clicking on the expand button (plus/minus sign) works in the default way.
The bottom-line;
you can override the mouse clicks for your tree control in the standard way (WM_LBUTTONDOWN, et al message handlers) - where you can then use the CTreeCtrl::HitTest member to determine on which part of the tree the click occured, and then take the appropriate action.
In this fashion, you might even be able to customise right-clicks, etc.
HTH
Martin
PS: You might find that since the tree control's behaviour is more for black-box use than customization, you'll probably have to re-implement a lot of the basics over again - you'll have to see how much the effort's worth it.
|
|
|
|
|
What to say...
- A PREFECT ANSWER!!
Thanks!!
_____________________________
...and justice for all
APe
|
|
|
|
|
I am doing a program whereby Im creating an application that extracts information from MS Access Database and displays it out in Visual C++6.
I am using the ODBC Database method.
What I am trying to do is to input and also display Chinese characters in VC++6. The information in my MS Access Database are also in Chinese.
So far what I have only comes out as "???" (question marks!)
Yes I have installed MFC unicode libraries
I have also defined _UNICODE.
I hope the kind and clever people here would sincerely help me.
Thanks so much.
|
|
|
|
|
This might seem silly, but have you made sure that the font that you are using to display your text supports Chinese UNICODE characters?
Otherwise you will get those "???" marks you have mentioned.
I find Tahoma or Arial Unicode are safe fonts when it comes to this respect.
I Dream of Absolute Zero
|
|
|
|
|
erm how do i ensure that my font is Unicode enabled?
I also forgot to mention that my code is self-generated by the VC++ and I didnt type in a single code just some minor additions and adjustments that i followed from a book but those came out fine in English.
I was wondering if my problem had something to do with the codes.
Do i have to change anything?
|
|
|
|
|
I guess you have to Install support for East Asian Languages. This can be done from Control Panel->Regional Languages and Options
Hopefully this will fix it.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
Hi. I did install those East Asian languages that you mentioned but to no avail.
I also forgot to mention that my code is self-generated by the VC++ and I didnt type in a single code just some minor additions and adjustments that i followed from a book but those came out fine in English.
I was wondering if my problem had something to do with the codes.
Do i have to change anything?
Thanks in advance.
|
|
|
|