|
A string builder will do what you want, but it's overkill.
The basic problem is that MC++ is a crappy kludge, I'm glad I've never used it in depth. You need to manually box your integer for string::format to work. You do it like this:
int n = 2003;
Console::WriteLine(System::String::Format("{0}", __box(n)));
That is, this is an example of how to box your integer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
if i try this it gives me the following error:
error C2227: left of '->ToString' must point to class/struct/union/generic type<br />
1> type is 'int'
- Kyle
|
|
|
|
|
|
Thank you Jose Lamas Rios. The num.ToString() worked.
I had been tring for quite some time to figure that out thank you very much.
- Kyle
|
|
|
|
|
|
i have sdk netmeeting3, i want to edit its. but i can't edit its with class wizart on VC++, can i?
|
|
|
|
|
You cannot edit the SDK, no. You can merely use the headers and lib files to link to it, so your code can call it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am learning Visual C++.net and have found that WinExec is no longer used/supported. I am trying to create a Windows Form employing a combo box. I want the user to select an item from the drop down list and have them run a program when the run button is clicked. How do I get The SelectedIndexChanged event to fire whenever the user selects a new program? Thanks for your inputs.
RRL
|
|
|
|
|
cupdoze wrote:
have them run a program when the run button is clicked
If that's the bit you're stuck on, the answer is ::ShellExecute.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
cupdoze wrote:
have found that WinExec is no longer used/supported.
In continuation With Mr. Graus,
you can refer this article too.....
http://www.codeproject.com/system/newbiespawn.asp[^]
"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
|
|
|
|
|
can give some example of source code or project to write the server and client programming
|
|
|
|
|
I searched this site by typing 'client server' in the search dialog you can see just below the Code Project logo above, and found this[^].
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
After downloaded the server and client source code, I do not know how to build 2 project that one is for client and another is for server. can give some guide to build it? I really weak in computer programming and never touch Visual C++ before..
|
|
|
|
|
Are you being asked to do this by your boss or your teacher ? It's a really significant task if you've never used C++ before, if you can abandon it for something simpler, that would be sensible.
Why can't you build it ? What happens ? All you need to do is open the project and choose 'build', assuming you have the right version of VC++ ( I'm not sure which the project uses, actually )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It's the inevitable...
I wrote a menu in the resource file and I entered it into the CreateWindowEx function call and it shows up. I also added code to the message handler to catch clicks. However, when I click items, nothing happens. Here's the handler:
switch (Msg) {<br />
case WM_COMMAND: {<br />
HandleMenuFunctions (hWnd, wParam);<br />
return 0;<br />
} break;<br />
default: {<br />
return DefWindowProc (hWnd, Msg, wParam, lParam);<br />
} break;<br />
}
HandleMenuFunctions is just a function that has another switch to do different things based on the menu item selected:
void HandleMenuFunctions (HWND hWnd, WPARAM wParam) {<br />
switch (LOWORD(wParam)) {<br />
case ID_FILE_QUIT: {<br />
MessageBox (hWnd, "Posting Quit Message now", "Notice", MB_ICONINFORMATION);<br />
PostQuitMessage(0);<br />
} break;<br />
default: { MessageBox (hWnd, "Encountered unknown menu ID", "Notice", MB_ICONSTOP); } break;<br />
}<br />
}
(excuse that smiley face, that should be a PostQuitMessage(0); call.)
Also, when I go to click the menu, it only shows me the popup menu under File every other time. The other times I click, the menu just loses focus. I don't know if that's important or not. Thanks in advance.
edit: I put breakpoints on that first WM_COMMAND case to see if the message is ever captured and it isn't. Either I'm catching the wrong message or something is wrong with the menu. I noticed that there are ways to declare a menu when I register the class in WNDCLASSEX and also when I call CreateWindowEx. I tried only declaring the menu when I register the class and the menu doesn't show, but when I declare it only in CreateWindowEx, it shows up. That might be important too.
solution: I fixed the problem, it had to do with my main message loop, it also fixed the thing where the menu loses focus. I removed the PeekMessage call and just let GetMessage get the message. Here's what I ended up with:
while (GetMessage(msg, NULL, 0, 0)) {<br />
if (msg->message == WM_QUIT) {
return ((int) msg->wParam);<br />
}<br />
TranslateMessage(msg);<br />
DispatchMessage(msg);<br />
}<br />
|
|
|
|
|
What does this error mean and how to solve it?
fatal error C1010: unexpected end of file while looking for precompiled header directive
|
|
|
|
|
If you are using mfc, you need to include "stdafx.h" as the first in your cpp files.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
To elaborate on the prior answer - the stdafx.h file is included BEFORE any other header in every file of a standard MFC project. Any headers you include before stdafx will be ignored. This most typically becomes a problem when you import a non MFC C++ file into your project. It's C++, the compiler can handle it, except that it's expecting to see standard headers. The stdafx header is full of includes, and if you don't need it for that file, or for any files in general, you can change your project settings from using standard headers, to a setting where you specify that the file is stdafx.h, and if you don't include it in a source file, the compiler will just allow it, and compile that file without using the standard header.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
can someone plz give me a tutorial on how to accessing Paradox useing ADO.
i'd like to do it completely in Win32/SDK also
Thanks In Advance,
bin e
|
|
|
|
|
Not a tutorial, but here is how to connect to a paradox database.
Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
See this web site for other database connections.
msdn.microsoft.com[^]
There are a couple of tutorials here at Code Project. The listing can be found here.
http://codeproject.com/database/#ADO[^]
Hope this helps...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
thanks for your help i will look at the page !!
nothing
|
|
|
|
|
can someone plz give me a tutorial on how to change a pushbuttons appearance using GDI.
i'd like to do it completely in Win32/SDK also
Thanks In Advance,
Tim Zorn
|
|
|
|
|
Basically, you set the control to be owner drawn, then you draw it however you like.
This[^] article may be of some help.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you for advance i have change my article.
can you help me?
nothing
|
|
|
|