|
i have a part of syntax below:
CEdit* pEdit=(CEdit*)GetDlgItem(IDC_EDIT1);<br />
CString strTeks;<br />
pEdit->GetWindowText(strTeks);<br />
<br />
int nLineCount = pEdit->GetLineCount();<br />
CString strLine;<br />
for (i=0;i < nLineCount;i++)<br />
{<br />
int len = pEdit->LineLength(pEdit->LineIndex(i));<br />
pEdit->GetLine(i, strTeks.GetBuffer(len), len);<br />
strTeks.ReleaseBuffer(len);<br />
strLine.Format(TEXT("line %d: '%s'\n"), i, strTeks);<br />
} then i want to print every character in the edit box in term of "1"
and "0" using fprintf at a .txt file. How can i do that???
HelpMe
-- modified at 11:11 Thursday 30th March, 2006
|
|
|
|
|
A funny method to try: supposing strTks is a number in a string, convert it to a real int:
unsigned int nb=aoti(strTks.operator LPCTSTR());
And convert it into a binary:
CString str="";
while (nb>0)
{
str=(nb&1 ? "1" : "0")+str;
nb>>=1;
}
Then you can fprintf the str.
~RaGE();
-- modified at 11:53 Thursday 30th March, 2006
|
|
|
|
|
Rage wrote: unsigned int nb=aoti(strTks.operator LPCTSTR());
Why the mess?
unsigned int nb = atoi(strTks);
Rage wrote: nb>>1;
You do realize that this does nothing, other than create an endless loop, don't you? Perhaps you meant to use this instead:
nb >>= 1;
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Why the mess?
Because it does it anyway, so let's make it obvious.
DavidCrow wrote: You do realize that this does nothing, other than create an endless loop, don't you? Perhaps you meant to use this instead:
nb >>=1, correct.
~RaGE();
|
|
|
|
|
thanks i solved the problem...
HelpMe
|
|
|
|
|
beardy janggut wrote: then i want to print every character in the edit box in term of "1"
and "0" using fprintf at a .txt file. How can i do that???
This makes no sense. What exactly is it that you are trying to accomplish?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
How do i generate the printout Format Using VC++
Like pohonebill
Hi
|
|
|
|
|
rameshmahadevan wrote:
How do i generate the printout Format Using VC++
What is "the printout Format?"
rameshmahadevan wrote: Like pohonebill
What is a/the "pohonebill?"
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
If you are refering to how to use the print functions/spooler etc. Then here[^] is an excellent little tutorial for printing in non-MFC.
|
|
|
|
|
waldermort wrote:
If you are refering to how to use the print functions/spooler etc.
Which I wasn't.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
It's my job to make sense of people's bad English. It's starting to rub off on me now, My English was one of the best in Uni, now after teaching all this time I have come down to my student's level
|
|
|
|
|
I think you missed David's point which was (if I understood his post correctly) that HE wasn't referring to anything. He wasn't the one asking the question.
Of course, CodeProject often puts replies in the wrong place, so that could be why your reply to the original poster was attached to his reply.
((But I think I put my reply in the wrong place - it should have been in response to your second post in this thread! Ooops. ))
-- modified at 1:01 Friday 31st March, 2006
|
|
|
|
|
|
~RaGE();
|
|
|
|
|
finallyfinally
|
|
|
|
|
bang bang
|
|
|
|
|
"Sarah Connor ?"
~RaGE();
|
|
|
|
|
nop, rameshmahadevan... sorry
but it was the idea
|
|
|
|
|
|
Hello,
I would like to know, for joining two pixels in a bitmap.
As i have set of pixels, so i need to join them.
|
|
|
|
|
huh ?
pixels are independant entities ( if I may say so ); even in a bitmap.
what exactly are you wanting to do ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have set of cartesian coordinates, i plotted them on bitmap by using SetPixel(...);,
and so then i would like to join all the pixels.
|
|
|
|
|
like what, draw a line between those points ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yes, to draw a line between those points
|
|
|
|
|
Hi chaitanya22 ,
Can you be more specific ? what do you need?
|
|
|
|