|
hy, i didnt found out, how i can do this. none of the classes i know, can
load a .avi movie and then get a certain frame as a bitmap, does anybody
has an idea, how i could do this?
thanx a lot!
|
|
|
|
|
Look in the MSDN for "AVIview: Read/Write APIs in AVIfile" for the example prog AviView.
I actually use AviView as a tool to look at individaul frames within an AVI file.
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
hy, sorry, but i didnt found anything with this search string(not on the net and also not in the MSDN)!
and i also didnt found the sample prog AviView.
could you give me more details or an exact link?
thanx
|
|
|
|
|
Well it is on my MSDN! Honest
I found this link http://www.banasoft.net/Links.htm[^]
Or I can email to you it is c. 58 KB zipped including the exe file, I would suggest I email as the link could be wrong, let me know.
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
hy, thanx a lot, i could download it.
the code seems quite complicated, could you maby tell me shortly, how i
can grabb a picture from an avi?
for instance load an avi, and get the 4th bitmap of the movie and store it
in a CBitmap object.
thanx a lot!
|
|
|
|
|
in aviview.c have a look at
lpbi = AVIStreamGetFrame(gapgf[giFirstVideo], 0);<br />
DrawDibBegin(ghdd[giFirstVideo], NULL,lpbi->biWidth, . . .
All drawing to the screen is done via the DrawDib functions, so add your code here to save the data to disk.
I would not say this code is very easy to follow but the concepts are straight forward, it will take a while for you to figure it out though!
Of course the new way to do this is to use DirectX but that is a different storey, the concept is the same just read the AVI frame by frame or jump to the frame you want then read/save it.
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
hy, the samplecode worked, and it could do what i wanted, but i am sure
there is a easier way, isnt it?
arent there any MFC classes, or tricks, to do this easyer?
thanx andreas
|
|
|
|
|
There are a few wrapper classes on CP, but I did not like any of them! But that is my personal opinion! so search CP for AVI, I came up with these.
I never said the API was easy to follow! After a few months you will realise it is straight forward, it took me ages to figure it out, and I could not really explain to anyone now how it works it is just so badly documented.
http://www.codeproject.com/useritems/aviutil_.asp[^]
http://www.codeproject.com/audio/avigenerator.asp[^]
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
We would like to find some sample Code source to drive USB port.
Could you help us?
Thanks.;)
|
|
|
|
|
This link (PDF)[^] will give you a headstart by granting some insight on how the USB works.
USB is not a serial port. Having said that, you can't just 'write' into it. You must have a device, which you then open, and to which you then send/receive data. The device driver is the key essential here: it will worry about interfacing your USB device through the bus into your computer's I/O space.
If you don't have a suitable device driver, you need to create one yourself. Writing a USB driver for a device is very tedious. I would suggest you get the Microsoft Driver Development Kit CD from somewhere and first read it's documentation.
Here is another link to a site I've found useful: http://www.beyondlogic.org/usb/usbdevdrvs.htm. It contains some examples and more specifically, the technical details of how a USB port works. Understanding them is a key essential in writing USB device drivers.
Currently, I am not aware if there is a freely distributed raw-access USB port driver available, that is, a device driver that you can open and close like a COM port. I doubt it, though, because of the way USB works: you can plug in any device and it should work properly. Allowing one device driver complete access over the USB would truly devastate it's purpose.
If possible, consider using a serial or pareller port in interfacing your device. If you really must use USB, see the above-mentioned documentations for a start.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have a simple MFC-Container app (just wizard code). I can add MS Word document.
When I save the document, I get an OLE2 compound document with the embedded word docuemnt.
How can I save the word document by it self, as a *.doc document?
Thank's Tom
|
|
|
|
|
How to implement a callback function in MFC or how to enumerate Process in MFC
|
|
|
|
|
Callback functions are implemented in MFC just as they are implemented in Win32: you create your own function that follows the guidelines specified by the documentation (function return value & parameters), then give this function's address (it's name) as a parameter for the routine that starts the enumeration.
The routine will call your function with the appropriate parameters for each object or instance it finds. In the case of process enumeration, these objects/instances are the different processes running in the system.
The PS API offers an alternative way: it fills a specified DWORD array with the process identifiers. See this page[^] for an example.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
SiddharthAtw wrote:
...how to enumerate Process in MFC
See if Process32First() and Process32Next() help.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
i'd like to update an article that i have posted.
Once there was a 'modify this article' link. Now ,it's gone.
How do i update my article?
|
|
|
|
|
You can only update if it has not been edited by an editor. Otherwise, you need to get hte updated HTML and files and send them in to submit@codeproject.com
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Roger Allen wrote:
submit@codeproject.com
Isn't it webmaster@codeproject.com? This link[^] appears to be confusing...
rechi
|
|
|
|
|
Though not serious, it's most annoying.
I call CTreeCtrl::CreateEx with the WS_POPUP flag specified. (This is why I use CreateEx instead of Create .) Each time there is an assertion failure. When digging into MFC code, one can see the reason. CTreeCtrl::CreateEx is dumbly redirected to CTreeCtrl::Create that does not accept the WS_POPUP flag. If CTreeCtrl::CreateEx called CWnd::CreateEx directy instead then everything would be fine.
Am I right?
And: how to make Microsoft to fix this issue?
|
|
|
|
|
The apparent answer from Microsoft would be: "Why do you need the WS_POPUP flag ?"
The pop-up window style is just used to determine the outlook of the window in which your control resides, and it's behaviour. For the Tree control, this flag is just about useless, as pretty much always a tree control is a child of some other window (main window), making you use the WS_CHILD flag instead.
The only instance when a tree control is not a child is when you create an application that shows ONLY a tree control and nothing else on your application's screen. This, apparently, sounds like a very crazy idea.
If you want to report a bug, try e-mailing Microsoft support and asking them to redirect it to the appropriate people.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
This tree control is used as a part of a combo box (that is, a hierarchic tree instead of the list). Search for the ComboTree class here: http://codeproject.com/combobox/combotree.asp.
However, there is a new version of ComboTree out there now, so there is no need for the WS_POPUP flag.
|
|
|
|
|
First, I'm not 100% sure that a CTreeCtrl can be WS_POPUP, however I can't find any documentation that says it can't.
I'm assuming you are using VS.NET or later as the VC6 version of CTreeCtrl doesn't look like it has it's own CreateEx, so it must be calling the CWnd::CreateEx
Looking at the source for VS2003, CTreeCtrl has it's own CWnd, and like you said calls Create and then using ModifyStyleEx to add the Ex-styles. As this is the same for all the classes, I'm hard pressed to think this is a bug.
What line does the ASSERT happen?
You can of course, derive a class from CTreeCtrl and create your own CreateEx as the function is declared virtual in the base class.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
First, I'm not 100% sure that a CTreeCtrl can be WS_POPUP, however I can't find any documentation that says it can't.
Neither do I. Anyway, a given piece of code requires it at the moment (see my other comment).
I'm assuming you are using VS.NET or later as the VC6 version of CTreeCtrl doesn't look like it has it's own CreateEx, so it must be calling the CWnd::CreateEx
I tried the stuff with VC6 - it doesn't have a CTreeCtrl::CreateEx , and Create gives assertion failure just as it should. The project is now in VS.NET (MFC 7.0, now 7.1).
What line does the ASSERT happen?
wincore.cpp(732) in MFC 7.0 or wincore.cpp(734) in MFC 7.1.
You can of course, derive a class from CTreeCtrl and create your own CreateEx as the function is declared virtual in the base class.
Well, you're right. Still, I don't feel like writing an own CreateEx as the "official" one in MFC may change later and call other things besides Create and ModifyStyleEx (though I don't think so for the near future).
|
|
|
|
|
Yogurt wrote:
Still, I don't feel like writing an own CreateEx as the "official" one in MFC may change later and call other things besides Create and ModifyStyleEx (though I don't think so for the near future).
You could always create a new window class which acts as a popup window. And then let it host the tree control. That ought to be pretty safe for the future
--
C'est normal!
|
|
|
|
|
I am currenly looking for a method (efficient) for streaming live images over a network. This image will then be processed further when receieved. Grabbing the images using directshow (or intels opencv) is easy. I have thought of using some codec for compressing the images and somehow send it. Does anyone have a good solution for my problem?
Best
Dan
|
|
|
|
|
hello,
as you know, kernel32.dll is loaded at windows startup and remains in memory until reboot or shutdown. Furthermore every .exe and .dll which is going to be executed uses the kernel32.dll which means that it is loaded into the adresse space of the calling process. So far so good! At the moment a dll is loaded into memory its dllmain function should recieve 3 parameters whereas one of those descripes wheather the dll is attached by a process/thread or detached.
But in my understanding, a system dll which is already loaded (at startup like kernel32.dll), doesn't get a notification if it is loaded or unloaded into/from a process' adresse space because it is already in the memory! Now is that true or false and how can i examine that ?
Thanks in advance!
|
|
|
|