|
|
You want the same sample to be generated through Wizard.?
-@SuDhIrKuMaR@-
|
|
|
|
|
No. Normally when we run the wizard by selecting MFC Appln it creats CMainFrame, ..Doc, ..View, ..App etc., classes but this MDI sample doesn't have anything like this.
|
|
|
|
|
Hi all
Is there any way by whch I can Convert a .xls file into filterd html file(Pure html file). I am able to convert xls File into HTML by using "SaveAs" Method but this converted file is not a filtered HTML. If there is any library avilable to convert this Unfiltered HTML to Filtered plz let me know about that.
Thanks in advance.
|
|
|
|
|
i have the status bar in a dialog and i give the string to be displayed inside the statusbar using the code given below inside the button click,but the s="in progress" doesn't get displayed and only "sucess" is displayed finally,what's wrong with the code.the problem is iam not able to show two status inside the same button click.what should be done???
void test::OnBnClicked1()
{
s="in progress";
m_bar.SetPaneText(0,s);
if(i>0)
{
call(&a);
printf(".....");
}
s="success";
m_bar.SetPaneText(0,s);
}
and
Raja
|
|
|
|
|
what does your call(&a) function do. Does it take a lot of time to get the processing done. May be it would be too fast for you to see the change from "in progress" to "success". Won't be a good idea, but try putting some Sleep(/*timeinterval in msec (may be 10000)*/) and notice the change. The sleep should be placed beween the two SetPaneText [just before s="success"]. if it doesn't show "in progress" you need to check elsewhere
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
It is because you only have one thread: the message queue of your application is processed in the same thread as the rest of your application code. It means that if you do a lenghty process in one of your function, you won't be able to process messages anymore, which means your GUI seems frozen and is not updated (thus, you won't be able to see your text on the status bar). The solution is to start a new thread and put your lenghty process there. Once finished, you can send a message to your main window so that it can change the text of the status bar.
|
|
|
|
|
i have the same problem even after implementing that long call(); operation in a thread!!!!
Raja
|
|
|
|
|
Because you are immedaitely calling second SetPaneText(..)
If you just wanna check try commenting second call.
Regards,
Sandip.
|
|
|
|
|
I think you are not able to see the chane from "In Progress" to "Success".Try to add sleep for some seconds between both.
-@SuDhIrKuMaR@-
|
|
|
|
|
And how will be your messages processed ?
You can put as much Sleep as you want, if you block the main thread, your UI will be frozen and no messages will be processed (so, your text won't be updated neither).
|
|
|
|
|
CString s="in progress";
m_wndStatusBar.SetPaneText(0,s);
Sleep(3000);
s="success";
m_wndStatusBar.SetPaneText(0,s);
This code will display first "InProgress" then after 3 seconds "sucess" will be displayed.
-@SuDhIrKuMaR@-
|
|
|
|
|
Yes you are right, I tested it.
Anyway, it still isn't good practice to do so: your UI will be totally frozen (with the button pressed) the time it takes for the processing. If it takes really a long time, then it is better to put that processing in a separate thread so the the UI is not affected.
|
|
|
|
|
i tried both sleep and thread methods...both doesn't work!!!!!!
Raja
|
|
|
|
|
How long do you Sleep ? And how much time is your operation taking ?
|
|
|
|
|
sleep is for 4000...and my operation is less than that..iam sure abt that...as print statements given before that prints the sring...but the status bar updates is not shown
Raja
|
|
|
|
|
Could you describe exactly what's happening and what you expect ?
The code that was given to you as example should print "in progress" in the status bar for 5 seconds (depends of the Sleep time) and then it will be replaced by "sucess".
What happens if you just take the code that was given to you and remove your call (just keep the SetPaneText calls and the Sleep) ?
|
|
|
|
|
i have done the following in my code...and i have my progress bar too in my status bar in the second pane....i need "inprogress" to be displayed first and then the " complete" text...but inprogress doesn't get displayed...what should be done
void test::OnLbnSelchangeList1()
{
void (*ptr)(void )=function;
thread_data td;
while(1)
{
if(Complete == 1)
{
indx=list.GetCurSel();
s="in progress";
m_bar.SetPaneText(0,s);
td.threadentry=(LPTHREAD_START_ROUTINE)ptr;
td.hdArg=NULL;
td.udiCreationFlags=0;
CreateThread(NULL, 0, td.threadentry, td.hdArg, (unsigned long) td.udiCreationFlags, (td.udiThreadId));
pPrgCtrl->SetPos(0);
while(1)
{
if(Complete==1)
{
pPrgCtrl->StepIt();
break;
}
}
break;
}
}
Sleep(200000);
pPrgCtrl->SetPos(100);
printf(" complete\n");
s=" complete";
m_bar.SetPaneText(0,s);
}
Raja
|
|
|
|
|
Mohanraj D wrote: ...the s="in progress" doesn't get displayed and only "sucess" is displayed finally,what's wrong with the code.
What is the value of i ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i don't have an i in my code
Raja
|
|
|
|
|
Sure you do. Check again.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
What happens if you comment out the second SetPaneText() statement? Does "in progress" remain in the status bar?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sorry...if i comment the secondsettext the first one is getting displayed ie in progress is displayed
Raja
|
|
|
|
|
Could it be that the code in between the two calls to SetPaneText() is just happening too fast?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|