|
RobJones wrote:
new threads that get spawned and dissapear show 100% priv 0% user..
Does this tell you anything?
100% priveleged says that it is executing a system call. 0% priv 0% user probablu means that the thread is blocked possibly waiting for a mutex or a thread to end using one of the Win32 API Synchronization functions for example WaitForSingleObject()
John
|
|
|
|
|
RobJones wrote:
machine goes into power save
Simple test, tun off power save AND screen save, does it still happen?
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
I had a TCP/IP prog that would gobble up the NP Pool, until the PC finally crashed. To cut a (very) long stort it was caused by Zone Alarm running at the same time, turning off ZA solved the problem, checking via some newsgroups I found I was not the only person to experience this.
So try the prog on a Vanila system, if possible format c: and a new instalation, if it works then you have the "solution" if the program still fails I suggest a trip to the pub!
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Ted Ferenc wrote:
try the prog on a Vanila system
I'll give that a try.. maybe your right. Something else maybe messing up my app..
Ted Ferenc wrote:
if the program still fails I suggest a trip to the pub!
I think im gona do that anyway..
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Often, it is easier and cleaner to simply create one (or more) thread at startup that sleep until an interval occurs, does it's processing, and goes back to sleep. The debugging is easier because you are not creating and destroying threads all the time and you don't have to deal with those issues surrounding thread creation. Consider the following thread function:
DWORD WINAPI BackgroundMailBoxMonitorThread(LPVOID pParams)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
BACKGROUNDPARAMSTRUCT *pParamStruct = (BACKGROUNDPARAMSTRUCT *)pParams;
DBConnection *pDBConn = new DBConnection;
if (pDBConn)
{
int iRunFrequency = 300;
if (pParamStruct->pApplication->GetUserTagValue("MailBoxMonitorBackgroundThreadRunFrequency",caSQLBuf))
iRunFrequency = atoi(caSQLBuf);
if (iRunFrequency < 30)
iRunFrequency = 30;
pParamStruct->pApplication->GetSQLStatement(6015,caInBoxSQLBuf);
if (pParamStruct->pApplication->GetSQLStatement(6010,caSQLBuf))
{
pParamStruct->pApplication->ParseSQL(caSQLBuf);
int iSeconds = 0;
while (!pParamStruct->bTerminateThread)
{
iSeconds++;
if (iSeconds >= iRunFrequency)
{
if (pParamStruct->pApplication->Connect2DB(pDBConn))
{
DBStatement *pStmt = pDBConn->ExecSQL(caSQLBuf);
if (pStmt)
{
CObList oAccounts;
MailBoxAccountInfo *pAccount;
while (pStmt->FetchNext())
{
pAccount = new MailBoxAccountInfo;
pAccount->m_lCompanyKey = pStmt->GetLong(1);
pAccount->m_cEMailSenderAccount = pStmt->GetString(2);
oAccounts.AddTail((CObject *)pAccount);
}
pStmt->EndSQL();
delete pStmt;
POSITION pPos = oAccounts.GetHeadPosition();
while (pPos)
{
pAccount = (MailBoxAccountInfo *)oAccounts.GetNext(pPos);
if (pAccount)
{
CheckMailAccountForActivity(pAccount,pDBConn,caInBoxSQLBuf,pParamStruct->pApplication);
delete pAccount;
}
}
oAccounts.RemoveAll();
}
pDBConn->Disconnect();
iSeconds = 0;
}
}
Sleep(1000);
}
}
else
{
LogBackgroundProcessError(3,"Mailbox Monitor Company List SQL Statement Not Found!",pParamStruct->pApplication);
}
delete pDBConn;
}
if (!pParamStruct->bTerminateThread)
pParamStruct->hThread = NULL;
return 0;
}
It checks multiple mailboxes on an user-defined interval. It is NOT a UI thread, but sounds similar to what you are doing and if you need to update ui elements, you can pass messages to the foreground UI thread for screen updating.
onwards and upwards...
|
|
|
|
|
Due to the nature of this beast I have to create and destroy threads Other wise I would just create one thread per server and leave them open like you suggest..
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I am using a CtreeView, i want to know if multiselection is possible ?
(i would like to select many HTREEITEM with the Ctrl or Shift key)
ty
|
|
|
|
|
Nope. This is not possible.
Try and find on CP TreeCtrl derived class which handle this.
~RaGE();
|
|
|
|
|
This should help.. http://www.codeguru.com/treeview/multiple_sel.shtml
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
http://www.codeguru.com/treeview/multiple_sel.shtml[^]
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"
|
|
|
|
|
Hi,
I use a multiline TabCtrl in my mdi app, and to add an item i use InsertItem. The problem is when a line is complete, the first new line after the call to insertitem is invisible. The user need to click on a tab button to display the second line . I think it's because when i use InsertItem, OnSizeParent is not called. So I've tried to call
MyTabCtrl.Repositionbar(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,42,reposDefault ,rcClient)
but nothing happen
Any suggestioon ? Thanks you very much..
|
|
|
|
|
Hi All
I was looking for information about how the file can tell its type not depending on the extension. I found out every file has its own identity number ( magic number ) or some sort of id for that file to easy to tell this file is pdf file, doc file, tiff file and so on...
I wonder can anyone give me the link to the list of file extension with its magic number.
such as
File type Typical extension Hex digits(xx = variable) Ascii digits(. = not an ascii char )
Bitmap format .bmp 42 4d BM
FITS format .fits 53 49 4d 50 4c 45 SIMPLE
GIF format .gif 47 49 46 38 GIF8
Graphics Kernel System .gks 47 4b 53 4d GKSM
IRIS rgb format .rgb 01 da ..
ITC (CMU WM) format .itc f1 00 40 bb ....
pdf %pdf
|
|
|
|
|
A search on google returns several resources, one of which is found here. Remember that magic numbers are not always a guarantee that the file is of that type - they are certainly not compulsary on every file, and sometimes may even be a string located anywhere in the file. If you have access to a Unix machine then you can also find another list in /etc/magic and you might find it useful to look at the code for the unix 'file' utility which tries to determine the type of a file using magic numbers
|
|
|
|
|
Thank you both but I found those links already.
<br />
Remember that magic numbers are not always a guarantee that the file is of that type - they are certainly not compulsary on every file, and sometimes may even be a string located anywhere in the file.
So what is it to tell the file type if magic number can't be guaranteed? there gotta be something that can tell the file was created by which application.
|
|
|
|
|
|
pnpfriend wrote:
there gotta be something that can tell the file was created by which application.
Not even close. A file's format is important only to the application that created it. The fact that you can open a file and find a particular signature is purely coincidental.
|
|
|
|
|
remember that nothing HAS to be as it should
try renaming a txt file to bmp and opening it in paint
u get the "invalid file format" type msg
"penguins have no bill" biz stuff about me
|
|
|
|
|
try www.wotsit.org[^] for a list of numerous file formats
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Is there a better way to increase build numbers than manually through
resources? Am I just dense?
I'm using VC++ 6.0
BW
"I don't remember, but I know we played together because I've seen the posters." - Joe Walsh talking with Ozzy Osbourne about touring together in the 70's
|
|
|
|
|
|
thanks for the link.
Why wouldn't they add that as an option under build?? Any clue?
BW
"I don't remember, but I know we played together because I've seen the posters." - Joe Walsh talking with Ozzy Osbourne about touring together in the 70's
|
|
|
|
|
brianwelsch wrote:
Why wouldn't they add that as an option under build?? Any clue?
That is a mystery to me because it is not very difficult to implemnt..
John
|
|
|
|
|
Here is another example:
http://www.flounder.com/incrementing_build_numbers.htm
|
|
|
|
|
Gracias!
BW
"I don't remember, but I know we played together because I've seen the posters." - Joe Walsh talking with Ozzy Osbourne about touring together in the 70's
|
|
|
|
|
I'm trying to use the Enhanced CPropertySheet from the "Free size and extended styles in CPropertySheets" article, but when I call CPropertySheetEnh::OnInitDialog() from my property sheet's OnInitDialog() I get the error:
CPropertySheetEnh::OnInitDialog' : illegal call of non-static member function
Anyone know why?
|
|
|
|