|
Hi All,
I have created a Mutex Object using
CreateMutex(...) Api, in One Machine and i want to Open the Mutex Handle what i have Created using
OpenMutex(...) Api, because Mutex Handle is Accessed across the Boundaries.
But I am not able to Open the CMutex Object what i have Created.
Please provide a Snippet of code to Open the CMutex Object from Different Machine.
uday.
|
|
|
|
|
Mutex's are not designed for this behavior. If you want to synchronize information across network boundaries, you will have to come up with your own techniques (or google for some).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi zac,
CreateMutux(...) will have inherited Handle as the first parameter in the API what is the use of the Parameter.
Please tell me the Use of the Security Attribues in Mutex. Will this help to Open the Mutex Across the Boundaries.
If yes then give me a snippet of Code.
Uday.
|
|
|
|
|
Security Attributes lets you change how inherited mutexes will behave. This is a machine dependent operation, though. There is no security attributes that will let you create a mutex that is valid between two machines.
See MSDN.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi all,
I downloaded an example of modeless dialog
for measurement studio. Now it works but
when i click on the parent window it gets
the focus but the child window remains the foreground
window.
I think i have to call ShowWindow with a different
parameter respect to SW_SHOW but i'd like
to have some hint from you.
Sincerly yours,
Desmo16.
|
|
|
|
|
moreover if i minimize the child window
the parent window is minimized too, while
i don't want that.
|
|
|
|
|
Desmo16 wrote: ...when i click on the parent window it gets
the focus but the child window remains the foreground
window.
Exactly what did you expect to happen with a modeless dialog?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I supposed that while a modal dialog
won't let you activate the parent window,
a modeless dialog will let you give the focus
on the parent window by clicking on it, and that
the parent window return to the foreground when
you click on it, so that you can use both the
windows, but I've seen in the Measurement Studio example
and also in the Visual Studio .NET Samples that
the modeless dialog stay always on top.
Maybe i'm a little bit confused
Anyway is there a way to take on top the
parent/child window every time i click on it ?
Thanx in advance,
Desmo16.
|
|
|
|
|
Hi,
I have created an application in vc++ using mfc. The application connects to Access database. I have used DAO. The application is multi-user one. It works like this:
When the user creates a new account, a new .mdb file is created and then two tables and fields are created at runtime.
It has editable listview control, graphs -pie chart/bar graph, a password-hashing algorithm.
Some of the class I got from CodeProject and then modified them to my need.
The program does not use registry keys or any complicated programming.
I did most of the program on one xp system. I had to change the system due to some reason. When I was working on the new XP system, the computer would restart by itself. It wouldn’t happen at regular intervals. I assumed that there was something wrong with the system. After a while it totally crashed.
I switched back to my old system and completed the program. When I send it to a friend, he worked the program for a while, after which his computer too started restarting by itself.
I worked the program on two other systems, but nothing happened.
I am wondering why is the system failure occurring on some systems.
I just can’t understand whether it is my program that is causing this to happen. If so, why is it not happening in all the systems? The program does not use the windows registry or any complicated codes.
If anybody knows about this please help.
Thanks,
Tara
Fortitudine Vincimus!
|
|
|
|
|
Have you checked if the memory is OK? Try memtest.
|
|
|
|
|
pgrohs wrote: Have you checked if the memory is OK?
Please can you tell me which memory.
pgrohs wrote: Try memtest.
I do not know about memtest. Please can you explain in a little more detail.
Is the problem with my program?
Fortitudine Vincimus!
|
|
|
|
|
Look at http://www.memtest.org/.
This is a tool that checks your RAM. It happens that programs crashes without an obvious reason. In that case it is useful to check the memory to exclude a hardware problem.
|
|
|
|
|
Why is it that it on the two system that I worked on nothing happened, but on a third system, the same program is behaving this way?
Fortitudine Vincimus!
|
|
|
|
|
What do you mean with "system"? The OS or the hardware?
|
|
|
|
|
The OS,I guess, Windows XP
Fortitudine Vincimus!
|
|
|
|
|
This is what is showing on my computer that crashed.
Windows could not start because the following file is missing or corrupt:
<Windows root>\system32\hal.dll
Please re-install a copy of the above file.
Did my program cause this to happen?
Fortitudine Vincimus!
|
|
|
|
|
Just google a little bit.
|
|
|
|
|
I did google. Mostly what comes up is: people have the same program. They are told that it is because the system heats up too much or because of windows update restarting the system. Thins like that.
I need to know whether there is something wrong with my program. Is there any remote possibility that my program is causeing this?
I am finding it difficult to figure it out because on my system the program works fine. Its working fine on another computer too. Does that mean anything? That nothing is wrong with my program.
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: They are told that it is because the system heats up too much or because of windows update restarting the system. Thins like that.
So have you ruled both of these possibilities out?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I do not know what to think. I managed to reinstall windows on the system that crashed and worked my program again on it for a long time and nothing happened. It has not restarted at all. So I am totally confused. The program has to work on the clients system...
Fortitudine Vincimus!
|
|
|
|
|
You would have to be doing something awfully odd to crash a properly configured XP system by anything you're doing. On the other hand, this is MS; if there is a way to 'tard something up they'll find it.
What exactly did you have to change on your system? Do these systems that are crashing crash under heavy load from other apps? Do you have spyware / trojans / viruses on these machines?
|
|
|
|
|
earl wrote: Do these systems that are crashing crash under heavy load from other apps? Do you have spyware / trojans / viruses on these machines?
No. The sysems are properly protected.
earl wrote: You would have to be doing something awfully odd to crash a properly configured XP system by anything you're doing. On the other hand, this is MS; if there is a way to 'tard something up they'll find it.
That is exacly what I thought too. And my program uses all the usual very simple dialog boxes, some calculation, no registry used, no dll's, no multiple threds, no internet connection....
I have added
AfxGetModuleState()->m_dwVersion = 0x0601;
at the begining to connect to dao360.
The best part is that on two other system no restarting has happened.
But of course, the client is going to blame my program if his system crashes.
Fortitudine Vincimus!
|
|
|
|
|
To use Cmutex Object , Any headerfile have to include ?
I have not include Header file .
I'm geating error :
----------------------------------------------------------------------
lets : CMutex g_m;
- - - - - - - - - - - - - - - - - - - - - -
E:\Project-MFC\UiThread1\UiThread1Dlg.cpp(17) : error C2146: syntax error : missing ';' before identifier 'g_m'
E:\Project-MFC\UiThread1\UiThread1Dlg.cpp(17) : error C2501: 'CMutex' : missing storage-class or type specifiers
E:\Project-MFC\UiThread1\UiThread1Dlg.cpp(17) : fatal error C1004: unexpected end of file found
------------------------------------------------------------------------
Thanks to all.
-- modified at 6:02 Monday 10th July, 2006
|
|
|
|
|
#include <afxmt.h>
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Yes it is working. Thanks a lot.
|
|
|
|