|
Dear Rage:
I can't download with the link by used Svn.
Could you send me these files, please?
I have been try your reference, but it still no sound with buzzer.
Thank for your help, Victor
|
|
|
|
|
cedricvictor wrote: Could you send me these files, please?
You would have to install svn to be able to check out. I have no installation of svn on my working computer, so I will not be able to send you the files.
cedricvictor wrote: I have been try your reference, but it still no sound with buzzer
Is the code running ? Is your buzzer working at all ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|
|
Hello. I am a beginner in audio/video.
+ Why do we use Sleep() function (or timer) when we are processing audio/video samples.
+ If we are rendering a video where our frame rate is 29 fps, then what value should be passed to the Sleep() function?
+ Is this what is known as Latency?
modified 12-Mar-14 6:23am.
|
|
|
|
|
- Sleep is used to pause programm execution. I don't know why are you using it while processing audio/video.
- Again, it depends on your actual implementation.
- No, that's not latency, see Wikipedia[^].
Veni, vidi, vici.
modified 12-Mar-14 9:13am.
|
|
|
|
|
I may have wrongly used the term processing. I am actually displaying the video frames (frame rate = 29.97 fps) onto a dialog. Now when I didn't use Sleep(), the 18 second video completed in just 4-5 seconds. But after putting Sleep(25), it almost runs normally. What does this mean to you?
modified 12-Mar-14 9:01am.
|
|
|
|
|
Can you post your code ?
You have to time your rendering, which is what you are doing in an awkward way with the Sleep instruction. If your target rate is 30 fps, you have to exactly wait 33ms between displaying each frame (which is obtained more or less with your Sleep(25)), but you don't use the Sleep instruction for that !
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|
|
This[^] might be an interesting read regarding Sleep(). I agree with Rage that Sleep() is not the best choice here, possibly waitable timers or SetTimer()?
|
|
|
|
|
Hi
I am trying to get data from grid of external application. I tried WM_GETTEXT on grid control which is a child window. But SendMessage() returns blank value. How can I get data from grid. I can see its class from Spy++ as "Txt Grid Control" without any caption.
Is there any way I can get text of this grid control.
|
|
|
|
|
You cannot use WM_GETTEXT to get the content of a composite control. You need to find a way to iterate through all the child controls of the grid to access the content of each. And even then it will depend largely on the control's internal implementation whether you can actually get access to the data.
|
|
|
|
|
Could you post your code ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|
|
In My application, I have used the following code to get the region of a dialog.
HRGN hRgn = CreateRectRgn( 0, 0, 0, 0 );
int nRet = GetWindowRgn( hRgn );
if(ERROR == nRet)
{
DWORD dw= GetLastError();
}
The problem is that, sometimes "GetWindowRgn" returns error "invalid handle" even if CreateRectRgn returns a non-null handle which is used for GetWindowRgn.
I have set the region in onSize(). So dialog have region.Also after GetWindowRgn returns error, when i call GetWindowRgn() again, second call is working fine !!!
Issue is reproduced only sometimes in a Windows 7 machine.
Anyone already faced similar issue?
Thanks,
Arun
modified 12-Mar-14 0:20am.
|
|
|
|
|
Try putting an IsWindow check before calling GetWindowRgn .
if (::IsWindow(m_hWnd))
GetWindowRgn(hRgn);
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
What does GetLastError tell you?
|
|
|
|
|
hi,
GetLastError shows 6, ie. invalid handle. But when i call method again after failure occurs, its works fine
I have workarounds for the problem. But I am curious to know the reason. why its happened only some times even if dialog have region.
Thanks in advance
Arun
|
|
|
|
|
atm.menon wrote: why its happened only some times Impossible to tell without a lot more diagnostic information.
|
|
|
|
|
I'm maintaining C++ code ported form VC6 into VS2010. The class wizard of VC6 uses comment delimiters started with
The class wizard of VS2010 seems not using them anymore.
New items are not longer added before the
but writing for example an ON_MESSAGE after a group of ON_MESSAGE.
It looks that the MFC comment delimiters are outdated and useless.
Is it safe to remove them from the code?
modified 18-Mar-14 7:52am.
|
|
|
|
|
It is safe to remove them if you don't want to use VC6 anymore. VS 2002 and later did not use these markers.
|
|
|
|
|
the comment delimiters only used by IDE(vc6.0) , so when you add code manually, you can add code in anywhere. and you can remove the comment delimiters, but the IDE class warized will can't use!
|
|
|
|
|
I'm currently playing around with the Log component of the Boost C++ library. I searched for a DB backend, found nothing but "Does anyone know if Boost::Log can write into a DB?", and hoping that someone on here can answer me that one: Does anyone know if Boost::Log can write into a DB?
The scariest moment is always just before the Start - Stephen King Die Frauen warten auf die Liebe, und die Männer warten auf die Frauen - Wolf Wondratschek
|
|
|
|
|
Dear all:
I try to use hook to detect touch input globally. I using WH_CALLWNDPROC of hook to detect and write in dll. I use hook like this
g_hInstance = AfxGetInstanceHandle();
g_hPreviousHook = SetWindowsHookEx(WH_CALLWNDPROC, &CallWndProc,g_hInstance, 0);
and in my CallWndProc process
LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousHook, nCode,
wParam, lParam);
PMSG msg = (PMSG) lParam;
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
POINTER_INPUT_TYPE pointerType;
return CallNextHookEx(g_hPreviousHook, nCode, wParam,
lParam);
}
when I add the GetPointerType(pointerId, &pointerType) into the code and debug, it will load the dll failed and occur debug assert failed, and jump into appmodul.cpp.Jump into
extern int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, int nCmdShow);
extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,_In_ LPTSTR lpCmdLine, int nCmdShow)
#pragma warning(suppress: 4985)
{
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
when I disable GetPointerType(pointerId, &pointerType)
, the application work fine. I don't know what happen,
Does anybody try to use this or know why?
Thank for your help, Victor
modified 10-Mar-14 21:54pm.
|
|
|
|
|
You're not installing a mouse hook.
Rather, you're installing a CallWndProc hook.
From this hook proc, you're trying to get the pointer Id from WPARAM .
The documentation of CallWndProc[^] says -
Type: WPARAM
Specifies whether the message was sent by the current thread. If the message was sent by the current thread, it is nonzero; otherwise, it is zero.
I'm guessing you should use MouseProc[^] here.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
I like to use HitTest to identify a splitter pane via mouse.
It is a virtual function / method declared "protected" in base CSplitterWnd class.
I have never used this and have no idea what is the correct syntax.
I would appreciate any help.
Vaclav
Ok I build an override function with instance of base class, but still cannot figure out how to get pass the "protected" virtual function.
-- modified 9-Mar-14 20:16pm.
|
|
|
|
|
Isn't it:
CSplitterWnd::HitTest(blah, blah);
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Nope,
cannot access function declared protected.
|
|
|
|
|
If you (publicly) derive from the base class, you should have access to all protected members of the base class from your derived class. So the start of your class definiton should look like
class MyClass : public CSplitterWnd
If you have a protected in this line instead of the public, it will not work. Also the access will only be available from your derived class, not from any other class that uses an instance of the derived class.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|