|
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
|
|
|
|
|
OK. In the example given in previous message, infomation about new process (lets say it ProcessA)has been stored in PROCESS_INFORMATION. How can i create a new process that is child process of ProcessA?
Thank You.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: OK. In the example given in previous message, infomation about new process (lets say it ProcessA)has been stored in PROCESS_INFORMATION. How can i create a new process that is child process of ProcessA?
No you cannot create a child process of another process. Of course you can maintain a process hierarchy in your application.
Nibu thomas
Software Developer
|
|
|
|
|
Thank you Nibu.
If i can not create that process then what is meant by maintainig hirarchy. Are you meant by single level hirarchy.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: If i can not create that process then what is meant by maintainig hirarchy. Are you meant by single level hirarchy.
No. As said in my first reply you can simulate a hierarchical behavior in your application. But it make no difference to the OS.
Nibu thomas
Software Developer
|
|
|
|
|
Sorry Nibu. It seems i am not getting it. As you said that we can simulate hirarical behavior. I want to ask that how can i do that?
Thank you.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: Sorry Nibu. It seems i am not getting it. As you said that we can simulate hirarical behavior. I want to ask that how can i do that?
Thank you.
Maintain a hierarchical structure of the processes that you create in your application. Now you have to decide which one is a parent process and which one is a child process.
Nibu thomas
Software Developer
|
|
|
|