|
yes .. ur understanding is correct
Ajay
|
|
|
|
|
Thanks Ajay,
I think the DllMain will be triggered when LoadLibrary (or FreeLibrary) is invoked in a process or a thread inside a process. Are there any other functions which will trigger DllMain other than LoadLibrary or FreeLibrary?
regards,
George
|
|
|
|
|
You're correct for processes but for threads the ATTACH and DETACH calls are made when the thread is started and completed not specifically when the Dll is loaded. In other words you don't load a Dll for each thread that uses it but you should generally load the Dll before any secondary threads that will share it are started.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
In your experience, when will DllMain be called with parameter value DLL_THREAD_ATTACH or DLL_THREAD_DETACH? Could you show a simple sample please?
regards,
George
|
|
|
|
|
|
Great article, thanks Nibu!
regards,
George
|
|
|
|
|
I have downloaded an API and to use it in MFC program, the following line must be included.
#include <vips/vips>
using namespace vips;
but shows this error upon build
Cannot open include file : 'vips/vips' : No such file or directory
|
|
|
|
|
This has nothing to do with the namespace. It simply tells you that the file vips (strange, without any extention ?) doesn't exist in the directory vips.
|
|
|
|
|
I tried a test on other namespace like std typing
std::
will display some functions
but typing vips::, gives none
How will i include or make vips a recognized namespace?
What should i do to use it?
Thank you.
|
|
|
|
|
Did you read my post ?
This has absolutely nothing to do with the namespace. The error is simply there because the file is missing. Even without the namespace you would get the same problem. Just copy the files at the correct location and that should solve the problem.
|
|
|
|
|
Sorry cause I'm not that familiar with this.
How will I do that?
I have included vips.h in solution explorer.
I have downloaded this API from this link.
Hope you can help me.
|
|
|
|
|
Where did you copy the files on your hard disk ? The compiler needs to be able to reach the include files. Just adding them to your workspace doesn't mean that the compiler will be able to find them.
Now, I cannot tell you exactly what you need to do (depends on your project) but you can also add the path to the vips folder in your additional include directories ("Project properties" -> "C/C++" -> "Additional Include Directories".
|
|
|
|
|
BTW, are you sure the file is called vips and not vips.h ?? Because if I look at the examples on their website, for C they are including vips.h so, maybe it is a mistake from them. Check what files exactly are in the vips folder.
|
|
|
|
|
Check your computer for this file and also check path of file.
|
|
|
|
|
I had a code that used #include "fstream.h" in VC6.In the code i used
ifstream file ;//used file for opening and manipulating.
But when i opened the code in VC8 first it showed
"fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory"
Then i gave #include "fstream" as i saw in msdn.But now it is saying
"error C2065: 'ifstream' : undeclared identifier"
What is the mistake?
Thankyou
|
|
|
|
|
it should be
#include <fstream>
and you probably need
using namespace std;
or to declare it as
std::ifstream
|
|
|
|
|
I'd like to write an app runs like the wallpaper, it lays on desktop always, just like wallpaper, but it can also get mouse/keyboard messages, it that possible?
|
|
|
|
|
Good question.
There should be a way to do it (I do not know). I suspect that you will need to subclass the desktop window; meaning that all messages go through your app. There are articles at CP on code that does that, so they can do their customized look for the interface. Depending on what you are trying to accomplish, it could be some what more difficult than that but it is probably not.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
You can create an application with z-order bottom to do so. Or another idea is create window with parent as desktop list control. I am not so sure about the fine result, but I think it should work... Have a try..
- NS -
|
|
|
|
|
yes )
Really!
GetDesktopWindow() api can be used for this purpose.
Good Luck!
dlfkgj lsdfkglfkgjlfgl jldfk fldkk jk
|
|
|
|
|
Hi all,
How do I check if a string is valid for saving? for example string A contains document.doc that is valid but what if it contains ????.doc that is not valid, how can I check if it is valid or not?
Here is my code
if (!sName.empty()){
strAttachment.append(sName);
pAttach->SaveAs(strAttachment.c_str());
}
I need to add a checker before saving.
Thanks,
Jj
|
|
|
|
|
My first thought was to look it up; then I just tried to change a file name by adding a known invalid character and looked at the error message (seemed simpler). According to the message a file name under Windows XP can not contain \/:*”<>| . Therefore just scan the name for those characters, but I would still double check through the help system or online.
If you have the option of using regular expressions (not necessary), then you could write one to validate the string.
Good Luck!
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
Hi,
Hope somebody can help me.
I'm working on a program and i need to use VIPS API.
This is an image processing API.
Has somebody used this API on MFC?
Is it possible to use this on MFC?
I have followed online installation, but i can't find documentation on how to use it in a program. All it says is to include this part in a program
#include <vips/vipscpp.h>
vips.h and vipscpp.h is already included in the solution but when build,
Cannot open include file: 'vips/vipscpp.h' : No such file or directory
Any comment will be appreciated.
Thank you.
|
|
|
|
|
This really bothers me.
See, I have a class and two variables of the same class, CBuffer, named Buffer<t1> and RetBuf<t2>.
So, there's a line of code that says Buffer = RetBuf (class CBuffer has an overloaded operator = that takes another CBuffer<t3>& as argument).
So even in debug, the compiler generates the following code:
004B1E48 mov eax,dword ptr [ebp+18h]
004B1E4B mov dword ptr [ebp+10h],eax
004B1E4E mov ecx,dword ptr [ebp+1Ch]
004B1E51 mov dword ptr [ebp+14h],ecx
WHICH IS COMPLETELY WRONG! Does anyone know why this may happen and how to fix such a thing? I already tried a rebuild without success.
All we long-time developers should know that unless there's an overload that takes a CBuffer<t3>& as argument, this operation is impossible. But there is one such overload, though, although the compiler does not generate code to call it, but instead perform pointer assigns! It's like it's thinking they're pointers, and therefore trying to assign the RetBuf pointer to the Buffer pointer, which again is not possible since there's no cast and they're different types! This boggles my mind! What IS the compiler doing?!
|
|
|
|