A MultiThreading problem with mfc SendMessage
Hi, i have done my own video player which support lot's of video
format.....throught direct show or own source code....
but i have a small problem with a SendMessage...
User can perform 3 actions Play, Pause and Stop.....
* Play launch a thread and an SetEvent(E_PAUSE) to release it because thread
loop begin with a WaitForMultipleObject of E_PAUSE or E_KILL
* Pause ResetEvent(E_PAUSE)
* Stop ResetEvent(E_PAUSE) and SetEvent(E_KILL) and wait for Thread
Terminaison throught a WaitForSingleObject of E_END
The thread could be describe as :
WaitForMultipleObject of E_PAUSE or E_KILL
...DateTimePicker control crashes application
I have a dialog box that contains a DateTimePicker control (control is
named dateTimeCtrl) to allow the user to select a date. I have added
an event handler DTN_DATETIMECHANGE for the control. In the body of
this event handler, I have the following code:
<begin code snippet>
monthCalCtrl = dateTimeCtrl.GetMonthCalCtrl();
sysTime.wHour = sysTime.wMinute = sysTime.wSecond =
sysTime.wMilliseconds = 0;
selectDay = sysTime.wDay;
selectMon...Move a dialog based application without the title bar
I have created a dialog based application without a title bar, and
want to move the dialog using the left mouse button.
I tried MoveWindow nut the window was streching instead of moving !!!
Can anyone help me please?
>I have created a dialog based application without a title bar, and
>want to move the dialog using the left mouse button.
>I tried MoveWindow nut the window was streching instead of moving !!!
MoveWindow can resize and move the window, so you've got a coding
If you use SetWindowPos you can specify the SWP_NOSIZE option to have
it ignore the cx & c...Cannot insert Chart in Excel 2007 and all other Office 2007 applications
In Excel 2007, click on Insert, just click on any type of chart buttons,
nothing appears. Then click on the drop-down error on any of the chart
buttons, click All Chart Types, then click any of the chart type button on
the right, click OK, the error "Some chart types cannot be combined with
other chart types. Select a different chart type." Then go to any Office
application, such as Word or Powerpoint, Insert Chart, it gives the same
I Googled, quite a lot of people are experiencing the problem, some went to
the extend of deleting the userprofile and let Windows re-cre...font dialog box
I'm trying to reset my shortcuts, one of which is to reach the font dialog
box itself rather than the subentries. In Tools, Customize, Keyboard, what
do I set a shortcut for that will take me to the dialog box which let's me do
character spacing, font, and other things associated? I keep getting just
one facet of it.
What would I do if you weren't there?!
Look for the FormatFont command (in the All Commands category).
Note that if you are trying to reset all of the *default* shortcuts, the
Reset All button will take care of that...
I've been told that if DLL exported function is thread safe (i.e.
doesn't use global scope variables), than I can call that DLL function from
my EXE using multiple threads. I want now to ask what about internal DLL
functions (that exported DLL function calls)? Example:
__declspec( dllexport ) int MyDLLFunc(int val)
int addOne(int val)
What if multiple MyDLLFunc() (multiple threads) calls addOne()? Is this
yes, it's thread safe.....the only one problem which could occured is that
your function change a data stati...How to turn off "Application has requested runtime to terminate it in an unusual way"
This message dialog pops up in my application sometimes. How can I
turn it off and just let my app crash in such case ?
Thanks in advance.
"tom" <firstname.lastname@example.org> wrote in message
> This message dialog pops up in my application sometimes. How can I
> turn it off and just let my app crash in such case ?
You could do this:
I'm curious if the WritePrivateProfileString function works from various
threads and processes?
If I have multiple threads accessing (reading/writing) a single .ini file,
are there any issues? Or, does the OS handle this properly?
As in any multi-threaded solution, it's probably best that you use a critical section or mutex
object to synchronize access to the file between the threads.
"Dan Baker" <dbmail> wrote in message news:%23Vo4o%23DLGHA.email@example.com...
> I'm curious if the WritePrivateProfileString function works from vari...application error #2
Getting the following error in Outlook 98: the instruction
at "0x05eec473" referenced memory at "0x05eec473".The
memory couldn't be "read.
Can anybody help with this?
Not without more info;
Like Outlook version, mail service being used (Exchange, POP3, IMAP, HTTP,
other...) and the steps you took already to try to resolve the problem.
Tips of the month:
-Create an Office XP CD slipstreamed with Service Pack 3
"IgorR" <firstname.lastname@example.org> wrote in message
news:...Destorying modeless dialog
I am very new in MFC. I have created a modeless dialog box. it well show
when you click on the buttom "Show" on the main dialog form, I want to
write a code for the a "hide" buttom on the main dialog form so that when
you click on it the modeless box will disappear
I saw this on the net but I don't know where to put it in the code.
That's not hiding you are doing with that code. You are destroying it
To just hide it, use ShowWindow with SW_HIDE.
-- ...Help needed on CopyFile like dialog
I want to make a dialog just looked like the common file copy dialog in
Does anybody know how to make it? Or, is there any Class I can use to make
I tried to create a dialog with a progress bar on it , and it works
fine. But, how to show
a file transfering animate on my dialog? I mean , I'm not sure what is the
right way to
Thanks a lot for helping.
Nish [VC++ MVP]
"Gideon" <email@example.com> wrote in message
I have some experience with WORKERTHREAD multithreading. Not GUI threads.
With worker threads, you have a thread function which has to be a static
To be able to access classes and variables defined outside this thread
function, you pass a LPVOID and inside the function you cast it back to your
class you wish to access, correct?
Now, these worker thread loops can become very large. You can't use divide
and conquor, by spreading it over multiple sub functions, or can you? I
guess you can, but then all other functions have to be static too?
Of course.. stupid q...How to implement transparent static on dialog box?
I would implement a transparent static text to show
the status text of the progress on dialog box.
The background of dialog box is not default system color.
Originally, I set the bk mode of the static to transparent mode
and return a NULL_BRUSH in OnCtlColor() of dialog class.
It can fit my requirement if the static text is not changed.
However, the old text is not erased if the static text is changed.
I think I need to override some function to erase background first.
Which function do I need to override to erase the background?
or I need to implement my own static class to do so? and how?
...problem in making perticuler color transparent on an imaged dialog
I used below 3 line code to make perticuler color transparent on an
imaged dialog in OnInitDiaolog().
its working fine but it makes not to work "C" file, which is been added
to the project.
if i remove these 3line code C file works
if i keep these 3line code it makes my C file nowork.
SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) |
make pink color as transparent
any ideas...Linking Dialog box content with cells in "regular" sheet
How to link data in Edit box (from Dialog caption) with exact cells in
"regulal" Sheets? Or is there another way to link exact content from Dialog
sheet to normal sheet? For example, if I have number 200 in Dialog, I need
that exact number 200 on another ("regular") sheet to preform calculations
with it. thnx
...Two Dialog Resources, one dialog object?
Can someone please tell me if it is possible to have two dialogs in my
resource view that link to the same dialog object? or will I have to
implement a 'dialog functionality' object that is called from my event
I want to allow my users to choose from two different sized dialogs
(one large, one small) depending on their registry settings. The
dialogs would essentially be the same, with identical controls, just
Alternatively, is there any way to dynamically 'scale up' my dialog
whilst still allowing it to be edited in resource view?
I am using Visua...dialog box #2
how do i make a custom dialog box?
any help would be greatfully appriciated thanks!
Tom Ogilvy recently posted a list of resources for getting started with
> how do i make a custom dialog box?
> any help would be greatfully appriciated thanks!
Excel FAQ, Tips & Book List
...Move controls in dialog area
Bit of a newbie to VB.NET. I'm using 2003.NET. I have a project with a
number of controls, but I cannot move the controls around at design time
using the Up/Down/Left/Right cursor keys. I can drag the controls around
with the mouse only. What's going on here? I was sure I could do this in
VS2003.NET with my VC++ projects, but now I've even opened up one of those
projects and still cannot. Seems like I've changed some setting that I
I've tried (with control I want to move selected):
* Pressing arrow key
* Pressing arrow key + LEFT_SHIFT
I have a SDI MFC application and I would like to use a different thread
to do some work when a menu option is clicked and stop it when another
menu option is clicked.
Please tell me, How can I do this multi-threading?
> Dear friends,
> I have a SDI MFC application and I would like to use a different thread
> to do some work when a menu option is clicked and stop it when another
> menu option is clicked.
> Please tell me, How can I do this multi-threading?
> Thank you.
> Varuna....Debug Multithreaded DLL and Multithreaded DLL
I got an runtime error at the fstream read function each time I use
Multithreaded DLL, when I change it to Debug Multithreaded DLL, my
application works fine. I just want to know how can the runtime DLLs
affect the work of a standard function like fstream->read!!!, any
proposed solutions are welcomed.
It could be a timing issue. The "Multithreaded DLL" issue refers only to the C library
functions, and fstream is definitely not a C library function. I have seen quite
different behavior between FILE * and fstream in multithreaded environments, which has le...multithreading in openGL
Iam doing a program in OpenGL using C. It is related to
multithreading in parallel. Iam calling the create thread functions in
display callback function. The code is like this....
DWORD WINAPI fun1()
DWORD WINAPI fun2()
....modeless dialog boxes #2
I have a VS 6.0 MFC dialog-based application. The main dialog has an edit
box for displaying messages as things happen. A button on the main dialog
starts a modeless dialog. The modeless dialog has a 'DoIt' button which
executes a long process, updating the main dialog edit box. I'm finding that
the main dialog and modeless dialog are unresponsive as long as I'm in the
'OnDoIt' routine. I had thought that a modeless dialog box would essentially
run 'independent' of the main dialog but that doesn't seem to be the case.
What have I misunderstood? ...How to hide the dialog in a dialog based application..
I have a dialog based application which has MFC support.. (developed from
Now, according to the my database situation, i want to show / hide the dialog..
so, what should i do ? What i do currently is, inside, oninit i start a thread
and pass a dialog pointer.. now, after 500 ms of initialization, i will call
ShowWindow(SW_HIDE) to hide the dialog.. and to work in invisible mode..
but this is not a good way.. so, any other way to hide the dialog before
it gets shown.. ?? My exe should run in processes but it should not show
the dialog only..
Hope you understand my...Deadlocked on lock problem in sql with multithreading
i have created a window service with multithreading, but getting many
deadlocks on sql in one Stored procedure when i start this service,and after
that service does not do anything but in idle mode.
the details of exception is below.
Error :Wednesday, September 23, 2009 2:22:58 AM
1. Transaction (Process ID 68) was deadlocked on lock | communication
buffer resources with another process and has been chosen as the deadlock
victim. Rerun the transaction.
2. at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnect...replacing new and delete in MFC application
I am trying to replace the new and delete functions in my MFC derived C++
application - the reason is to find memory leaks - but I keep getting a
linker error saying that 'new' is already declared in mfc80.dll.
I obviously have to link with mfc80.dll, but how do I replace the new
I'm using MS Visual Studio Team Edition 2005. And it's a MFC C++ application.
Thanks in advance. !!!
I'm placing the following code in the stdafx.h file:
inline void * __cdecl operator new(unsigned int size, const char *file,