|
Or perhaps ShellExecute.
Steve
|
|
|
|
|
gawd - getting old (just turned 0x30) - memory slipping, lining up spot on park bench
'forgot that one'
ta
|
|
|
|
|
|
Well there is this[^], but it has nothing to do with MFC.
|
|
|
|
|
Yep, Richard is completely correct, the system call has nothing to do with MFC. +5
|
|
|
|
|
what is the importance of virtual and pure virtual fuctions?
|
|
|
|
|
|
They allow polymorphism, where derived classes can provide different behavior for the same function calls.
For example, a Shape class can have a virtual getArea () method.
Derived classes (like Circle, Square, etc...) will provide different implementations of getArea (), which use different formulas for the area calculation. Thus, you can call getArea () on a Shape object, regardless of which concrete derived class it represents, and you'll get the correct area.
|
|
|
|
|
Yes. you are right.Using these functionality in c++ we can make good code design also.
|
|
|
|
|
Try here.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Jackkrishjk wrote: what is the importance of virtual and pure virtual fuctions?
VERY important.
Nihil obstat
|
|
|
|
|
Suppose more than one application is running in my system. I want my program to trace all the popup exceptions i.e. error messages from other applications.
Can anybody help me in this with a simple VC++ example????
|
|
|
|
|
|
<pre lang="text">Thanks a lot <b>Alan </b>
I tried the following code. It is giving me the title of every open windows. But I want only the exception popup window( i.e. error windows generated from other applications) from them.How could I get this. Plz help me.</pre>
<pre lang="c++">
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam)
{
TCHAR title[500];
ZeroMemory(title, sizeof(title));
GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));
CString msg=L"";
msg.Format(_T("Value is %s\n"), title);
AfxMessageBox(msg);
return TRUE;
}
void CEnumWindowTest1Dlg::MyFunc(void) //(called by main)
{
EnumWindows(MyEnumProc, 0);
}
</pre>
|
|
|
|
|
Without seeing those titles, I can't give you a way of distinguishing them. If the titles don't work, then using the windows' handles, you can probably get the applications or processes that own them. Then you can use this information to isolate the ones you want.
|
|
|
|
|
<pre lang="text">
<b>Alan</b>
Yes I can get the IDs of each thread with the API GetWindowThreadProcessId()
DWORD threadId = GetWindowThreadProcessId(hWnd, NULL);
now if I go to each thread and call GetLastError() then I am able to know which of them are error windows.
But I don't know how can to call GetLastError() for each thread with threadId.
</pre>
|
|
|
|
|
You cannot use GetLastError() in this way, it will only return the last error value in the current thread of your application. And even if you could somehow call it you would not get a valid response. I think you will find that this project is not viable.
|
|
|
|
|
CoCreateInstance is getting fail for 64 bit dlls.
code:
HRESULT hr=CoCreateInstance(__uuidof(Prfl::Profiles),NULL,CLSCTX_INPROC_SERVER,
__uuidof(Prfl::IProfiles),(void**) &MyProfile);
Do I need to change parameter for 64 bit?
|
|
|
|
|
What is the actual fail code?
|
|
|
|
|
|
Yet another useful error code from Microsoft. It is quite possible that your code is somehow trying to link to a 32 bit DLL; try using Dependency Walker to track all the dependencies. Other than that you should try the Microsoft help sites.
|
|
|
|
|
I checked the dlls which I am using is of 64 bit.
Any other possible reason?
|
|
|
|
|
john5632 wrote: Any other possible reason? I assume yes, but since the error code does not give us any useful detail I suggest you pass it up the line to Microsoft.
|
|
|
|
|
Please check the return value again. 0x800700C1 seems to be wrong. The high word 0x8007 indicates that it is a normal Windows error code. But 0xC1 / 193 is ERROR_BAD_EXE_FORMAT : '%1 is not a valid Win32 application' which makes no sense here.
|
|
|
|
|
it makes sense if the process is 32-bits and is trying to load a 64-bit DLL.
|
|
|
|