|
I don't know Convert.ToInt32(string*,int base) but I suppose it converts a string into an integer. Maybe you are looking for the atoi[^] function ?
|
|
|
|
|
atoi only converts into integer of base 10 as far I know.I want it to convert to any base like 16(hexa) etc.
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
Ok sorry. strtol[^] then, as pointed in the FAQ by Michael
|
|
|
|
|
I would use a std::stringstream . Michael mentions it in his article but I couldn't see a hex example. Something this would do it:
stringstream ss("10");
int num;
ss >> hex >> num;
I think that in general using the STL is cleaner and more maintainable then using the cryptically named CRT functions.
Steve
-- modified at 20:19 Friday 20th January, 2006
ADDED:
But you only get oct , dec and hex so if you need more the CRT style functions may the the way to go.
|
|
|
|
|
How do i create multiple columns in ClistBox?
please call me back!
cb
|
|
|
|
|
Add the LBS_USETABSTOPS style to the control.
However, unless you have a specific need not to, you should use the list view control in report mode instead. These days, any app using a multi-column list box looks antiquated.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
but how will i add a string to a specific column? m_list.col(n)...?
|
|
|
|
|
You can't, per se. The concept of "real" columns in a listbox does not exist. The LBS_USETABSTOPS and LBS_MULTICOLUMN styles can simulate the effect, but it pales in comparison to an actual list control.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
why don't you use BLONDE CListCtrl!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
Michael is right use the CListCtrl (List Control)
There are a number of beginner articles here at code project to get you started and understand how to work with list control.
http://www.codeproject.com/listctrl/[^]
Here is a decent explanation on working with the list control.
Using the List Control[^]
Good Luck.
|
|
|
|
|
I saved some datas in test.txt...I want to copy or transfer the same datas to other .txt file.How can i do this..?Help me..
|
|
|
|
|
It is a very general question, difficult to answer precisely.
If you use the STL (or are familiar with), you can open an input stream ifstream, read the stream char by charfor example and by the same time outputing it to an output stream ofstream
std::ifstream InputStream("test.txt");<br />
std::ofstream OutputStream("AnotherTest.txt");<br />
<br />
char c;<br />
while(true)<br />
{<br />
InputStream>>c;<br />
if (InputStream)<br />
{ <br />
OutputStream<<c;<br />
}<br />
}<br />
<br />
OutputStream.close();<br />
InputStream.close();
-- modified at 5:10 Friday 20th January, 2006
Ooops, sorry, I forgot the "exit" of the loop
It should be:
if (InputStream)<br />
{ <br />
OutputStream<<c;<br />
}<br />
else<br />
break;
This will work better
|
|
|
|
|
Are you looking for something simple like CopyFile() ?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
I have three dialogs. The situation is like...two main dialogs say main1 and main2. I have created one more child dialog on main1 dialog.Now i m showing that child dialog on main2 dialog. Now if i click outside to the child dialog but on the main2 dialog that child goes to its parent dialog i e main1.
But i want that child to stay on the main2.
So,please help me out on this problem....
Thanks.
|
|
|
|
|
I don't really understand your question... So, you have two main dialogs so they are modeless I suppose ? Or are they modal (and so you created the second one "from inside the code of your first dialog") ?
And for the first dialog, you have a child dialog that you moved over dialog 2. What do you mean by "that child goes to its parent dialog" ? It doesn't move or what ?
|
|
|
|
|
|
After Cedric's response, you know that your question is hard to understand, but here I go:
You have two modeless dialogs (main1, main2) that are children of a Parent dialog (Papa Window). Each dialog can show its modal child dialog. Now when one of the dialogs (main1 or main2) shows its Modal child dialog, the focus can still be brought back to the other one (main1 or main2).
You want this:
When any one of (main1 or main2) shows its modal child dialog, you want that modal to be modal for both main1 and main2.
The solution:
Make the parent of main1 or main2's modal child dialog a child of "Papa Window" instead of main1 or main2.
Hope that helps.
this is this.
|
|
|
|
|
Okay so I give up, I have a VS2005 standard edition. Just experimenting with it at this point, I created a small MFC dialog based app (nothing more than a simple MP3 player). The app compiles fine on my development machine (W2K) runs just fine on a second machine (another W2K box) and also runs just fine on my W2K server. However, when I run it on any XP system I get the ever so enlightening
“This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem”
I am not using any managed code just plain vanilla MFC, I checked with dependency walker and have included the necessary dlls (mfc80u.dll, msvcp80.dll, msvcr80.dll and msvfw32.dll)
I even created an installer with VS, when run on the XP systems it errors out with a dependency of .NET 2.0. Will I need to include .NET 2.0 as an external dependency for a MFC app?
Any help / ideas is appreciated.
|
|
|
|
|
It is because Microsoft introduced a new technique in VC2005, it has something to do with the manifest files (don't know much more about it, sorry).
It won't work like it worked for VC6 for example (just making a package with the dll and everything). Take a look here[^]
There are several deployement method described there.
Hope this helps
|
|
|
|
|
Cedric Moonen wrote: It is because Microsoft introduced a new technique in VC2005, it has something to do with the manifest files
I thought the idea was to make the development process easier not insanely more difficult. Guess I have lots of reading ahead of me.
I had previously discovered that website but it’s a jumbled mess of reoccurring links.
Cedric Moonen wrote: It won't work like it worked for VC6 for example
It’s so much easier in VS6.
|
|
|
|
|
S Douglas wrote: I thought the idea was to make the development process easier not insanely more difficult. Guess I have lots of reading ahead of me.
I had previously discovered that website but it’s a jumbled mess of reoccurring links.
I fully agree with you. This was much more easier in VC6, no need of all this crap... This is really boring.
I found a tool that could help you. Take a look here[^] if you are interested.
-- modified at 4:11 Friday 20th January, 2006
It is for the Express Edition, but I don't know if it will work or not for the standard edition, you'll have to try that.
|
|
|
|
|
Cedric Moonen wrote: This was much more easier in VC6, no need of all this crap... This is really boring.
Indeed!
Cedric Moonen wrote: I found a tool that could help you. Take a look here[^] if you are interested.
Cool Thanks, had not seen this during my hunt I will have to check it out.
5 BTW for the help!
|
|
|
|
|
Another link that may help you here[^]
It is a deployement example found in the jungle of the MSDN links
|
|
|
|
|
Cedric Moonen wrote: It is a deployement example found in the jungle of the MSDN links
One day when I grow up I want to create a mess of web pages.
Cedric Moonen wrote: Another link that may help you here[^]
I think that one is a winner. Thanks again Cedric.
|
|
|
|
|
Just FYI, manifests are related to SxS (side-by-side) installs of DLLs. This feature was added in XP, which is why you don't see any problems on 2K.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|