|
Thanks for your advice, Cédric!
I did not know for function pointer, we also need to define calling convention as well.
regards,
George
|
|
|
|
|
In fact it is logical when you think a bit about it. Your function is in your dll and you use it by calling LoadLibrary and GetProcAddress. To load the function you use a typedef in your exe to specify how the function looks like, this is the only way for your exe to know the function. So, if you don't specify on the function typedef that the function uses a __stdcall calling convention, the exe has no way of knowing that information.
|
|
|
|
|
Thanks Cédric,
Your description is very reasonable.
regards,
George
|
|
|
|
|
Hi Experts,
How can I traverse System Volume Information folder?
I also got the solution "You have to take ownership of the directory and its objects before you can enumerate them."
But how can I do that?
|
|
|
|
|
Didn't you ask this yesterday?
Iain.
|
|
|
|
|
|
Did you try do do it from the command line as I suggested?
|
|
|
|
|
Sir, But I want to do it programatically.
|
|
|
|
|
You'll have to read up on ACLs (Access Control Lists), search for it here on CP. There are some good articles.
|
|
|
|
|
I can load a BMP file into a CBitmap object.
The number of bits per pixel of image is 32.
How to change the number of bits per pixel to 16?
|
|
|
|
|
|
Hi,
I have an ActiveX component that I build using MFC. I use this component in my C# application. Every time I close my C# application, it generated this error:
Debug Assertion Failed!
Program: ...
File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp
Line: 1007
etc..
etc..
etc..
I do the debugging and it fails on this line:
#ifdef _DEBUG
ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);
#endif
I know it is not an important question, because if it is in release, it works perfectly.
But I was wondering, what can cause this problem?
Please note:
1. This error only occurs on my specific application.
2. When I build a new C# application. It works fine.
Any idea?
|
|
|
|
|
RYU^^ wrote: I know it is not an important question, because if it is in release, it works perfectly.
Probably not.
The ASSERT macro is disabled when you're building for release, which means that the problem is only disguised in release mode.
If you have a look at the surrounding comments in the wincore.cpp file, you'll find that this assertion is due to that the window handle has not been detached from the object handle map. When you use wizards to generate code for your application, as I assume you have, this assertion won't be triggered by the generated code. My point is that this is something else and I would bet my money on COM-related stuff.
If you put some breakpoints to check which window it is that's causing problems, I would expect it to be an unknown window from your point of view.
Some things to check up on:- Make sure that you release all interface references to your ActiveX when the application is closed.
- Make sure you calling
::CoUninitialize() for each time you've called ::CoInitialize() or similar. - If you're using a secondary thread that operates on the ActiveX, you have to set up the COM library for that thread as well by calling
::CoInitialize() / ::CoUninitialize() . Remember that you also have to marshal the interfaces to the secondary thread.
You may find this article[^] to be interesting as well.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi Roger,
I can call Dispose(). I think that is similar with ::CoUninitialize(); but where can I put that function? There is no Disposing event in the user control. I tried to put in Disposed event, but it still doesn't work
Any idea?
Thanks for your help again...
|
|
|
|
|
What is Dispose() and what does it do? Do you have a link to it in MSDN?
I think Dispose() may be C# specific, so perhaps you should ask in that forum instead to get better suited answers.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
i have used multimap <wstring,wstring> map1 in my application which is in visual studio 6.0.
nad i m getting a warning
warning C4503: 'std::_Tree<;_Traits>;::_Min' : decorated name length
exceeded, name was truncated
i serched to remove this warning and i also know its reason but the only solution i got is to use #pragma.
but is thr any other solution or using #pragma is safe.
plz suggest..thanks
|
|
|
|
|
preeti sharma wrote: but is thr any other solution or using #pragma is safe.
It is perfectly safe. The warning is just about the name of the template which is too long but it has no effect. Disabling the warning is the easiest solution. A better solution would be to upgrade to a more recent compiler .
|
|
|
|
|
How do i restrict the user to go to one particular directory if the browse button is clicked? its an mfc application
|
|
|
|
|
|
i am getting the complete path name using the GetPathName(). now say i get something like this.
c:\\program files\\my folder\\1.c
now i want to extract only "c:\\program files"
this looks really simple.. but i need some help.
|
|
|
|
|
what is the condition to decide "c:\\program files" is the needed directory ?
The first folder after the drive letter? If so passing the above string to PathRemoveFileSpec() for two time will return "c:\\program files".
|
|
|
|
|
that was just an example.. its so programmed that the data will be available in the 1st level.
|
|
|
|
|
Here it is -
CFileDialog dlg(TRUE);
CString sPath = "c:\\program files\\my folder\\1.c";
int nPos = sPath.Find("\\");
nPos = sPath.Find("\\",nPos + 1);
sPath = sPath.Left(nPos + 1);
dlg.m_ofn.lpstrInitialDir = sPath;
dlg.DoModal();
|
|
|
|
|
as previous posted my question "dll problem" I have an appliction with many threads .
in each thread a dll mydll.dll is loaded . every thing is fine but a major problem is arising
mydll.dll have some global variables(that is requiremnt and cannot be avoided) that is shared when new thread is created . i.e. global variables of mydll of new thread copy the global variable of
mydll of previous thread .how can i avoded copying of that global variable.
Ashish
|
|
|
|
|
You can set the global variable in TLS( Thread local Storage ). That is if you declare a variable as shown below, each thread will get a separate variable.
__declspec( thread ) int tls_i = 1;
|
|
|
|