|
|
Hi, sorry if this is in the wrong forum.
Im working on a project in C++ using the GDI; with WinMain and all that.
For one bit of it, im using TextOut to display some text, but I also want to display an integer that will change. So TextOut will appear as follows:
<br />
int name;<br />
<br />
TextOut(hdc,x,y,"text",strlen("text");
"text" is technically an 'address of string to print'
How do I display the contents of name using TextOut?
Before using the stringstreams method is suggested, ive already tried that and my compiler isnt having it, and changing my compiler isnt an option.
|
|
|
|
|
Use sprintf() to write the integer to a string, or CString::Format() if you're using MFC.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Look Like you are using Win 32 api based Project.
Here is the way to display the content of name variable
int nName=4;
<font color=#00ff00>
char szBuffer[20];
<font color=#00ff00>
sprintf(szBuffer,"%d",nName);
<font color=#00ff00>
TextOut(hdc,x,y,szBuffer,strlen(szBuffer));
or in place of sprintf you can use itoa() too (which convert interger to string)
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
hy alok,
use the delete button when post post the same message twice.
secondly, use #008000 green's color instead of your #00FF00
see you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks,
I have deleted that post, that's really very-2 silly mistake .
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Is there is any way to hide the DOS window that
shows when system command is executed.
system("Dir/ar>File.txt");
lists the readonly files to the file.txt.
Is it possible to use ShellExecute ?.if so what is the syntax?.I tried using cmd.exe with shellexecute but
seems that cmd.exe doesnt takes parameter.
|
|
|
|
|
Why not use FindFirstFile() and FindNextFile() instead of the antiquated system() call? You'll be much better off.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a proyect based on Chatsrv/chatter samples on Visual C++ 6.0. My surprise comes from the fact that the same proyect compiled on Visual C++.NET fails when receiving data for a short time. That is, for some time, I get the data through the socket but suddenly and with no exception catched, I give up receiving data . Just in case it can turn out to be a clue, this communication is unidirectional, that is, I get the data from a monitor connection to a certain port.
|
|
|
|
|
Hi:
Please some help about fuzzy set.
or any site tech such techinques
any help can help me .
Thanx alot.
Bye
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
If your 'set' is too fuzzy, shave 'em. Just try not to hurt yourself.
If that's not what you mean, try to explain yourself a little better.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
If your 'set' is too fuzzy, shave 'em. Just try not to hurt yourself
Haven't you ever heard of fuzzy set theory?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yeah, vaguely, but I couldn't resist....
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
but I couldn't resist
I noticed
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
type the word fuzzy into the search box at the top of the page. There are quite a few fuzzy logic/set articles on this site.
[edit]And click the go button. I forgot that part [/edit]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Is there a conveinient way to give an MFC ActiveX control a dual interface?
(Don't ask, COM+MFC makes me shudder enough already, but I need to wrap an MFC control)
TN65 describes a way, but basically everything has to be done twice.
I never really know a killer from a savior boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
If I launch an application, how can I detect and terminate if another instance of the application is running?
|
|
|
|
|
Hi There!
look at these article tehy will help you out as you exact term use for your problem is Single Instance APP
http://www.codeproject.com/cpp/csingleinst.asp
http://www.codeproject.com/threads/singleinstance.asp
http://www.codeproject.com/threads/simplesingleinstanceapp.asp
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks for the info...I give a try and keep you posted!
|
|
|
|
|
|
Hi all,
I am capturing an image through a camera. The camera returns a pointer to a two dimensional array of pixels. How can I go about displaying these pixels into MFC? (Just like a webcam or a camera with an LCD does)
I have read tutorials on displaying .bmp using CBitmap ... However, will MFC understands the raw image file (no header, each pixel has 8bit grayscale).
I appreciate all of your help.
Thanks,
Beou
|
|
|
|
|
See SetBitmapBits or SetDIBits.
onwards and upwards...
|
|
|
|
|
can a MFC program be simply re-compiled or slightly modified from Windows OS to Macintosh OS to generated exe file for Macintosh?
includeh10
|
|
|
|
|
There used to be a version of MFC for that platform. I do not know if that is still the case, however. Check Microsoft's site.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|