|
Create a guid by using guidgen.exe and check this code ->[^]
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
I solved the problem patially by following the above link. Now my problem is:
If I close one instance the other instance is also closed. How to fix this?
|
|
|
|
|
pix_programmer wrote: If I close one instance the other instance is also closed. How to fix this?
How it is possible ??
Are you using this code in InitInstance.
if (g_SingleInstanceObj.IsAnotherInstanceRunning())
return FALSE;
If you are using this code in InitInstance than another instance is not getting created but the running instance is not getting closed.
Please share your code.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
I've not used the above code. I used the following code.
if(NULL != ::CreateMutex(NULL, TRUE,_T("{AFD2966D-9A83-4E3A-9C9E-CD81E96D819A}")))
{
long dwError = ::GetLastError();
if(dwError == ERROR_ALREADY_EXISTS)
EndDialog(NULL,IDOK);
}
By instance I do not mean same application instance. If I close app1, app2 is also closed. What to do?
|
|
|
|
|
pix_programmer wrote: If I close app1, app2 is also closed. What to do?
What do you mean app1 and app2?? Are you talking about instance of same application??
If CreateMutex is fail than it returns NULL and you are checking that if it is not null than you are checking GetLastError.
if(NULL == ::CreateMutex(NULL, TRUE,_T("{AFD2966D-9A83-4E3A-9C9E-CD81E96D819A}")))
{
long dwError = ::GetLastError();
if(dwError == ERROR_ALREADY_EXISTS)
{
EndDialog(NULL,IDOK);
return FALSE;
}
}
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
If I read your correctly, the name of mutex should be unique ,pass some unique string while creating first instance of app1,app2 and so on. the reason you are getting problem you are using the same mutex name for all the application.
HTH
|
|
|
|
|
WM_NOTIFY is submitted to control's parent window, is it possible to submit the message to control itself instead of its parent?
the control currently used is CRichEditCtrl.
.
|
|
|
|
|
Maybe try overriding OnChildNotify()
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks, it may work even I haven't test in detail.
|
|
|
|
|
Try with ON_NOTIFY_REFLECT/ON_CONTROL_REFLECT, see here[^] for details.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
OnChildNotify() works perfectly in my case - I guess it also works fine for other controls.
|
|
|
|
|
what is good init point (message) for subclasses of controls (such as CEdit, CStatic) of a CDialog?
the init point is not on OnInitDialog(...) of the dialog, but inside subclass of controls.
OnCreate(...) of the control is not working.
what point (message) do you use when you initialize a control inside its subclass?
|
|
|
|
|
includeh10 wrote: OnCreate(...) of the control is not working.
Do you have ON_WM_CREATE() in your message map?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I use the boost regex library to parse the CString
#include "boost/regex/mfc.hpp"
But when build, the vs2008 writes "LINK : warning LNK4098: default library“MSVCRT”conflict with other library please use /NODEFAULTLIB:library"
but when I use the "/NODEFAULTLIB:library", then some obj of MFC control cannot find.
How to resovled it ?
modified on Monday, May 30, 2011 7:37 PM
|
|
|
|
|
This is just a warning, you don't have to resolve it, as a matter of fact you can disable it if you know you're overriding some of the MFC framework (which I believe the boost library does).
|
|
|
|
|
Thanks for your reply.
It's error.
When IDE cannot create "exe" file, the dialog shows "lost boost_regex-vc90-mt-gd-1_46_1.dll" if debug.
|
|
|
|
|
if it would be an error, it would say "error", not "warning"... maybe you have another error
|
|
|
|
|
My MSAA Hook dll is expected to be loaded into all process's memory. in 32 bits Win7 it works.
But in win7 64 bits some process can load MSAAHook.dll 64 bits cannot be loaded into some 64 bits process. Why does this happens?
= ::SetWinEventHook(EVENT_MIN,
EVENT_MAX,
m_hModule,
MSAAHook::WinEventProc,
0,
0,
WINEVENT_INCONTEXT | WINEVENT_SKIPOWNTHREAD);
|
|
|
|
|
A Windows process has to be homogeneous; you can't mix 32-bit and 64-bit code in a single process, Windows can't handle that. If your DLL works fine in a 32-bit environment, you'll need another one to get it working in a 64-bit world.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
actually, I have 64 bits hook dll for 64 OS. but this 64 bits hook dll cannot be hooked into all 64 bits process. I changed to source code, and give the SetWinEventHook function the process ID, but it still cannot set hook into the process. So I am very confused about this.
|
|
|
|
|
Hi,
I am able to write & read the data from serial port using buffer length pre specified. Is there any way by which I can read continous stream of data from serial port. I have tried to read the data from serial port using "ReadFile ()" in a while (1) {} loop. But my ReadFile () get blocking and I am not getting data after first read of buffer lenght is done.
|
|
|
|
|
Read here for serial port pointers.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Thanks a lot . Its really a nice article
|
|
|
|
|
It is, except for the horrible background color.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|