|
do you test //CComPtr<ioleclientsite> pWB;
|
|
|
|
|
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
I think the problem is the pointer. Why? I don't know, I just guess.
Thanks for your help!
|
|
|
|
|
I wanna capture the windowsNT logoff event.
WM_QUERYENDSESSION 'd help? and BTW can i trap this in
PreTranslateMessage() ??
I dont really like to keep logging off and On just to test this. your comments would be valuable
VuNic
|
|
|
|
|
You need to be looking out for WM_ENDSESSION , paying attention to the parameters of the message to tell if the user is logging off or not, or if a shutdown is being done.
Note that a well-known author wrote a few articles regarding problems with reliable detection of system shutdown and used something called the "Notepad test" to do it. Googling for that phrase may help.
You can also create a handler for the CTRL_LOGOFF_EVENT event (which may only be sent to console applications), which might work, too. A true Service will get shutdown notifications as well.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
thanks for the info james.
VuNic
|
|
|
|
|
Hi everyone,
I want to schedule a windows application(an IE window) to run at a fixed time and they system shud generate a message that the browser window is running and when if it shud close down due to any reason then also the system shud generate a message stating the browser has closed down.
Can any one please help me w/ a code or somthing ,i m having difficulty in using the schedule feature .
Thanking u
Regards,
Vikas
|
|
|
|
|
munsiyari wrote: Can any one please help me w/ a code or somthing ,i m having difficulty in using the schedule feature .
Look for the ITask and ITaskScheduler interfaces.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Coinitialize();
ITaskScheduler *pIS;
CoCreateInstance(CLSID_CTaskScheduler,
NULL,
CLSCTX_INPROC_SERVER,
IID_ITaskScheduler,
(void **) &pIS);
IEnumWorkItems *pEnum;
pIS->Enum(&pEnum);
...
...
|
|
|
|
|
Thanx guys!! i really appreciate it.
|
|
|
|
|
I have a legacy MFC app that has recently been ported to VS 2005. Debug mode works fine, but release mode crashes on startup. I traced the code to a CImageList::Load method - which, in VS2005, now calls the following code:
AFX_ISOLATIONAWARE_FUNC(HIMAGELIST, ImageList_LoadImageW, (HINSTANCE hi,LPCWSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags), (hi,lpbmp,cx,cGrow,crMask,uType,uFlags),NULL)
This code is crashing (somewhere in the AFX_ISOLATIONAWARE_FUNC macro) and I have no ideas why. At first I thought the resource handle may be wrong, but if I call ImageList_LoadImageW directly, it works fine and returns a valid handle.
Anyone have any clues at all? There is no mention of this new macro anywhere I can find.
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
This[^] could help you to some extent.
Nibu thomas
Software Developer
|
|
|
|
|
After much tweaking, I managed to fix the problem. The app in question was set to use 1-byte struct member alignment, which, for reasons only know to MS, caused these new macros to barf. I changed the setting to "Default" and used appropriate pragmas around the structs that needed 1-byte alignment, and the problem was cured!
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
put here because I found this thread when I had a similar problem ...
We had a crash in one of the comdlg32 methods wrapped in a AFX_ISOLATIONAWARE_FUNC macro, the problem was eventually traced to some shonky code in MFC, namely CDllIsolationWrapperBase::GetModuleHandle()
This method uses ::GetModuleHandle to get to (in our case) comdlg32 IIF that module is already loaded - the primary distinction between ::GetModuleHandle and LoadLibrary is the upping of the refcount, done in the latter, not the former
Our scenario was (simplistically) as follows ...
1. our code loads a 1st party lib, this dll explicitly loads comdlg32
2. our code uses comdlg32 methods - first time through, MFC needs a handle, uses GetModuleHandle as described above
3. our code frees 1st party lib, in its shutdown, comdlg's refcount drops to 0, hence unloads comdlg
4. our code uses comdlg32 methods again - MFC has a handle, it has a procAddress, it calls it ... boom!
Obviously, this bug will exhibit similarly with all the libraries that use the MFC wrapper class
|
|
|
|
|
Hi,
I need some guidance for wavefrom display of data, actually the data is coming from a device through serial port. from that port iam retriving the data, the problem is i need to convert that data in wavefrom, can anybody help me.
Sekhar
|
|
|
|
|
kmsekhar wrote: wavefrom display of data
You want spectral display as a time series?
Save your data items into a vector. This is you Y-Data.
If your device does not send the data on a fixed base, you will also need another vector wih the current time of the data item - your X-Data.
Now you can simply display your data using one of the various spectrum displays found here or do further computation with it.
But probably I misunderstood you?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
How can I prevent the updation of MRU
I am writing an application and I want to add some documents to MRU based on a condition but not all of them. How can I do that.
|
|
|
|
|
Hello Farhat Aisha!
As per my knowledge,second parameter of SetPathName() function is responsible for maintaining MRU. The framework calls AddToRecentFileList()method when it opens a file or executes the Save As command to save a file with a new name. That inturn calls SetPathName. You can just override AddToRecentFileList() or SetPathName() !
-Malli...!
|
|
|
|
|
Thanks for your reply
Actually my problem is that I have a compound-document i.e, that contains a number of documents (This compound-document is not an MFC based class, it is my own class and it is a sort of collection of my individual documents)
And I have the provision to open a single document and also a compound-document.
When I open a compound document I set a flag and reset it immediately after the operation is complete
I have overridden the AddToRecentFileList() which does nothing when that flag is set otherwise it adds file names to MRU
My question is that is there any better way of doing it. I mean does MFC provide a better proviison for this
|
|
|
|
|
I think this is the only way to do ! And that too you did ! That's it !
-Malli...!
|
|
|
|
|
Hello Friends !
My VC program is launching an EXE (probably a VB Exe). How can I make VC program to wait till exe exits. I've tried with waitforsingleobject() using handle returned by ShellExecute(). That didn't work. So, I tried with Events, But VC program dosen't get notification of the event that I raise in that VB exe. Is there any other way to make my VC to wait to complete VB exe?
-Malli...!
|
|
|
|
|
A Demo[^]
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Thomas !
It Worked ! I was under impression that CreateProcess()also behave like ShellExecute(), and would give same problem!
-Malli...!
|
|
|
|
|
Malli_S wrote: I've tried with waitforsingleobject() using handle returned by ShellExecute(). That didn't work.
You'll need to use ShellExecuteEx() instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello
Does Windows support process hirarchy. That is we can create a process from parent process using CreateProcess(...). Can we create another process from the newly created child process? I have read somewhere that Windows does not support process hirarchy.
Here is a reference code from MSDN.
#include <windows.h><br />
#include <stdio.h><br />
<br />
void main( VOID )<br />
{<br />
TCHAR szCmdline[]=TEXT("MyChildProcess");<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
if( !CreateProcess( NULL,
szCmdline,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
) <br />
{<br />
printf( "CreateProcess failed (%d).\n", GetLastError() );<br />
return;<br />
}<br />
<br />
WaitForSingleObject( pi.hProcess, INFINITE );<br />
<br />
CloseHandle( pi.hProcess );<br />
CloseHandle( pi.hThread );<br />
}
In above code, a child process has been created. I want to ask can we create nested child process using newly created process in above example.
Thank you.
We Believe in Excellence
|
|
|
|
|
Windows processes do not share a hierarchical relationship. The creating process receives the process handle and ID of the process it created so a hierarchical relationship can be maintained/simulated if the application requires it to do so. However, the operating system treats all processes as belonging to the same generation.
Processes in windows (by default) inherit the security settings of the creating process.
Nibu thomas
Software Developer
|
|
|
|