|
You could use GDI+ FillPie function.
Just get the bounds of the ellipse, ie
void Draw( int px, int py, int xRadius, int yRadius )
{
Graphics *g = ....
Rect rcBnds( px, py, xRadius*2, yRadius*2 );
Brush *brColor = first color;
g->FillPie( brColor, rcBnds, 0, 90 );
brColor = second color;
g->FillPie( brColor, rcBnds, 90, 180 );
brColor = third color;
g->FillPie( brColor, rcBnds, 180, 270 );
brColor = last color;
g->FillPie( brColor, rcBnds, 270, 360 );
}
Of course you can use regular GDI and Pie(), you just have to calc the points yourself, which is easy since you are just dividing into 4 parts.
|
|
|
|
|
i use CFile function .i can open the open dialog but icant able to open the file.
|
|
|
|
|
CFile Lfile
Lfile.open("D:\\sam.txt",CFile::Read);
This kind of way open your file.......
|
|
|
|
|
This is helpful for txt files.
|
|
|
|
|
You would need automation to do this.(For .doc and .xsl atleast) OLE Embedding
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Is there any API which will display all the installed software updates in the windows including the os updates . ??
vineesh
|
|
|
|
|
don't know if there exists an API to get the installed software updates directly. but you can do it by reading them from the registry.
The information is stored under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\<Keys>
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
But it will only list the microsoft updates ... I need all the software updates too ..
Is there any difference between updates and patches
vineesh
|
|
|
|
|
Patch/Updates:Include bug fixes, replacing graphics and improving the usability or performance.
The information for the updates for other softwares would also be there in the registry itself, is there some specific software for which you need the updates information. If affirmative then there should be registry key for that too.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for the reply.
Actually i want to list out all the installed patches in the machine .
I was able to list the patches to a specific product by msienumpatches() function .But i need to pass the product code to the function. The product code i was getting from msienumproducts() list out the registered product which will not list out the os .
So i think i need to look some other way to handle this ..
vineesh
|
|
|
|
|
Timer is getting frized on a particular functin call.
I had call in my app.
SetTimer(1,260, NULL);
it is woking fine untill a specific function call is reached. and during the execution
of that function, say for about 1 min, the OnTimer is not called, after the function call, it is working
normally.
Pls advice
|
|
|
|
|
When you set a timer using the SetTimer, the windows will send a WM_TIMER message to the window. Since this is a message, you need to dispatch the messages to get this message. But in your case since the thread is busy in executing another function, it cannot dispatch the message. That why the OnTimer() function is not called at this time.
Another solution is creating a second thread.
|
|
|
|
|
Thank you for you responce, Well that is ture, But in my case, the dialog (which holds the timmer) itself is created in a different thread. and Frizing function call is in the main Thread.
|
|
|
|
|
In that case the timer should work fine..
In the OnTimer() function, do you call any functions that might send a message to the main thread?
|
|
|
|
|
No Naveen, In the main thread there a function call (CORBA call) to server, which retrives min 5000 records, during this call the timer is blocked for 1 min, during the UI refresh I can do doevents, only problem is it timer is blocked for about 1 min, Do you have any work arounds for this, pls advice
|
|
|
|
|
ptr_Electron wrote: In the main thread there a function call (CORBA call) to server, which retrives min 5000 records
no no I asked about the functions in the ontimer(). Suppose you are calling a SetWindowText() or InsertItem(), it will send the message to the corresponding window. And if any of this windows are created by main thread, your ontimer() will hang. If the ontimer() function is small can you paste the code here?
ptr_Electron wrote: Do you have any work arounds for this, pls advice
I actually tried such a secnario in my machine and it is working fine..
|
|
|
|
|
Not much really, just inc. prgress bar. to make the UI active from the frized state.
void CPrgpopup::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
m_ProgressCtrl.StepIt();
CDialog::OnTimer(nIDEvent);
}
|
|
|
|
|
I guess the m_ProgressCtrl is created in the second thread.
Try commenting all the code in ontimer and just put OutputDebugString(). And while running the application take the Dbgview and check the text in the OutputDebugString() is coming or not?
|
|
|
|
|
I am getting "C" in the outputstring
|
|
|
|
|
ptr_Electron wrote: I am getting "C" in the outputstring
you mean even while the main thread is processing, you are getting the string you wrote in the outputdebugstring?
|
|
|
|
|
No, I am not getting when mail thread is processing, Is there any work arounds for this
|
|
|
|
|
ptr_Electron wrote:
it is woking fine untill a specific function call is reached. and during the execution
of that function, say for about 1 min, the OnTimer is not called, after the function call, it is working
normally.
Because your gui thread is busy in your function call. Only after that next message from message queue will be processed.
If the timer event is so critical for you, better go for waitable timer kernel object. You've to spawn a new thread and should wait for the timer on that thread. This link might be helpful -
http://msdn.microsoft.com/en-us/library/ms687012(VS.85).aspx[^]
http://www.adp-gmbh.ch/win/misc/timer.html[^]
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks for ur responce, It tried it out, but no luck
|
|
|
|
|
Did you created a separate thread for waiting on the timer?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|