|
The Base Priority of a thread is determined by both the process priority class, and the thread priority. It's just two different mechanisms (one to weight processes in the system, one to weight threads inside one process)
Thread 1 will (almost) always get scheduled first when both are waiting for an event or similar.
The scheduler always schedules the thread of the highest priority that is ready to run. So Thread 1 will starve thread 2, if it doesn't give up processor time or a second CPU is available.
The one exception is: Input goes to Thread 2. When input waits in the queue for a thread, it's priority is temporarily boosted.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
(1)I have an array of pixels to be displayed. Does someone know how to do that?
{
....
char* pixelarray = malloc(sizeof(uint32)*width*height);
fill_in_content(pixelarray);
//how to display the pixelarray on the screen now?
}
(2) if I have an linked list data structure to represent the pixel
struct link_list
{
char pixelvalue[4];
link_list* next;
}link_list;
{
...
link_list* head
build_linked_list(head, width*height);
fill_in_content(head, width*height);
//how to display the content in the linked list to screen?
}
|
|
|
|
|
I'm no GDI expert but a pixel has three properties: X coord, Y coord, and RGB value. With these three values, you can render a pixel at a certain location in the desired color.
|
|
|
|
|
Either create it as a bitmap and use bitblt() or, if you really want to paint each pixel... SetPixel().
onwards and upwards...
|
|
|
|
|
SetPixel() will be slow though.
John
|
|
|
|
|
I created a CStatic subclass that handles ON_WM_KEYDOWN and can capture the key presses ok, but when a key is pressed it generates the beeping sound you usually get when a key press isn't being handled. If anyone knows how I can stop this or where I should start looking I'd appreciate it.
(Also if anyone knows how to capture arrowkey events please let me know, none of ON_WM_KEYDOWN, ON_WM_SYSKEYDOWN, or ON_WM_CHAR seem to catch them)
Thanks
|
|
|
|
|
I'd guess that it's the keyboard device driver intercepting the keystroke before passing it on to Windows.
|
|
|
|
|
Hey All,
Just wondering how I'd go about extracting resources from an MFC app i.e. Bitmaps etc.
Regards,
Brian Dela
|
|
|
|
|
Can't you load the EXE in Visual Studio as a file and get at them that way? I've done it with VS.NET, I can't remember if VS 6.0 supports that or not (I think it does.)
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Navin wrote:
I can't remember if VS 6.0 supports that or not (I think it does.)
Yes it does . It doesn't support re-saving on Win9x/ME though.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
Should have tried that.
Regards,
Brian Dela
|
|
|
|
|
How to make my app can not be seen from screen?
Any suggestion or direction are highly appreciated.
|
|
|
|
|
Well, you can always create an application that does not have a window. Even if it does has a window, you can always create it as hidden.
|
|
|
|
|
ShowWindow(SW_HIDE)
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
You could write a program using API and not use a window at all. In WinMain you can just do other things. I don't know how safe that is but I have done that once and it worked just fine for me. Well, that program was not for release.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
This is a fairly ambiguous request. Can you provide a small code snippet that shows what you are doing, and what a "stream" is?
|
|
|
|
|
;o)
Thanks, David.
I have solved the problem already.
I pass array of streams in function.
Managed C++ code:
[Serializable]
public __gc class MSGDATA
{
public:
...
MemoryStream * attachStream __gc[];
};
C# code:
MSGDATA pMsgData = new MSGDATA;
pMsgData.attachStream = new MemoryStream[HOW_MANY_ATTACHMENTS];
for (int k=0; k < HOW_MANY_ATTACHMENTS; k++)
{
pMsgData.attachStream[k] = new MemoryStream();
}
SendMail(pMsgData);
|
|
|
|
|
At the first of the stream you could add a header struct:
#define MAX_FILES 20 //Set to what you need.
struct StreamInfo
{
int nNumberOfFiles;
DWORD dwFileSizes[MAX_FILES];
}; When reading the stream the first sizeof(StreamInfo) bytes would be your structure.
Hope this helps...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hi,
Still trying to get familiar with MFC, please bare with me
I have a program set up so that a user can enter information into a edit box/control. I want to take that information and have it go to a list box/control so to form a scrolling list.
Can someone help me do this? I can't seem to figure out how to go about this.
Thanks in advance for all your help.
|
|
|
|
|
m_edit.GetWindowText(str);
m_listbox.AddString(str);
|
|
|
|
|
Does this go for controls that are on two separate windows? Does doing this allow for the data to be sent over two different windows in the app?
thanks for your help!
|
|
|
|
|
Yes, if they "belong" to the same application. For example, if you had a view with some controls on it (e.g., listbox), and a modeless dialog atop that with an edit control, you could very easily take the contents of the edit control and post a message to the view instructing it to add the string to its listbox.
|
|
|
|
|
One solution is messages. Send a message from the source window to the destination window.
Kuphryn
|
|
|
|
|
Thanks for all your help. Got the job done.
|
|
|
|
|
Hi,
Just a general question about spinners.
How come the spinner works in the opposite direction, or at least seems to go against what seems natural? When I hit the up arrow it counts down and vice versa? Can I change that around? How do you format the edit box to allow numbers only? Set precision on the numbers? letters only?
|
|
|
|