Of course, it is offtopic, but I would say that requirement to verify if pointer is good or not is a result of bad objects intraction design. There never should be invalid pointers, because you will forget to verify it once - either now or when you will have to modify your code one year later. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
grigsoft
Posts
-
How to verify a pointer is valid? [modified] -
(High-color) icon managementCreate bitmap in any tool you like, then import in into VS. I'm using http://www.awicons.com/awicons.html, but any special icon editor will do. When you will need to edit bitmap, just open it in external tool, without doing anything in VS. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Multilingual Support ProblemSure, but do not expect too much :) support[]grigsoft.com Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Multilingual Support ProblemIn most cases you don't have to worry about it - just like text buttons in Message boxes, this dialog depends on windows version. And users of your German version will use German windows, so they will see it in German. Still you can change the texts, but not with rc file - by using custom template extension for FileOpen dialog, and then directly iterating and translating controls on main dialog. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
CArray memory issueYes, that's true. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Read ini file?You can check in sources what is wrong there (maybe it caches open file handle), but why don't you use GetPrivateProfilexxx functions directly? Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
[Message Deleted]Well, you don't have to use it anyway :) In most cases it can be avoided. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
[Message Deleted]It is not always possible to include header with desired declaration, in some cases you just don't want class CPatel to heaviliy depend on CMyApp. In such cases (and if CMyApp only encounters in CMyApp* form) it is easier to make such preliminary declaration. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
CArray memory issueWith SetSize your code runs faster - memory for 1000 items is allocated and not copied\extended during adding new items. Without it array will allocate new memory several times, copying all items to new location. FreeExtra just free unused memory - but it have to copy whole array to new location, which cost time. So I almost never use it - if you will want to add new item afterwards, you will cause array to copy items again. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
How to save the toolbar settings and selectionCFrameWnd::SaveBarState should do the trick. However keep in mind that this thing fails if you will delete one of toolbars or change ID. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
How do I know which font is used in dialog boxYou are right - CWnd::GetFont() returns current font for window. This font is not selected automatically in compatible DC on creation. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
How do I know which font is used in dialog boxdc.SelectObject(GetFont()); ? Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Text extractionI could recommend www.wordcnv.com[^] - these guys have fastest library, which can be supplied in a small (<50K!) lib file, and their support is great. I'm using their library myself. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
How to read .Doc, pdf, .xls etc file?You can get text from MS Office files by using COM, but this requires office installed. Next, on new systems you can check IFilter interface - system uses it to index office files. Finaly, you can use third party libraries. I can recommend http://www.wordcnv.com[^] - their libraries are very fast and support is the simply the best I have seen. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Is there any way to manually define resource id without conflict with others?I have a macro that renumber resources in resource.h sequentially. Depending of what did you mean with your question, it might help. Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
File CompareYou can find WinDiff sources, or have a look at WinMerge.sf.net. Comparison itself could be a hardest part, since there are plenty of algorithms. You can search for MYERS's Difference Algorithm. Igor Green http://www.grigsoft.com/ Compare It! + Synchronize It! - files and folders comparison never was easier! Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Creating SetUp File ,Plz...HelpSearch for InnoSetup - it is free and good for most install tasks. Igor Green http://www.grigsoft.com/ Compare It! + Synchronize It! - files and folders comparison never was easier! Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Empty String OverkillYes, I usually do
if (!(*szPossiblyEmptyString) )
But this maybe not very readable. Igor Green http://www.grigsoft.com/ - files and folders comparison tools -
How can we Change the Caption of a specific ID in String Table.(Urgent pls)I don't know how to change string table. My idea was instead of doing this, you can override GetMessageString and return another string ID2 when asked for string ID1 Hope this helps, Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
Change Text property for all DialogsI'm using ini file for translation purpose, and to translate dialog I have a call DlgTranslate(this) from OnInitDialog in every dialog. This function traverses all dialog controls, changing text accordingly. This was long preface :) The key is that recently I need to adjust font of static controls, and doing this in DlgTranslate was a good choice (while not very structured). You can do similar thing in your case too. Igor Green http://www.grigsoft.com/ - files and folders comparison tools