|
Nelek wrote: Please don't take it bad, but... with that signature and asking such a question?
Ditto.
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]
|
|
|
|
|
This can be written as the below.
for(int i = 0; i < 5; i++) { for(int j = 0; j <= i; j++) printf("* "); printf("\n"); }
Maxwell Chen
|
|
|
|
|
look at the right code
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
if(j>i)
printf(" ");
else
printf("*");
}
printf("\n");
}
|
|
|
|
|
in your biography stands: "Working as a software engineer in Indo-FUji COmpany"
I cant believe that if i see your question
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
But haven't you heard, those folks are programming gods?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
That's why software engineer positions were drained out. I hope companies can tell if an applicant is really good or just one of these "programming gods" like this.
|
|
|
|
|
I want to display my dialog in upperpart of screen.So, i use SetWindowPos() in OnInitDialog().
But it doesnot work.It display the dialopg in centre of the screen.
BOOL CMFCButtonDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowPos(&CWnd::wndTopMost,0,0,100,1000,SWP_NOSIZE);
return TRUE; // return TRUE unless you set the focus to a control
}
Wats my mistake?
Anu
|
|
|
|
|
Confirm you haven't clicked the 'center window' property of the dialog.
|
|
|
|
|
|
you can try
MoveWindow function
|
|
|
|
|
The Window is placed in the default position by the MFC framework after the OnInitDialog function has been called. So placing SetWindowPos in the OnInitDialog function is no good.
Create a custom message and map it to a function using the ON_MESSAGE macro.
In the mapped function put the SetWindowPos function call.
At the end of the OnInitDialog function, do a PostMessage for the custom message.
|
|
|
|
|
You have to override WM_WINDOWPOSCHANGING and place your SetWindowPos there:
void YourDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
SetWindowPos(&CWnd::wndTopMost,0,0,100,1000,SWP_NOSIZE);
}
|
|
|
|
|
Perfectly working..Thank you so much...
Anu
|
|
|
|
|
Hi...
Hi...
I am having a file in C:\\Test.txt. If i click a button that file have to open in window. This is not for read or write. To show the file like if we double click the file.
if you know please help me.
thanks...
G.Paulraj
|
|
|
|
|
that easy
use the WinExec function or ShellExecute
|
|
|
|
|
yes... i used ShellExecute.
G.Paulraj
|
|
|
|
|
I am getting this message:
"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
I see there's a fix for Windows XP, can that be applied to a windows nt/2003 server or is there another fix for this machine?
|
|
|
|
|
Do you have source code for this program?
or Are you getting this error in specific build ( Debug Vs Release)?
|
|
|
|
|
I have source code for the program and am getting the error in the release build. Actually I haven't been able to build a debug version. I get link errors and as yet haven't made the effort to get the debug build to work.
|
|
|
|
|
What's the linker error you are getting in your debug build?
Thx
AL
|
|
|
|
|
Actually, after I responded to your last post I took the time to fix the linker errors. Now it builds and runs. But more generally I seem to get this effect recently when I have a bug in my app. Then when I go to debug, it traps to some debug hook location. Since I've been working with VS for about a year now, this is new to me. So I'm not sure what to do next to debug since it's not breaking in a way that I can see a trace of how the program got to this point. The old tried and true approach is to scatter printf statements around and try to zero in on the trouble spot. That generally seems to work. Any suggestions are welcome.
Thanks
|
|
|
|
|
Hey
I have a variable,
char * p
which could sometimes have a string or sometimes
it will be empty.
How to check whether "p" has a string in it or not?
I see that its not possible to do something like,
if(p != "")
{
}
Thanks
|
|
|
|
|
Perhaps you could use
if(*p = 0); But then this assumes you initialize the pointer when it is emptied.
char* p = NULL;
p = &some_char_array;
p = NULL;
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: if(*p = 0);
Don't you mean == there?
|
|
|
|
|
Yes, of course! Just typed too fast.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|