DisableProcessWindowsGhosting() is supported with XP SP1 and later. If your app must support older Windows versions, you must check the version. You can use late binding by getting the function address with GetProcAddress()[^]:
typedefvoid (WINAPI* LPFN_DisableProcessWindowsGhosting)();
HINSTANCE hInst = ::GetModuleHandle(_T("User32"));
LPFN_DisableProcessWindowsGhosting lpfnFunc =
TRACE("DisableProcessWindowsGhosting() is not supported\n");
This will also solve your problem regarding the old SDK header files.
well, you asked the question in the correct spot - on that article
Asking it here (again) is superfluous - if you dont get a response from hackzai you may have to narrow the issue down to a piece of code, and then post a specific question here with that code, rather than such an open question
I would like to build a self extracting .exe in Visual Studios c++ 2012.
Does anyone have a working solution for VS2012?
I checked projects like LZMA (7-zip SDK), but it doesn't seem to mention self extracting '.exe' anywhere.
I check NSIS and inno-setup, but those product don't seem to offer 1 click install.
I checked 'Chilkat v9.4.0' but that is not free!
Those codeproject.com files are so outdated that they give me a lot of errors in VS2012:
I have found a very interesting incident of memory leak in my code. Although I have not been able to find the root cause of the leak still thought to share with you all. I will really appreciate any help on this. I am rather curious to know how come a memory leak can be seen in use of CString in such a simple way.
We have a thread function:
The shown code part of CopyLogToFileByThread() does not change a CString object. So this can't be the source of the leak it is from a CString object.
It seems that you are accessing the m_strLogLineCString object by multiple threads. When doing so, you must use locking. To do so, you may add a CCriticalSection member to your class and use this for locking:
Games like need for speed doesn't use the usual windows messages system. Your application responds when your window gets the message through WindProc and the message loop. The way which is used in games is entirely different.
I had an error in my project created with QT and C++
I created Server which gets data from AudioInput and gives it to UDP Socket, there is no problem, but in Client's project I had a problem, when I tried to write data to AudioOutput device after UDP Socket gets this data from net
in my project error was in this line "int l = audioSource->read(audioBuffer,input);" in
and this is Call Stack at time debugging which shows this
QtMultimediad4.dll!QAudioOutputPrivate::deviceReady() Line 579 + 0x1c bytes C++
QtMultimediad4.dll!QAudioOutputPrivate::qt_static_metacall(QObject * _o=0x00b53308, QMetaObject::Call _c=InvokeMetaMethod, int _id=1, void * * _a=0x00b51d20) Line 52 + 0x8 bytes C++
what I did wrong
//after this line it hase got error and goes to this one "int l = audioSource->read(audioBuffer,input)" //this isn't my code. it is code of QT
and error message is it:
"First-chance exception at 0x586d997a in networking.exe: 0xC0000005: Access violation reading location 0xab216d6b."
and call stack shows this:
"QtMultimediad4.dll!QAudioOutputPrivate::deviceReady() Line 579 + 0x1c bytes "
Access violation means that it is trying to read a memory location that is not part of the application's address space. The only way to diagnose such an error is to step through the code with your debugger and see where the bad address is getting set, or where a good address is getting overwritten.
The first few comments on that link talk about the project not working for Windows XP if compiled in VS10. Any chance, anyone else has come across this and has a solution? I see the comments but my project compiles in VS10, runs fine on Vista, 7, & 8 but crashes on XP and I cant figure out from the comments what Im doing wrong.
Please let me know. If you have a revised bcmenu.cpp file that you can email me, that would be great.
It is possible that the thread actually finishes/terminates between the if and the join but it won't cause an error. Even if the thread terminates the kernel maintains the thread handle and/or a result object (with the thread exit code) that can be waited (and queried for the exit code). If the thread has already terminated when you call join then join returns immediately without problems.
On windows (Winapi thread functions) you can have multiple handles to the same thread and when the thread terminates all handles become signaled and you can wait any of the handles any number of times until closing the handles. On unix like systems the pthread api is more restrictive: you get a thread handle when you create a (non-detached) thread and you have to wait exactly once and only once for the thread handle. If you don't wait for the thread handle then it causes a leak, if you wait for it multiple times then its an error. Waiting for it once gets the exitcode from the temp object (associated with the thread handle) and also frees this temp object.
Both behaviors can be simulated by a framework but C++11 chose something that is near to the unix philosophy (as implementing that on all platforms is simpler and more performant and usually enough).
i have this Problem in custom CHeaderCtrl control.
My message map look like this: BEGIN_MESSAGE_MAP(CHeaderCtrlEx, CHeaderCtrl)
Now i want to send a message to this header control but they never received it,
i never had this before so i don't know what cause this?
In a example Project here from codeproject work this "custom header control" very nice, no problems, only in my project?
So what to check, where can be my mistake, what im doing wrong??
I am not able to create MFC dialog, when the resources are loaded from another language. The dialog gets created if the language is English. I have added a string in the dialg, CLASS "Singleton Application". And in the code, i do a RegisterClass with this class name. Also i am setting the correct AfxSetResourceHandle. If i remove this "CLASS" entry, i am able to create the dialog in other languages. Any pointers would be helpful....
DoModal is called on a modal dialog, and CreateDialogIndirect is used to create a modeless one; the two are quite different. Maybe it would be better if you showed exactly what you are doing and where the error occurs.
Greeting Of The Day!!!
I am trying to communicate between MFC DLLs. But I got _CrtIsValidHeapPointerUserData() error and I know it is memory heap wastage problem I have done to findoutmemory leak problem from CMemoryState structure with CheckPoint. and #define new DEBUG_NEW also But Now it will give me that error at a time of FreeLibrary or accessing that's function . Plz help me
There are 2 DLL s
First DLL is XMLFILEINTERPRETAION.dll which gives us a Unicode Value and letter id of given each iscii value according to selected script(Devnagari,Gujrati,Gurmukhi,Gujarati,Bengali,Oriya,Tamil,Telugu,Malayalam and Kannada)) from xml file. letterid means English letter which typed by user using Executive keyboard.
Second DLL is DictionaryDataComputation.dll which provides us all dictionary words and we give some suggestion related to given word .And we use first dll for getting suggestions in unicode words and corresponding to english words .if these suggestions are not exist in DLL then these will be display otherwise not .and if user click on these suggestion then these add in my script Dictionary which also build in XML format.
I have used some technologies like DLL, EXE, CArray Template Collection, and MSXML2::DOMDocument for all manipulation (insertion and deletion of nodes) of xml files, Binary Recursion Search Algorithm for sorting and searching in ascending order in xml file.
Whenever I use freeLibrary function then provides this error. if I disable this functionin my code then at first time it does not give any error but this error appears in second time when we are using call DLL function of First DLL.