|
Like templates, right? I see.
Thx
hint_54
|
|
|
|
|
I'm looking for a good book to re-learn programming (in C++). I have Stroustrup but I have the feeling this will be more useful to me once I'm comfortable again. I've been away from programming for at least 4 years and only really learned "on the job" (tools programming windows dialog based apps), but would like to build a more solid foundation this time. I also have Eckels book but again this doesn't seem to be the kind of thing I'm after (though it's excellent on its own merits). I just wondered if there was a good "one book" answer to getting me started with the basics, including setting up compiling and linking properly (and understanding it!), and then building knowledge of the language and libraries etc in a structured, easy to follow way.
thanks in advance.
|
|
|
|
|
ldsdbomber wrote:
I'm looking for a good book to re-learn programming (in C++).
Since you asked a C++ question in a VC++ forum, which is it that you are ultimately after?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
You are in rare form today!
DavidCrow wrote: Since you asked a C++ question in a VC++ forum, which is it that you are ultimately after?
Other than the C++/CLI forum wouldn't this be the place?
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
By no means was I trying to be argumentative. I just didn't want to suggest Kruglinksi's "Inside Visual C++" book to him and then get a "But that's for Visual C++. I want to learn C++ first." response. Seeing as how he already has Stroustrup's book, I wasn't too sure of which route he wanted to take.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Sorry, I just spotted the VC++ forum and posted here, perhaps the other forum was the better one.
Anyway, as I mentioned originally, I want a Stroustrup style book but one that's more of a handheld walkthrough of C++ in a structured way. I had one or two but I can't remember the name of them - maybe Konig, or Shildt? That kind of thing, but I was also hoping that someone would have a good recommendation that will teach me thoroughly but also be fairly accessible.
|
|
|
|
|
Books are one of those things that are highly opinionated. You can ask a dozen people what their favorite is and you'll get 12 different answers. Everyone dis/likes a book for a different reason. I started programming in C and C++ with the help of Schildt and Petzold. Some folks shy away from those authors for various reasons. If you have a book in mind, check out amazon.com for customer reviews.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
I keep getting this but don't know where to fix it. A search on google seemed to suggest I just need to take this out of project settings but i can't find it at all, I assume on the Link tab?
Any ideas?
|
|
|
|
|
This is not a problem. This is telling you that even though you are linking with the import library for SHELL32, you are not actually using any thing from the SHELL32 DLL (either by not explicitly calling something from the DLL, or code that did optimized out).
The result of this is that even though you linked with that DLL's import library, the executable will not require implicit (load-time) loading of that DLL.
Remove SHELL32.lib from your libraries, that should resolve the warning.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
-- modified at 12:17 Tuesday 14th February, 2006
|
|
|
|
|
James R. Twine wrote: Remove SHELL32.lib from your libraries, that should resolve the warning.
If he is using MFC, then shell32.lib is linked in dynamicly via a #pragma comment(lib, "shell32.lib") statement in afx.h. It can not be removed from from the library list without modifying the MFC sources.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I am using MFC for a dialog app. Can't find the pragma comment, or indeed afx.h, I have StdAfx.h included in my project though
|
|
|
|
|
As I said, it is not a "real" problem. In this case, you may have to deal with the warning...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
thanks! no problem, I just wanted to make sure I wasn't brushing something under the carpet that would lead to problems later
|
|
|
|
|
Good morning .. .
I know I can use CString::FormatMessage to format strings when localizating my application ( see this[^] )
Is there an equivalent in STL or for standard C++ or is that too OS/Toolkit oriented to have a unified solution ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
all i know of is sprintf.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
CString/CStringT::FormatMessage(...) wraps the standard FormatMessage(...) function.
This function uses a writable character buffer to format the string into. I do not know of a "proper" way to get writable access to the internal buffer in a basic_string object (data() returns a const pointer to the data).
I would suggest that you allocate a temporary buffer, format into it, and then assign the contents of that buffer to the STL string:
TCHAR caBuffer[ 1024 + 1 ];<br />
<br />
::FormatMessage( ... caBuffer ... );<br />
caBuffer[ 1024 ] = _T( '\0' );<br />
ssYourSTLString = caBuffer;
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
no,no ( but thanks for the info ... )
I was wondering if there was a standard STL/C++ way to deal with such an issue ? if the STL group or C++ standard had such concerns or if it's too closelly tied to the OS/Toolkits.
M.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: no,no
"no, no" about what?
Anyway, yes; the FormatMessage(...) is not a "standard" function, like how one may consider printf(...) , a standard function - it is a Windows platform function, so not something one would expect to be handled by standard C++ or STL.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I was writing to myself ... I did not clearly explain what I seeking...
sorry ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am busy writing up an article for CP that just what you are asking for. I expect to have it ready for posting in a couple of days. If you send me your email address I can send you the demo code that I have ready so far. Then you can test it for me;P
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
In case you can't wait for the reply from PJ Arends.
Try this
http://www.codeproject.com/vcpp/stl/ostringstream.asp
(by Christian Graus)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
RemoveDirectory(LPCTSTR lpPathName);
is used for where the path must specify an empty directory, but i want to remove a directory and also the files and folders that are in the specified folder , how can do that?
as per MSDN
BOOL RemoveDirectory(LPCTSTR lpPathName);
lpPathName
[in] Pointer to a null-terminated string that specifies the path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete access to the directory.
Regards.
|
|
|
|
|
Use SHFileOperation() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Would like to give me an example in what way it can be used for above said purpose
Regards.
|
|
|
|
|
Do you mean other than what Googling would show you?
SHFILEOPSTRUCT s = {0};
s.wFunc = FO_DELETE;
s.pFrom = "c:\\somedir\\anotherdir\\*.*\0";
SHFileOperation(&s);
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|