|
I just noticed what you're trying to do
Have a look at CreateDIBitmap() and SetDIBitsToDevice() . They will work with any bitmap format and will convert between them when displaying the bitmap. Slower than BitBlt() , but the performance will be substantially quicker than what you are doing here.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Looks like i am on the right way now. Thanks again.
|
|
|
|
|
How is it possible to correctly allign the seperate parts of a status bar under Win32? I know we have to create an array of ints each defining the right side of the part and send the SB_SETPARTS message. But what about alligning the parts on the right hand side?
I want my bar to look similar to this one http://www.codeproject.com/miscctrl/ProgressBar.asp[^]
The only method I can think of is by getting the status bar rect and setting the parts according to the width, but this kinda gets screwed up when it comes to resizing. Even so, in the picture there is a large space blank space before the parts which I am so far unable to reproduce.
|
|
|
|
|
waldermort wrote: I want my bar to look similar to this one http://www.codeproject.com/miscctrl/ProgressBar.asp[^]
<font color=blue>int</font> CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
<font color=green>
m_wndStatusBar.SetPaneInfo( 0, m_wndStatusBar.GetItemID( 0 ), SBPS_STRETCH, NULL );
<font color=green>
}
NOTE: Only one pane of the status bar can have this style set.
Nibu thomas
Software Developer
|
|
|
|
|
Hello
I want to ask how can i create a child process in Win32 as we do in linux with the help of fork().
Thank you.
We Believe in Excellence
|
|
|
|
|
CreateProcess(...)
Nibu thomas
Software Developer
|
|
|
|
|
|
I am not going to give you an answer, because you did no give an explanation of what fork() does. You have received a couple of answers about generating a child process.
What do you want to know precisely?
INTP
Every thing is relative...
|
|
|
|
|
I'm not a linux expert but I think fork() creates a new thread and not a new process. Am I right (not sure at all about that). The previous answers you get was how to create a process (so run another executable). If you want to run a thread in parallel, then you have to look for CreateThread[^]
|
|
|
|
|
fork() creates a new process - an exact duplicate of the current process, including the current code location. You can do this:
switch(fork())
{
case 0:
exit(0);
default:
break;
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Here is the discription of fork() function.
"fork creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0."
I wanted to do the same thing in win32. I do not want operating system to allocate saperate resourses to new process. Infact i want the process to share the same resourses that it's parent is using. Are you getting my point?
Thank you.
We Believe in Excellence
|
|
|
|
|
Look at CreateThread() . It's exactly what you're after. But read up on multithreading, because you obviously don't know a lot about it. It can be quite tricky to learn...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
There is no fork equivalent under Windows. I suggest you consider using threads rather than processes - that is the Windows way of handling concurrency.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Nemanja Trifunovic wrote: I suggest you consider using threads rather than processes - that is the Windows way of handling concurrency.
Actually, its becoming more and more the Linux way of concurrency.
NPTL is a stable working thread implementation.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
how would i go about that
martin reagan akula
|
|
|
|
|
|
your cyber cafe must have a VoIP client ( whtever the real name is ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi,
I want to do calcualtions on different datafile parallely, that is if i do on them sequencialy then Let say if it take one munite to perform calcualtion on file then it will take 60 minutes to perfeorm calculation on 60 files.
but i want that the calcualtion should be done in parllal so that i can reduce the calcualtion time on 60 files.
Any Idea?
I have a Uni processor machine
I hope you undesrtand my point
thanks
Regards.
|
|
|
|
|
Make a new calculation in a new thread. But you will need to read some documentation on, take a look at the MSDN (for CreateThread) or on this website.
But this won't reduce the total time because if you are running 60 threads in parallel (don't even know if this is possible), each thread will have less CPU time for its own so it will run slower thus it will take more time to finish. I don't think this is a good solution.
|
|
|
|
|
I do not know the answer, but I think there may be an article at CP some where. Depending on the operating system, compiler, and how you wrote the code it may already be doing what you want. Before asking the question you need to determine if both processors are handling the problem. Then you need to fuigure out how to hand off individule problems to each processor.
I know it does sound simple but it is not [realy].
INTP
Every thing is relative...
|
|
|
|
|
AFAIK, you wont be able to do this on a single CPU computer.
me think that in the best case scenario, you will have the same time, but in some other cases, it will take more time because of context switching between threads.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
After each file's contents have been read into a separate (heap) buffer, call AfxBeginThread() , passing it the address of the buffer. As each thread completes its processing, it will free the heap memory.
Since some of the earlier threads will have completed by the time the later ones are created, you probably won't have 60 threads in existance at one time.
Make sense?
Assuming you get this working, it would be to your benefit to benchmark it against your initial design using sequential processing. I would be surprised if the additional overhead of extra threads was of any real benefit.
"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 i can access to memory loaded
am
|
|
|
|
|
Be more specific.
INTP
Every thing is relative...
|
|
|
|
|