|
I am also thinking of developing a tool for this, because there are too many apps that use the always recommended, but wrong Mutex-Trick and therefore do not behave well in an multiuser environment . (Detailed discussion about this problem can be found in this article.)
The idea is to use one of the proposed API-Hooking techniques to catch the CreateMutex()/OpenMutex() call of the app. If the mutex to be created is the "instance mutex" we patch it's name, so it is no more unique when it should not be. To find out, which one is the "instance test mutex" you can use ProcessExplorer from SysInternals.com. Just look for Mutants in the address space of the process and if one of them seems to be the one we are searching for (often indicated by its name or an GUID as name). Then close it with ProcessExplorer and try to run another instance. If this works, you found the nasty thing.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
In Internet Explorer, when we have script in a page, which calls another page and open another window. Does IE create a script engine for individual page, or just using one script engine for the Applicaiton ?
|
|
|
|
|
Hi,
I woulde like to use Visual C++ with Internet environment, when I include the Iphlpapi.h in ---> When compile time it say it can find it! I look to my system (search) ... I only see the Iphlpapi.dll in c:\Windows\system\
Someone can say why my Visual c++ can not see it (Iphlpapi.h) or using the Iphlpapi.dll?
Where can I download the Iphlpapi.h?
Thanks for any help!
Anh Truong
|
|
|
|
|
You should DL the platform SDK from here: http://www.microsoft.com/msdownload/platformsdk/setuplauncher.htm
|
|
|
|
|
Hi,
I did try to download the Update Platform SDK, but always the web ask me to restart the system and after that I got the message: Can not create a Server object! That is why I could not download it!
Is there other way? What I would like to do is using Visual C++ program to search the IP address the PC it is resided, do I need that SDK Platform to do this function? If not, do you know which codes I should use?
Thank you for help,
ATC
|
|
|
|
|
Hi,
I tried several times, any time after the site ash me to restart the computer to change the setting system ... then it said: "Can not create a Server object" ---> I could not download it!
Do you know why? By the way, what I need is using Visual C++ 6.0 codes to read my PC IP address! Do I need that SDK Platform? If not, can you show me where or how I can use codes?
Thank you for help,
|
|
|
|
|
Hi,
I made a DLL with a bunch of registry functions (i.e. GetProfileString, WriteProfileString, etc.) and it is performing in a way other than I expected.
When my program uses my DLL to write to the registry, it is doing so in the folder of my program's name, not in the folder of my DLL's name.
Any ideas/solutions? Thanks in advance,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Is the following a legitimate exception throw..???
for(UINT i=0; i<m_nCount; i++){
try{
delete (myClass*)m_pStack[i];
}
catch(...){
if(m_pStack[i]!=NULL)
throw "Object doesn't exist";
}
}
Would this exception make sense to any third party using my class...???
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey -
The problem is that the exception handler could itself throw another exception. So, dont use the above code snippet.
For example : if m_pStack[i] referred to uncommited virtual memory, both references to m_pStack[i] would throw a ILLEGAL_ACCESS exception.
Hth-
V
|
|
|
|
|
What technique should I use then...???
I think it would be wise to use exceptions when deleting memory incase it's a bogus pointer...no...???
thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
i am a beginner try to make my own installer. how do i copy files to a directory that the user picks to install to?
|
|
|
|
|
Use the CopyFile function.
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
If my function has try and catch in it, do I put a return at the end of the catch block? I have a return at the end of my try block. My function returns an int.
Thanks,
ns
|
|
|
|
|
You should put the return outside the try catch block, otherwise you need to return inside the catch and the try. The point of the catch is that the rest of the try code will not be executed. I'd do something like this
int MyFunc()
{
int nRetVal = -1;
try
{
}
catch (...)
{
}
return nRetval;
}
Where -1 is a sensibile value to indicate failure, or to have no effect.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
Appreciate the response.
ns
|
|
|
|
|
I've looked in my .h file quite carefully, but dont see anything suspicious:
Compile error is:
c:\trainer\db2\dbclass.cpp(4) : error C2143: syntax error : missing ';' before 'PCH creation point'
and it points to the first line in the file...
Thanks,
ns
|
|
|
|
|
Probably something is wrong in your stdafx.h
Try to correct it and do a full rebuild
Concussus surgo.
When struck I rise.
|
|
|
|
|
Thanks,
I had a missing ; just like it said. It was not in an obvious place, but I did track it down. Learned how importannt it is to put #include <stdafx.h> before a #import directive, the hard way!!!
Thanks for responding,
ns
|
|
|
|
|
I am a beginner just jumping right in and was wondering if anyone new a way to call an external .exe from inside mc++ source?
|
|
|
|
|
spawn, CreateProcess, ShellExecute, WinExec, you have many options.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Surely I dont have to recreate the project from scratch? The sample code I am using isnt an MFC app, so I dont know wht all to add, or not add, since I am getting the compile error of #include windows.h , a no-no in MFC apps apparently...
|
|
|
|
|
What kind of database class are you wanting to add?
ADO should be as simple as adding the following to your CPP file
#include "stdafx.h"
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("littleADO") rename("EOF", "EndOfFile")
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Its what I had been trying to do to include support for a simple access db. i had the order of the #include and #import reversed, so wasted several hours debugging the errors I got. I thought I was missing something and needed more files to include or something. Thanks so much for the response,
ns
|
|
|
|
|
I only have these files in my added class in an MFC project:
#import "C:\\Program Files\\Common Files\\SYSTEM\\ADO\\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
#include "stdafx.h"
#include <ole2.h>
I get the compile error (for my added class:
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
What is missing or extra ?
Thanks,
ns
|
|
|
|
|
Move import line after
#include "stdafx.h"
|
|
|
|