|
I just want to know HOW it works, and IF it works.
Knowledge is the key to power
Even with these functions, you'll still face the problem with writing to running .exe.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Erik Kallen wrote an amazing clone of these functions that works on all Win platforms. Check it out in CodeGuru: Updating Resources on Win9x
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have created an application, but failed to check the context help file option. Is there anyway I can add it now?
Thanks.
|
|
|
|
|
s. u can. wizard is the one that adds code for u. u can also add the same code at any point. there is something called as HtmlHelp. Try using it and implmentating context sensitive help.
Documentation are there in MSDN for implementing this. Or compare to source codes one with Context-help checked and other unchecked and add the differencing code by hand. thats it
Ganesh.M.Ramaswamy
|
|
|
|
|
I need to implement logging to a text file. The logged messages are small, but there can be huge number of them. But, I want to make sure that the log is intact even if the application crashes. But, if I open and close the file for each it seems like lot of load. Do anyone have any suggestions for this?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
If you're concerned with "lot of load", use CreateFile with FILE_FLAG_WRITE_THROUGH flag, and keep the file open.
KB article Q99794 has more info.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you very much for the prompt reply. I will check that out.
Thanks again.
- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have to admit, I'm somewhat new to C++, so this question may not seem like much to a lot of the readers.
Using one of the common header files, is there a simple way to copy a file from place to place, modifying its name if necessary? I'm aware of how to do this using text files with fstream, but I'm curious about how to copy other file types.
If anyone responding would rather give a code example that try to explain it otherwise, I'll give you a scenario... say you're aiming to write a quick program that would copy the file c:\windows\desktop\file1.bmp to c:\copyoffile1.bmp.
Any help would be appreciated. Thanks.
|
|
|
|
|
Use one of the following Windows API functions:
CopyFile
SHFileOperation
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Got it to work. Thanks for the help.
|
|
|
|
|
In windows NT, when you would right click on a dll, you could view its dependncies and what not.
How do you do that in 2000?
|
|
|
|
|
It's not related to the operating system. There's a program, depends.exe, installed with VC++ that associates itself with .dll files. Copy this file to W2K machine or install VC++ and you'll get 'View dependencies' option.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I had a question for recommendations...let's say you learned some C++, and then after that, got into MFC and Windows Programming.
After 2 years of that, you feel that you don't know C++ too well, but you are not too bad either..you are kind of intermediate.
what book would you recommend to use for someone at this stage, trying to take his C++ to the next level, going from intermediate to senior?
|
|
|
|
|
It depends on what you mean by going to the next level. What do you want to learn?
In my experience, books can only take you so far with C++. After that you learn a lot more by coding and making mistakes (and correcting them).
What do you feel you lack?
Michael
|
|
|
|
|
|
I strongly recommend these two books:
Effective C++
Scott Meyers
ISBN: 0-201-92488-9
More Effective C++
Scott Meyers
ISBN: 0-201-63371-X
(2b || !2b)
|
|
|
|
|
there's a lot of good stuff in STL (how to use it, the philosophy behind it, etc.) and templates in general are a good intermediate step.
and really, once you've mastered templates and STL, there's not much left, just more of the same.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
thanks all...I'll follow up on these..
as for the gent, who asked me what I have read thus far..I started off with Deittel & Deittel, then got into Windows and MFC, with Charles Petzold and Jeff Prosise books. So, I haven't really dealth with STL and some other areas of C++ that Windows programming really doesn't get involved in, too much.
thanks
|
|
|
|
|
and really, once you've mastered templates and STL, there's not much left
There's much left. "Modern C++ Design" by Alexandrescu has a lot of advanced-level metaprogramming/generic programming stuff.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
For improving your C++, I'd recommend Bjarne Stroustrup's "C++ Programming Language". The author is the C++ creator, so you'll get first-hand information. After this, read two Scott Meyers' books listed in previous posts. You may also have a look at http://www.gotw.ca/ - this is C++ Guru of The Week website.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
|
I'm building a TabCtrl extension class that allows the tab pages to be created from a dialog resource.
Inside the tab control it normally creates a new instance (using new ) and keeps that pointer in a list. However, if you want to do anything complicated on the tab then you need to inherit from the default tab page class (CTabPage) to provide the handling of events, etc. Therefore there is an AddPage override which accepts a pointer to a CTabPage and just adds it to the internal list.
The destruction code for the tab control just iterates through the list calling delete. However, if the pointer passed in wasn't created with new then it will crash. I wanted to avoid having to create objects with new outside of the tab control class and allow them to be deleted by the tab control class.
So, if in the destruction routine I could determine if the pointer was a valid heap pointer then I could delete it, otherwise I would just leave it and let it's destructor do the work.
Am I making sense?
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Item 27 in Meyers' "More Effective C++" deals with related issues. He presents some methods of determining if object is on the heap or not, however, there's no simple solution to this problem.
Here's what I would do in this case:
Assume that clients are responsible for deleting pages if it's necessary (many of them will simply create their pages as data members in dialog class or as local stack-allocated objects). Clearly document client code responsibility and everything should be OK.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
many of them will simply create their pages as data members in dialog class or as local stack-allocated objects
That's most of the problem. The default approach is for the tab control to do all of the new'ing and deleting of the objects required for the tab pages. If a client creates a local stack-allocated object and passes a pointer to it for the tab control, then the tab control tries to call delete on it.
Derek Lakin.
Salamander Software Ltd.
|
|
|
|