|
When you asked this same question[^] yesterday, part of my reply said:
Look at the actual values you are passing to MoveToEx and LineTo.
Until you do that, I'm not interested in helping any more, and I don't think too many others will be either.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
MoveToEx(pCellInfo->hDC,center.x-x1,center.y-y2,NULL);
LineTo(pCellInfo->hDC,center.x-x1,center.y+y1);
I hope you got it,what i am trying to do.
If i am doing wrong,please let me know,
Thanks for your reply
Raj
|
|
|
|
|
When I said "look at the actual values", I didn't mean the expressions, I meant the actual values. In other words, either add some code to print out the values when you call the function or put a breakpoint on the call and inspect the values in your debugger. Then you should be able to figure out what is wrong and work back to where your problem is.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thank u peter for your reply.Its working fine now
Raj
|
|
|
|
|
Hi,
Can any body having sysinternals
ProcessExplorer source code
|
|
|
|
|
Source code for SysInternals tools are not published.
It was initially a long time ago but not anymore.
|
|
|
|
|
In addition to answer from Superman, you can find source code for similar tools here in CodeProject.
Have a look at this[^] tool.
|
|
|
|
|
Hi thanks
I have seen that but i want
CPU Usage history graph.
Where i can get the same time of graph?
|
|
|
|
|
Check out this[^] CodeProject article.
It contains a Graph control and the demo application uses this control in order to show CPU usage history.
|
|
|
|
|
|
You're welcome!
|
|
|
|
|
I am writing an application that requests a file path from a user so that the application can process supported files in that directory. It is a console application. I would like to know how I can validate the path entered by the user to make sure that the path exists. I am programming in the C language. Please help.
|
|
|
|
|
|
Thanks Niklas, I believe this function will do, but it seem to be a Windows specific function. Do we have any way around in the ANSI C standard? If there isn't I will use the function you showed me, it's just that I want to keep the use of Windows functions at minimum in this application.
|
|
|
|
|
Maybe _stat() from <sys/stat.h> checking if the st_mode member of the _stat struct is _S_ISDIR. I don't know how much standard that is though.
|
|
|
|
|
I'm reading Dennis Ritchie's 'C programming language 2nd ed' and the part that I thought might be a solution is what you've directed me. Thanks very much.
|
|
|
|
|
Which file paths are valid or invalid is determined by the operating system, not the programming language. What is valid for Windows may not be valid for others such as Unix, and vice versa.
If portability of your code is of prime importance, your best bet IMO would be to actually try and use the path, say by attempting to create a file in the given directory path.
When I create portable code, I define my own little virtual OS and have an OS.h file which has different sections for each of the platforms (operating system and compiler tools) I support; it is full of defines from my virtual OS to the actual one.
|
|
|
|
|
Being a bit academic, you are not always able to create a file in a directory, but for other reasons.
Edit: Think I need some sleep.
|
|
|
|
|
I agree attempting an operation isn't the ideal way to determine validity, however it may (or may not) come pretty close to what the OP wants, after all the user entered a path for some reason, so maybe trying whatever it is the app is supposed to do with the path right away is a good enough approach, and by definition it would be as portable as the rest of the app.
|
|
|
|
|
in addition to the help from Luc & Niklas, there are things like Apache APR http://apr.apache.org/[^] which may be of use if you are doing a lot of this. I like Luc's approach for small time - which is essentially the same, but just defining the functions you need, whereas APR is a bit more encompassing
'g'
|
|
|
|
|
There's also _access() .
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi all
In CTree control according to MSDN i try to insert image of Recycle bin.But how can i get Int Imge number of Recycle bin?
m_tree..InsertItem("Recycle bin",int Image,hRoot);
I try to find int Image number.
Help me
|
|
|
|
|
One way, albeit antiquated, would be to look in your C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Win95 folder.
A better solution would probably be to use SHGetFolderLocation(CSIDL_BITBUCKET) and SHGetFileInfo(SHGFI_PIDL | SHGFI_ICON) .
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
The int is an index into the associated CImageList[^]. That in turn has to be created by you, and you can add resource items or load items from other sources at runtime. There are no predefined images for the CTreeCtrl .
|
|
|
|
|
If you're looking to get the icon that belongs to the recycle bin you can use SHGetStockIconInfo API.
This will work only on Windows Vista and above.
To support earlier OS versions you must use the SHGetFolderLocation and SHGetFileInfo APIs.
|
|
|
|