|
I am using Microsoft Vision SDK. I need to be able to open multiple bitmaps at onces, work on all of them and store the results as a txt file. Any ideas on how to cycle through all of the bitmaps opened and have a txt open/save dialog in addition to the bitmap one?
Your answer is greatly appreciated.
Ali Mustafa
ali@maiinc.com
|
|
|
|
|
I've viewed the related articles on CP about CPU Useage and have only concluded that ntQueryPerfomanceCounter..?(i think) Is the only way to return CPU useage.
I don't suppose this works(or there exists a workaround) for WIN98...???
Thanx a bundle!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
As far as I know, QueryPerfomanceCounter is the only way to obtain current CPU usage and according to the docs, it is compatable with W95 and W98. I believe there are few libraries around here that encapulate it. WFC is one.
|
|
|
|
|
Funny cuz I was just on CodeGuru and read a message thread with your name in it. I'll assume it was you, because the disscussion "CPU Usage".
Actually what i really wanted was CPU usage of each process.
I'm already using the RDTSC to perform code profiling and was curious if there was a way to return process usage (proportional to rest of system) as well. Turns out (so far anyway) that this would require a whole lot more work then i'm ready to put forth.
I'm assuming you'd have to count the clocks of each process at each task switch...?
In anycase, to much homework for me right now...
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Funny cuz I was just on CodeGuru
You bad bad boy!!!!
LOLOLOL
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I much prefer codeproject.
It has a far more pleasant interface, cooler colors and that little martian dude.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Well, it wasn't me writing because I haven't been there in ages. Was it referring to one of my articles ? I am not sure if they even have them any more. Could you point me to the thread ? I am curious now.
|
|
|
|
|
I believe is was someone referring to you. I dunno i'm uncertain myself.
I just thought it ironic that while lookin for info on process usage that an thread on CodeGuru had Rick York, then 5 secs later when I checked for messages...lo and behold theres your name.
I'll try and locate the thread but i can't make any promises. I found it originally through a google, so ican't exactly retrace my foot steps...
Ciao
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
That is odd !
I did a search at Google myself and found some odd things. FWIW, codeguru does still have all my articles but they don't seem to be linked to any more. Also, I am from Oregon and the Perry Mason's cases page is mine.
I did find one VERY annoying thing - some asian site has one of my articles posted with their copyright. I would let them know what I think about this but I couldn't find a place to do it.
My jokes page
|
|
|
|
|
Rick York wrote:
I did find one VERY annoying thing - some asian site has one of my articles posted with their copyright.
Could you not do a whois on the domain name..?
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Denial! That's what they all do.
Not guilty, they plead.
But Buster ain't gonna be happy with that.
I need evidence man, solid proof.
Now!
Ladies and gentlemen, this is the CP security force takin' over from here on.
nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Oh yeah ?
Show me the evidence that I was there buster.
Then we'll talk.
|
|
|
|
|
I have been searching for a 'SDI tab view' (something similar to Excel tabs, either at the top or the bottom of the window) for a while now. I found some on the Code Project website, but these are either MDI or can't resize.
Can anybody tell me, where I can find something like that?
Thank You
XP
|
|
|
|
|
By SDI you mean all views point to the same document ? Surely it would be trivial downgrade the code on CP to work that way ?
Personally, I think I'd use a formview, and a tabctrl if I wanted one document, and many selectable views.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Does a tabctrl work on a view? I thought it will only work on a dialog?
LP
|
|
|
|
|
A view is just a window, and a formview is built on a dialog template.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I've declared a worker thread as a static member of a given class:
UINT MyClass:Mythread(LPVOID pParam)
{
pParam->MemberOfMyClass = TRUE;
}
Then I begin the thread of execution:
m_hInputThread = AfxBeginThread(Mythread, (LPVOID)this);
I'm not sure exactly how I can provide AfxBeginThread access to the this pointer. I need to provide the worker class access to the members of the class.
Help and thanks in advance!
Philip
|
|
|
|
|
UINT MyClass:Mythread(LPVOID pParam)
{
MyClass *pClass = (MyClass*) pParam;
pClass->WhateverFunctionHere(...);
}
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Ahhh, that makes sense. Just to be sure, I would pass the object as follows, correct?
AfxBeginThread(Mythread, this);
thanks,
Philp
|
|
|
|
|
scgadgets wrote:
Ahhh, that makes sense. Just to be sure, I would pass the object as follows, correct?
AfxBeginThread(Mythread, this);
Yes. That's correct.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
From
char* cMyVar = "megabonus";
I want to copy the 3 first chars to
char myother[2];
But how?
I tried strncpy(...) but it's not the right function... or..
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
You need a 4-character array.
char myother[4] = {0}; // init to all zeros
strncpy ( myother, cMyVar, 3 );
It's important to init myother to all 0 because strncpy does not append a terminating null when the source string's length is equal to or greater than the # of chars you want copied (3 in this case).
--Mike--
#include <witty-sig.h>
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Hi,
I have following problem:
UINT CMyWorkerThreadsCoolFunction(whatever)
{
SerialFlowOfDataSusceptibleToHung();
}
<\pre>
I wanna let the user define the time interval between moment 0 and moment x he is ready to wait. Depending upon this he gets more or less data.
Question: how to achieve this?
Thanks
Pepe
|
|
|
|
|
Sleep (time_in_ms);
????
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Thanks for your answer, I must have not been clear enough, sorry for it.
This is all about communication over the serial port.
SerialFlowOfDataSusceptibleToHung() is a data stream from the external device, and it is itself completely blocking the worker thread from which the given read operation was issued, as a result of which another blocking command like Sleep(ms) is no solution to this problem.
In the majority of cases all the data can be read from the device in less than a second, but unfortunately in case the read operation hungs or slowly executes, the worker thread does not return for a long time.
My prog uses time sharing of the serial port between several worker threads (a command from one thread can only be issued after the previous from another thread has been completely executed, and thus the port has been freed)
If one of my threads blocks the port, all the communication of my other threads with the device is impossible.
That's why I wanna limit the maximum time of one thread blocking the one and only communication channel.
Limiting the time of a read operation does not affect the average thread, because it usually terminates quickly. But in case of a trouble (slowed down read) the user receives a little less data, but does not have to wait too long for it.
Thats why I wanna find a solution to limit the time of execution of blocked threads.
Thanks in advance.
Pepe
|
|
|
|