|
|
Up |
  |
Author: Manoj JangidManoj Jangid
Date: Feb 29, 2008 21:16
Hi
I am getting following below error and my application get crashed
please tell me how do I fix this problem, I am pasting my thread code
also
---------------------------------------------------------------------------------------------------------
Windows has triggered a breakpoint in TestMonitor.exe.
This may be due to a corruption of the heap, and indicates a bug in
TestMonitor.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
---------------------------------------------------------------------------------------------------------
code in my dll
UINT __cdecl CMyMonitor::MonitorThread(LPVOID lparam)
{
CMyMonitor* lpMonitor = (CMyMonitor*) lparam;
if(lpMonitor->m_bThreadRunning)
{
return 0;
}
|
| Show full article (1.81Kb) |
|
| |
1 Comment |
|
  |
Author: cschmalzcschmalz
Date: Feb 29, 2008 08:20
hello everybody!
i have a window displaying images. the particular image is requested
by a separate thread, which sends
a message, and waits for the "image ready" event.
the gui thread receives the message, loads the image and calls
Invalidate() and UpdateWindow(). some
time later, the OnPaint() method of my window is called. the very last
thing it does is to signal the "image ready" event.
now the worker thread takes a picture with a connected camera, and
this picture still shows the previous image or maybe something in
between.
so my problem is, how can i be sure that the image is being displayed?
does windows provide the information when it has finished a repaint?
|
| |
|
| |
7 Comments |
|
  |
Author: Lutz AltmannLutz Altmann
Date: Feb 29, 2008 08:11
Hi there,
i've a question related to the usage of the win32 c-runtime libraries:
I have a dynamic c++ library - this one is linked to the static
multithreaded runtime lib (non debug . \MT)
Now my question is :
When i use this DLL from another program - can there arise problems
when this program itself uses a different version of the c-runtime
lib - or is it uncritical?
i read that a mixture of non-debug and debug versions can cause
problems.
Thanks in advance,
Lutz
|
| |
|
1 Comment |
|
  |
Author:
Date: Feb 29, 2008 08:08
I have an app that does something like this to stay responsive
while waiting for a different thread to finish a task:
while( WAIT_TIMEOUT == WaitForSingleObject( hEvent, 100 ) )
{
while( PeekMessage( &msg, hwnd, 0, 0, PM_REMOVE ) )
{
// code to process message
}
}
This works great for the first few thousand messages the window
receives, but then the app starts eating privileged CPU time
(not user CPU time, according to PerfMon) like crazy. And, when
the 10,000th message is processed, other apps start getting
PostMessage() failures when trying to post messages to my app.
Unfortunately, calling GetLastError() after the PostMessage()
failure returns zero (i.e. NOERROR), so whatever went wrong is
apparently a secret. But...
|
| Show full article (1.71Kb) |
|
2 Comments |
|
  |
Author: FrancisFrancis
Date: Feb 29, 2008 06:14
Hi all,
I have a dialog containing some text in a rectangular area (static
text). The width of this area is always the same, so that means that
the minimum required height of this area can (in theory) be derived
from the amount of the text inside.
I am aware of functions like GetTextExtentPoint32 and I could do the
math myself, but I feel that this may not me the optimal approach as
there could be other factors involved that I am now unaware of (text
representation programming can be a complex thing).
Is there an API function that can calculate this required minimum
height for me? If not, what would be the recommended approach to solve
this?
Your insights will be much appreciated,
Kind regards,
Francis
|
| |
|
2 Comments |
|
  |
Author: GiovanniGiovanni
Date: Feb 29, 2008 05:58
Hi, I hope this is the right group, even because my question concerns
Internet Explorer that's fully integrated with OS.
However... I wisha retrieve the data stored by explorer through
autocompletition feature.
Where can I find them? Registry or somewhere in the disk?
Furthermore, are they simple text or I need some api to access them?
tnx in advance
|
| |
|
1 Comment |
|
  |
Author: FrancisFrancis
Date: Feb 28, 2008 08:59
Hi all,
I am developing an Internet Explorer Toolbar plugin. Today I have been
trying to add chevron support so that when the window width is too
small, a chevron is displayed instead of the remaining toolbar items.
This all works well, the chevron shows a nice popup menu. However,
since some of my toolbar buttons are menu buttons, the chevron menu
also contains submenus. And these are not positioned properly. I
programmed the menus so that they always appear under their
corresponding toolbar button. Now I need to add some code that checks
if the menu belongs to the chevron menu. If that is the case the
position must be aligned with its parent chevron menu item.
Now, my question is: how do I do this. I realize that what I need is
the client rectangle of the menu item in the chevron menu that brings
up the submenu. However, I don't have a handle to the chevron menu.. I
can't seem to find a working solution.
Would someone be so kind to shed some light on how to proceed in this
situation? Your help would be greatly appreciated.
Kind regards,
Francis
|
| |
|
7 Comments |
|
  |
Author: thomas.mertesthomas.mertes
Date: Feb 28, 2008 03:36
Hello
Recently I discovered some problem. I have some C code
which determines how many bytes are available in a
file. Later I use this information to malloc a buffer of
the correct size before I read the bytes.
Determining the number of bytes available in a
file is done in 5 steps:
1. Use tell(aFile) to get the current position.
2. Use fseek(aFile, 0, SEEK_END) to move to the end.
3. Get the current position with tell(aFile) (this is the
size of the file in bytes).
4. I move to the position which I got in step 1 with fseek().
5. Subtract the current position from the file size to
get the number of bytes available.
This code is certainly not the most elegant solution but
it is portable. The code works for normal files under
windows and linux. The portability is also the reason
why I use tell() and fseek() instead of windows specific
code.
|
| Show full article (2.23Kb) |
|
4 Comments |
|
  |
Author:
Date: Feb 28, 2008 03:20
Hello All,
I've got a ListView (in icon-view mode), and would like to be able to use
the right-click / double-click for my own purposes (currently I want to save
data attached to those entries to disk).
But although I connect to the listviews notification-message to the clicks,
it seems to still change my selection of the items. :-(
So, my question is : how can I disable the ListViews default right
mouse-button actions (and instead use my own).
I'm using straight Dll-function calls in Assembly (Borlands Tasm v5.0).
In a related question: as far as I can see the left and right mouse-buttons
seem to do, in icon-view mode pretty-much the same thing. Why's that ?
Regards,
Rudy Wieser
|
| |
|
6 Comments |
|
  |
|
  |
Author: sengsationalsengsational
Date: Feb 27, 2008 13:09
If you have wondered where to start looking when you would like to
programatically create a Windows scheduled task that will allow for
the system to resume from an S3 state or S4 state in order to run your
task, this post might help. It doesn't tell you how to code it, but
with what you find here and your favorite search tool, you should get
a good start.
It seems the windows AT command and the windows SCHTASKS command do
not allow for the management of the attribute that will allow the
machine to resume from a sleep state.
Instead, you would use the SetFlags method on
TASK_FLAG_SYSTEM_REQUIRED in the IScheduledWorkItem interface.
TASK_FLAG_SYSTEM_REQUIRED is 0x1000 or 4096 decimal.
SetFlags Method of the IScheduledWorkItem Interface:
TASK_FLAG_SYSTEM_REQUIRED
The work item causes the system to be resumed, or awakened, if the
system is running on battery power. This flag is supported only on
systems that support resume timers.
UI says "Wake the computer to run this task"
I hope this post turns out to be useful to folks.
|
| Show full article (1.69Kb) |
|
no comments
|
|
|
|
|