|
Exploring the alternatives... since the routers between LAN and internet are the problem, how about Zeroconf/UPnP (or another application level protocol) that would allow incoming TCP data streams. I am not sure if it is an option in reality.
|
|
|
|
|
Well, I didn't want to go that way, but I'm going to be out of options very soon, it seems. Thanks for the replies.
|
|
|
|
|
Is it possible that your Ethernet hardware does not have a controller? Should not PHY only adapters use CPU to move data?
|
|
|
|
|
I am having a VC++ MFC Dialog based application,where I have a module in which
some Convertion function takes place.Here it has to convert some 10 groups.Each group i.e 10 groups are split into 10 functions..for example:
function1()
{
//code
}
function2()
{
//code
}...and so on..till
function10()
{
//code
}
Here these codes are written for "convertion form".I have provided a button from the main form."Convert",if I click on that it will process all the 10 functions, converts and the converted 10 values are displayed in 10 edit boxes in the convertion form once the convertion is over.In between,when the convertion is taking place I have also placed a dialog box which says it is in progress.
Now I want to add a progress bar in this dialog box so that along with the message,the progress bar can show how much is completed..Can anyone please suggest me how to achieve this solution..
|
|
|
|
|
kokilag wrote: Now I want to add a progress bar in this dialog box so that along with the message,the progress bar can show how much is completed..Can anyone please suggest me how to achieve this solution..
Just add a progress bar control to the dialog's template (i.e., the .rc file). Associate a CProgressCtrl member variable with that control. Call its SetRange() method.
"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 David said use CProgressCtrl::SetRange with the values 1 and 100.
Call CProgressCtrl::SetStep with a value of 10.
After each function completes call CProgressCtrl::StepIt to advance the progress control.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
OK..but where should I include the progressbar..Is it in that dialog?and these statements,ie..
CProgressCtrl::SetRange
CProgressCtrl::SetStep
CProgressCtrl::StepIt
Should I include these statements in Create function of the progressbar i.e,
void fun()::CreateProgressBar()
{
}
or in
void fun()::OnOutofmemoryProgress1(NMHDR* pNMHDR, LRESULT* pResult)
{
}
coz once I drag the progressbar from the toolbox into the form and double click on that,then the above function,i.e void fun()::OnOutofmemoryProgress1(NMHDR* pNMHDR, LRESULT* pResult)
{
}
will be taken by default.So what should I go?
|
|
|
|
|
Drag the progress bar onto the dialog.
Right click on the progress and select Add Variable.
Add a variable of type CProgressCtrl , let's say prg
In the OnInitDialog function of the dialog class do prg.SetRange(0, 100); and prg.SetStep(10);
In the place where you're calling your functions you call prg.StepIt() .
function1();
prg.StepIt();
function2();
prg.StepIt();
function3();
prg.StepIt();
.
.
.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Ok...I have tried whatever you told,but I have a problem,I have added the progressbar in the intermediate dialog,the function defination and the function body for each value is in "Convertion form" for convertion,so if I have to include a m_prg.StepIt() or prg.StepIt() after each function,the m_prg variable must be recognised by convertion form,but it is added for the progressbar which is in the intermediate dialog.So now how to use the variable defined in one form by the other?Because it I use m_prg.StepIt()statement after each function in conversion form,It says the variable m_prg is not declared.So how to do it?Please tell me.
|
|
|
|
|
You can either make the m_prg variable as public as access it from the other dialog or you can create a public function in the intermediate dialog which calls m_prg.StepIt() and call that public function from the main dialog.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I tried as you told..
I have put the
m_prg.SetRange(0,100);
m_prg.SetStep(10);
in the initDialog() of the intermediate dialog.I have create a function connect() here as
void CProcessDlg::connect()
{
m_prg.StepIt();
}
and I have defined the m_prg as above..and then after each function in the convertion form,I have put the bellow statement
CProcessDlg::connect();
It should work right?
It is executing,no error or anything,but the progressbar should show progress na,but nothing is happening..where did I go wrong?
|
|
|
|
|
kokilag wrote: ...the intermediate dialog...
This was not mentioned in your initial post. How many dialogs are there, one or two?
"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
|
|
|
|
|
K..I will try that method..oops..sorry the dialog which I mentioned in my earlier post..I called it as an intermediate dialog.
|
|
|
|
|
kokilag wrote: ...the dialog which I mentioned in my earlier post..I called it as an intermediate dialog.
Is it used just for displaying the progress bar?
"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
|
|
|
|
|
Yes..I have created a dialog box just like a message box,which will be displayed with a message saying.."Processing...pls wait" when the convertion takes place.Now I am trying to put a progress bar there so that with the message we can also know how much is completed too while it is processing.
|
|
|
|
|
So just create a modeless dialog with text and a progress bar right before the processing starts (Create() ), update it in the processing loop (SetPos() ), and destroy it afterwards. It's really quite simple.
Here are a few examples:
Tutorial - Modeless Dialogs with MFC[^]
Modeless Dialog Boxes in MFC - MFC Tutorial Part 6[^]
"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
|
|
|
|
|
Thank u for the material.But one was in VC++.Net.Can I get some solution purely in VC++ MFC because I went through the articles.Sorry,I never found much details regarding the solution.Can u pls suggest me..
|
|
|
|
|
kokilag wrote: Can u pls suggest me..
I already have. Create a modeless dialog, having text and progress bar controls, right before the processing starts (Create() ), update it in the processing loop (SetPos() ), and destroy it afterwards. It's really quite simple.
"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
|
|
|
|
|
Hello,
I have a DLL that expose an API that stream video (JPEG) to a window that I create and pass its handler as an argument to that API. The video stream is then display on screen. I need to break this stream into frames and do some task on them. How can I do it?
Thanks,
Eyal
|
|
|
|
|
I know that it works on the heap...
char * sz1 = "Text";
char * sz = new char[strlen(sz1)]; ...and I know that this will give me an error saying that a constant is expected:
char * sz1 = "Text";
char sz[strlen(sz1)];
...So is there some other way to create an array on the stack whose size is not hard-coded ? I've seen things like:
char char * szBuff[iSomeLargeNumber];
char * sz1 = "Text";
strcpy(szBuff, sz1); But no matter how large iSomeLargeNumber is, there's still a hard-coded limit... and declaring a large array on the stack uses the full amount of memory even if the full array isn't populated...(right?)
Is the heap the only answer?
As always, thanks for putting up with the nooB..
MZR
|
|
|
|
|
|
You could use
char * sz1 = "Text";
char* sz = (char*)<a href="http://msdn.microsoft.com/en-us/library/wb1s57t5.aspx">_alloca</a>(strlen(sz1));
but make sure you don't exhaust available stack space (starts at 1MB and decreases for standard Windows threads).
These days, Microsoft want you to use _malloca[^] instead - it's more safe apparently.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
In addition, you've don't have to free pointer allocated using _alloca or _malloca because stack will cleared when the function is returned.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
...though that 1mb limit is rather unfortunate, for my current project.
I'll have to use the heap after all, but it's a good thing to know for the future.
MZR
|
|
|
|
|
You can change the default stack size from the project properties.
Project Properties -> Configuration Properties -> Linker -> System -> Stack Reserve Size / Stack Commit Size.
Look at the documentation for the /STACK[^] linker option.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|