|
Sorry - my experience was using drivers which came with grabber cards, not WDM drivers. I wish I could help you!
|
|
|
|
|
thanks anyway...
Ive foung cFrameGrabber ehich is supposed to be a warper for AviCap which manipulates image directly in memory... the example application is so huge and complicated and maybe only 2fps faster then in Visual Basic with saving to file...
I guess I will wait a few years till computers gets stronger
|
|
|
|
|
Well the printing is dangerous task i do not know why in MFC. I am in fix for this problem.
Problem Statement:
1.0 If i am using default mapping mode i.e. MM_TEXT or explicitly mentioning
mapping mode as MM_TEXT here then circle is drawn on view. But on the
Print Previewing the image turns out to be microscopic.
2.0 If i am using mapping mode MM_LOENGLISH, then on menu item clicking it
draws but on OnDraw it doesnot shows again. and every thing is
blank. Even in print preview.
I had attaching sample code and application on the codeguru forum which illustrates the problem.
http://www.codeguru.com/forum/showthread.php?t=304420
Leave your mark wherever you go
|
|
|
|
|
Salam
If any One Know about Dialog Box Controlls Send me (easy,Begginners) Information Or Programms
|
|
|
|
|
You'll have to be a bit more specific about which controls but there are lots ot tutorials for beginnners here[^]
Michael
CP Blog [^]
|
|
|
|
|
The VMR-based sample code is completely valid.
The VMR-7 Filter is only supported in Windows XP, however, the VMR-9 (Video Mixing Renderer Filter 9) is available in all platforms supported by DirectX 9. So, go ahead and use the VMR-based sample code in the documentation. Just refer to the VMR-9 reference for correct interfaces/function calls.
Because VMR-9 is not the default renderer, you must manually add it to the end of the filter chain by using IFilterGraph::AddFilter method. This means that you cannot use any pre-configured rendering functions, but must build and connect the entire filter graph yourself. This is a tad more difficult, but have no fear, the DirectX C++ documentation has examples to building complex filter graphs, too.
For a quick link, here's a topic you should search for in the DirectX C++ documentation "Building a VMR-9 Filter Graph". It can be found from "DirectShow -> Using DirectShow -> Using the Video Mixing Renderer -> Building a VMR-9 Filter Graph".
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti,
I guess I misunderstood the symptoms. I suspect that either the display or the capture card device driver, or both, are not supporting VMR-9. I am having a lot of difficulty locating drivers for the hardware with support for DirectX 9.0 and VMR, so do you know of a pre-DirectX 7.0 way of doing this efficiently... Perhaps by performing the drawing of the overlay filter with the application in some way?
|
|
|
|
|
The final option on this scenario is to use the Overlay Mixer Filter and a Video Renderer. These two filters must again be added and connected manually.
The steps required to use them:
1. Create a filter graph object, and query for IGraphBuilder and IFilterGraph interfaces on the object
2. Add a source file filter using IGraphBuilder::AddSourceFilter and save the IBaseFilter pointer
3. Create the Overlay Mixer Filter object (CLSID_OverlayMixer) and query for it's IBaseFilter interface. Add this filter into the filter chain using IFilterGraph::AddFilter
4. Create the Video Renderer object (CLSID_VideoRenderer), repeating the steps in #3.
Now it's time to connect the filter chain pins. Firstly, on the source filter's IBaseFilter interface, call IBaseFilter::EnumPins to get an enumeration of the available pins. See the DirectX C++ Documentation with topic "Enumerating Pins" to get sample code on how to enumerate available pins. Get the first pin and save the IPin interface pointer.
Next, get the Overlay Mixer Filter object's IBaseFilter interface, and query for the pin at ID 0. Get this pin's IPin interface. Now, you use the Filter Graph object's IFilterGraph::Connect to connect these two pins. If any extra pins are required to connect these two, they are added and connected automatically. If the connection fails, query for the next pin in the source filter, and again attempt to connect. When a suitable configuration is found, the method will succeed. Remember to release all unnecessary IPin pointers, and the enumeration pointers when done.
Repeat the steps to connect the Overlay Mixer Filter's output (MEDIATYPE_Overlay) into the Video Renderer Filter's input. The reason why you cannot directly connect from the source filter into the Video Renderer is the fact that the Overlay Mixer Filter would be skipped. Hence the dual-step process.
When done, you need to configure the Video Renderer Filter to display the video in a correct window. For this purpose, query for IVideoWindow interface on the Filter Graph object. Now the filter graph is ready to run, so query for IMediaControl interface and issue IMediaControl::Run . The video is displayed in the window you specified.
If you want to test whether using a certain filter chain will work, you can use the GraphEdit tool that ships with DirectX SDK. This tool allows you to build even complex filter graphs that support video, audio or both. It even allows you to create a video capture graph if necessary.
Unfortunately I don't have any prepared source code. If you need any, let me know and I'll see to it if I can fathom up some simple example for you.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Additionally, if you need to add an image overlay (e.g. a logo) to the video, see this link[^].
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am stuck in a Windows 98 environment with a Direct X capture card. I need to overlay graphics onto the video stream at screen-resolution as the video is being previewed to the display. Because I am stuck with Win98, all the VMR-based sample code that comes with DirectX 9.0 SDK is useless to me.
Can anybody give me any advice / sample code on how to achieve this?
Thank you,
Pieter Smith
|
|
|
|
|
If you spy Calc.exe on Windows 2003 you find that all of the buttons are BS_PUSHBUTTON style. But the text on the buttons is coloured. How is this possible.
My understanding is that to add any colour to a button you need to make it owner draw and handle the CTLCOLOR_BTN message.
Alternatively, is the source code for calc.exe available ? And, where can I get hold of it.
Many thanks
Jonathan
jonathanappswing at hotmail dot com
|
|
|
|
|
harropj wrote:
My understanding is that to add any colour to a button you need to make it owner draw and handle the CTLCOLOR_BTN message.
Not entirely so. You can use the BS_PUSHBUTTON style to indicate how the button responds to a mouse click. However, you can also override the WM_PAINT message handler to modify the way the button is drawn.
This approach is somewhat of a semi-owner drawn button, where Windows OS default behaviour is used to the maximum extent, and only where required, the default behaviour is overridden.
Unfortunately I don't know if there's source code available for Calc.exe. In Windows 2003, I also believe that the calculator is implemented by using C# or other .Net Framework language (such as C++/CLI). The .Net Framework offers many, many improvements over standard Windows or MFC approach procedures. When looking at the .Net Documentation, you can see that there is a Button class in System.Windows.Forms namespace. This class has a property called ForeColor that depicts the button's text color.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i have written an application which i start at boot time. now, when the system is shut down, i don't do anything explicitly in my application. i know, when the system goes down, it sends WM_QUERYENDSESSION message and when all the application returns a non-zero value, it sends a WM_ENDSESSION message. Now, how do i handle this message in my dailog based application. I need to handle this message coz i need to change a registry entry when the system shuts down. the classwizard does not show the handling of such message.
pliz help.
|
|
|
|
|
You'll have to manually add the ON_WM_ENDSESSION() entry to the message map and add a void OnEndSession(BOOL bEnding) function to handle the message.
Michael
CP Blog [^]
|
|
|
|
|
hi Michael,
i manually added the ON_WM_ENDSESSION() and in the OnEndSession(BOOL bEnding) function did the necessary regitry changes. Now, the application responds to shutdown. but it also responds when i log off. i do not want my application to make any registry changes when i just log off. how do i differentiate between 'SHUT DOWN' and 'LOG OFF'. should i handle WM_QUERYENDSESSION messge instead of WM_ENDSESSION.
|
|
|
|
|
If you want to detect whether the session is ending due to a Log-off then you need to handle the WM_QUERYENDSESSION message. The lParam value of the message contains the info of the session end state.
Michael
CP Blog [^]
|
|
|
|
|
The problem here is that you can not use the functions OnEndSession and OnQueryEndSession as they do not get the lParam passed through from the MFC message handler.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
This is not that straight forward. The flags that are sent are in the LPARAM of the message but are not directly accessable from the OnEndSession virtual function.
If you override the MFC message handler you can check the LPARAM for ENDSESSION_LOGOFF.
LRESULT CALLBACK CMainFrame::NewMsgHandlerFn(HWND hWnd,UINT uMsg,WPARAM wParam, LPARAM lParam)
{
if( uMsg == WM_ENDSESSION )
{
if( lParam & ENDSESSION_LOGOFF )
{
return true;
}
}
return CallWindowProc(s_pOldMsgHandler,hWnd,uMsg,wParam,lParam);
}
I hope that helps.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Its been a while since I did any MFC but can't you just
ON_MESSAGE(WM_ENDSESSION, OnMyEndSession)
and
LRESULT OnMyEndSession(WPARAM wParam, LPARAM lParam)
{
return 1;
}
Michael
CP Blog [^]
|
|
|
|
|
That is a very good point. I seem to have over complicated the situation.
Aw, well at least it is an exercise in subclassing.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
That is a very good point. I seem to have over complicated the situation.
You know me, if there is an quick, easy way to do something I'll use it. Subclassing is just too much like hard-work. Thats why I use C# now, less work to do.
Michael
CP Blog [^]
|
|
|
|
|
WOW!
both the solution worked
but i decide to go with the easier solution...
i handle WM_ENDSESSION message on log-off and shut down seperately.
well, thnx all
|
|
|
|
|
Tried to incorporate the function suggested by u.
there is a compile error in
CallWindowProc(s_pOldMsgHandler,hWnd,uMsg,wParam,lParam);
Error:::'s_pOldMsgHandler':undeclared identifier
will u please elaborate the callback function and also the idenfifier 's_pOldMsgHandler'
|
|
|
|
|
Sorry,
s_pOldMsghandler is defined.
static PMSGHANDLERFN s_pOldMsgHandler;
then in the .cpp
PMSGHANDLERFN CMainFrame::s_pOldMsgHandler;
Subclass the message handler in a Subclass function
void CMainFrame::Subclass()
{
:
s_pOldMsgHandler = (PMSGHANDLERFN)SetWindowLong(m_hWnd,GWL_WNDPROC,(LONG)NewMsgHandlerFn);
:
}
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
HI~
Is there any function in eVC++ which can pass some parameters to a running C# program?
"CreateProcess" can pass some parameters as a argument when a process start. However, how about the process is running?
Thanks~
|
|
|
|