|
Ok,thanks for your help.
|
|
|
|
|
UKM_Student wrote: The program i wrote...
Really?
UKM_Student wrote: 1) The part where i bold-ed, why is there a need to put in the sign '...'?
What sign?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
What do u mean by really?
I remembered asking that question before and someone helped me out in editing my "wrong" program but i forgot to ask why he needed to put that '...' sign, but anyway, through trial and error i managed to produce the following :
#include<iostream>
#include<string>
using namespace std;
int main()
{
char letter='A',count=1;
while(count<=26)
{
cout<<letter;
letter++;
count++;
}
return 0;
}
|
|
|
|
|
UKM_Student wrote: What do u mean by really?
I remembered asking that question before and someone helped me out in editing my "wrong" program...
It came from here.
UKM_Student wrote: i forgot to ask why he needed to put that '...' sign,
What is a '...' sign? Elipses are often used with code snippets to show missing, irrelevant code. How do they pertain to this thread?
UKM_Student wrote: ...through trial and error i managed to produce the following :
#include<iostream>
#include<string>
using namespace std;
int main()
{
char letter='A',count=1;
while(count<=26)
{
cout<<letter;
letter++;
count++;
}
return 0;
}<="" blockquote="">
What trial and error? The code I gave you worked fine. Why the introduction of count ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Ah so u were the person that helped me out the other day :P
The sign i was talking about isn't the '...',but rather the ' ' sign,ie, why should we put char='A' and not char=A.But palin helped in answering this part earlier already xD
Re:Trial and error part, my tutor said the program was too short, and moreover someone else in my class also used the same program so i tried introducing the count char and after a few tries, i managed to get the answer. :P
|
|
|
|
|
UKM_Student wrote: The sign i was talking about isn't the '...',but rather the ' ' sign...
That's called a character constant.
UKM_Student wrote: Re:Trial and error part, my tutor said the program was too short...
Too short for what? Why add code just for the sake of adding it?
A different approach on it might have looked like:
for (char Letter1 = 'A'; Letter1 <= 'Z'; Letter1++)
cout << Letter1 << endl;
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Lol, 'coz if i were to have the same program with one of my classmates,the lecturer might think that we copied each other so.... yeah
|
|
|
|
|
True, technically, but the odds of that happening with a five line program are slim at best. Now if you turned in 100 lines of identical code, then you'd have issues.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hah ok, thanks for your help.
|
|
|
|
|
I'd like to implement a control that will be used to build up a list of recipients for an email. It will ideally behave in a similar manner to Outlook 2007 (as that's the product we sell as an email client).
The window class for the Outlook 2007 control is a RichEdit20WPT but that doesn't seem to match any of the rich edit class names in the SDK headers. Can anyone tell me if this is a standard control or not?
Do any of the standard rich edit controls provide the necessary features to get a control to behave like the Outlook 2007 controls?
|
|
|
|
|
Hi Steve,
I dont see anything about RichEdit20WPT in the MSDN about Rich Edit Controls[^]. If the naming convention is any clue then it is most likely an extended RichEdit20W control used exclusively in Microsoft Office.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi
Can anyone tell how to compare systemtime.
SYSTEMTIME t1;
SYSTEMTIME t2;
GetSystemTime(&t1);
GetSystemTime(&t2);
Is this a good approach
t1==t2
Thanks
|
|
|
|
|
VVVimal wrote: Is this a good approach
t1==t2
Depends on your needs (i.e. be specific!).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hi
CImage image;
image.Load (_T(read.tif"));
//x1 = 8108, y1 =68 , x2 = 8116,y2 = 82
CRect rect(x1,y1,x2,y2);
CDC *pDC=CDC::FromHandle(image.GetDC());
pDC->Draw3dRect(rect,RGB(255, 0, 0), RGB(0, 255, 0));
image.Save(_T("D:/2009ga.jpg"));
when i try to draw the rectangle in image ...
showing error msg like Expression : m_hDC == 0..but not drwing the rectangle in image..why
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
modified on Tuesday, September 15, 2009 4:49 AM
|
|
|
|
|
Why don't you have a look at the SimpleImage [^] sample code?
Alternatively: why don't you use a debugger?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks ..i hope it ll help me ...
how to debugger in Visual studio ..already i am working in C# .net ....i think its same procedure ...?
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
The following code snippet (inside the OnPaint handler) works on my system:
CPaintDC dc(this);
CImage img;
img.Load(_T("foo.jpg"));
CDC * pdc = CDC::FromHandle( img.GetDC() );
CRect rc(0,0,100,100);
pdc->Draw3dRect(&rc, RGB(0,255,0), RGB(255,0,0));
dc.BitBlt(0,0, 400, 400, pdc, 0, 0, SRCCOPY);
img.ReleaseDC();
(Consider it as it si, just a silly example: for instance reloading the image at every OnPaint call is foolish).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want to dynamically create the controls on dialog box.
this dialog box may contain multiple list controls, check boxes, radio buttons, drop down boxes etc.
number of each controls depend on the some condition.
so can we do this if yes, how do i do this?
how do i handle the events related to the controls?
sunnyram
|
|
|
|
|
sunnyram wrote: so can we do this if yes, how do i do this?
Yes, of course. You've to use, for instance, CreateWindowEx [^] function.
sunnyram wrote: how do i handle the events related to the controls?
MSDN has a lot of examples about, see, for instance, the Using Buttons [^] topic.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks, i will try suggested thing.
sunnyram
|
|
|
|
|
If it's only a handful, why not create them all at design time, and then show/hide them accordingly (ie, some condition)? Much, much easier than creating them at runtime.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
As it is a requirement we can not do this.
sunnyram
|
|
|
|
|
My program crashes on a client's pc (with XP) on this 3 lines (on any other pc it correcly runs):
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->SetForegroundWindow();
m_pMainWnd->UpdateWindow();
They are default instruction in the initialization function (InitInstance ) of a MFC program.
My antivirus (COMODO) tells a warning on UpdateWindow because when run trys to install a global hook on "atioglxx.dll" (It looks a dll from my ATI video board). If I do not permit this the program stops, else runs perfectly.
I'm quite sure that some setting of the antivirus of the client is locking this function! Or that his video-board isn't so compatible with this function.
Why this hook? Is it important? can I avoid this to let the program run on every pc?
Any other solution?
Of course there is the easy way (but not the real solution) to tell to the user to disable the antivirus (I think it is Norton)
Thanks
Russell
|
|
|
|
|
Russell' wrote: Is it important? can I avoid this to let the program run on every pc?
Have you tried?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|