|
I am asking how to program it from Windows user or kernel mode...
|
|
|
|
|
|
Your answer is good but it has a problem we are on the c++ forum but your link is on the C# (WMIQuery).
|
|
|
|
|
|
Wow Mr/Mis zhang we have a new problem now I think some people cant see your link its china and also previous link was china,do you have any idea about new problem.
|
|
|
|
|
I would like to check for the existance of a file before I create it, since I dont want to recreate the file if it exists. The help in visual studio 2005 mentions EXIST operator but does not give a clue as to the syntax for using it. Can someone please enlighten me with the code to make this work?
Thanks alot,
Terry
|
|
|
|
|
SimplCodr wrote: I would like to check for the existance of a file...
Can you use _access() ?
SimplCodr wrote: ...since I dont want to recreate the file if it exists.
Do you just want to append to it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
That worked perfectly, thank you very much.
Terry
|
|
|
|
|
Or you can use of FindFirstFile and check return value of this function.
|
|
|
|
|
Thanks for your input,
I tried to use this without susccess. It seems very complicated to me.
I created the HANDLE object.
HANDLE hFile;
I then created a pointer to the string containing the path.
const char fPath = "C:\\Myfile";
I created the handle as follows;
hFile = FindFirstFile(hFile, NULL);
This built fine but always return INVALID_HANDLE_VALUE even though the file was there.
I am sure I dont have this right. Notice I did not try to use the second perameter, which might also be a problem. Sure seems like alot of code just to see if a file's there or not.
|
|
|
|
|
Try to this code and see result
HANDLE hFile;
WIN32_FIND_DATA win32;
hFile = FindFirstFile("c:\\1234.txt", &win32);
|
|
|
|
|
Thanks,
That is alot easier than what I was trying to do with it. Thanks for your help.
Terry
|
|
|
|
|
You're welcome.
I think best thing for me is when I can solve a problem for people.
|
|
|
|
|
I belive the suggestion David had was easier than this but, here is another way that seems pretty simple .
GetFileAttributes();
If it fails it returns a DWORD 0xFFFFFFFF.
|
|
|
|
|
hi.
i am creating an application that needs to capture a video of a computer simulation on the monitor in real-time. then based on some metrics and other data, i need to edit the video by adding lines, shapes, and words inside the video. then i need to playback the video with the edited components embedded.
what are the best free APIs out there that allow me to accomplish the task above??
thanks!
--
dg
|
|
|
|
|
How you are going to capture the video ?
IF it the videoformat is raw avi , u can write some directshow filters to add ur on lines or shpaes to the frame. If it is compressed one, i think it may not possible in real time without some special hardware support.
If u can Dream... U can do it
|
|
|
|
|
Yes I was reading about DirectShow. So just to clarify, DirectShow will enable me to capture the video, edit the video by adding my shapes, lines, and text, and playback the video with the new stuff embedded? The videoformat, to avoid any more complexity, is probably going to be raw AVI.
In that case, DirectShow is the plan of action? Are there any alternatives - just curious?
--
dg
|
|
|
|
|
I don't know how to make video from screen. If it simple api , you can grab images from screen ( using win32funcions ) and you can create aVI.
IF it is mpeg or any compressed formats , it is more difficult to do it inreal time (also depends on the frame rate you want )
After saving the file as a avi. you can use directshow to to read that file. ( If it is avi , I think no need for directshow.. We can just grab every frame.. ). But directshow is more well organized.. there are class for reading from file , stream etc.
Adding lines or text is not much difficult . it is just bitmap manipulation.
Hopes this will give you some small idea.
If u can Dream... U can do it
|
|
|
|
|
One other thing I noticed in msdn when I was reading about directshow was that it only supports video capture from a hardware device like tv tuner cards or cameras...
the video i want to capture will be running on a C++ application on my computer screen. in fact, i want to incorporate the video capture, edit, and playback features within that same application so it can be more integrated.
if this is the case, can directshow do what i want? if not, what are the alternatives??
--
dg
|
|
|
|
|
Hello,
Possibly a stupid question.
Will C++ code run on linux? or does it target the .NET?
If the answer to the first question is no then what would be the best
genral purpose cross platform language to learn ?
Thanks
|
|
|
|
|
C++ can run on linux, but all the MFC and .NET stuff doesn't. Check out Mono, it's a project that will allow .net stuff to run on linux when written in C#.
|
|
|
|
|
Ylno wrote: Will C++ code run on linux?
This question makes no sense. Once (c++) code is compiled, the language used is no longer relevant. It's "machine language" at that point.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry if the question makes no sense. That was obviously my fault, i won't be doing that again. Next time i'll be in a position to talk down to a newbie on this subject.
So next stupid question: if the language is no longer relevant then is the
machine language of linux compatible with windows?
I wouldn't have thought so but you can suprise me.
Basically i'm after a language that i'll be able to use cross-platform ...
|
|
|
|
|
Ylno wrote: ...is the
machine language of linux compatible with windows?
No, they use different instruction sets. High-level code can be ported from one platform to the other, though. You'll just need a compiler on each to create the machine code.
See here for more.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks Dave,
You've cleared things up.
|
|
|
|