 |

|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
Hey there,
I am writing an software that should be able to detect all keyboard inputs by the user. i.e., both hardware and software/on-screen keyboard.
This software is going to be written in a platform independent way and supposed to run on Windows, Linux, Android & iOS.
The idea is to capture the keyboard inputs from a low level, there by making sure that it doesn't miss any inputs even if it's a on-screen keyboard like in a mobile device.
I am looking at possible open source libraries that can be used.
Anyone got any good ideas on what to use?
Thanks in advance!
|
|
|
|

|
Given that those platforms have very different operating systems and hardware it is unlikely that you will find a library that can handle each type, especially at the hardware level. If you want open source code then Google should be your search tool.
|
|
|
|

|
This application is working fine on 2003 R2 and 2000 Servers and even our other 2008 R2 server but I keep getting the error on this new server. I could have sworn I had to do some tweak to get it working on 2008 R2 but I can't remember what it was. Basically what is happening is the application is doing a DB "query" that is taking a fair amount of time and as a result the UI is no longer "responding" even though the applicaion is working away and in fact not frozen/locked/in an infinite loop. The application is written in VS 6 and as you can see in both the description and below using MFC.
Problem signature:
Problem Event Name: APPCRASH
Application Name: qexectest.exe
Application Version: 1.0.0.1
Application Timestamp: 46b1e781
Fault Module Name: MFC42D.DLL
Fault Module Version: 6.0.8168.0
Fault Module Timestamp: 358870e1
Exception Code: c0000005
Exception Offset: 0002b4af
OS Version: 6.1.7601.2.1.0.16.7
Locale ID: 1033
Additional Information 1: d67f
Additional Information 2: d67fe74012b2fff2bcc60d9e40d9bbd3
Additional Information 3: 7b8d
Additional Information 4: 7b8d5be233f423bf0e8bf92697c74b98
|
|
|
|

|
MacRaider4 wrote: ...the UI is no longer "responding"... This is usually related to the main thread processing something and the UI cannot respond to the WM_NULL message.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|

|
That is correct, it is however working "fine" on the other 2008 R2 Server. The window grays out and has "not responding" in the ribbon, but it still carries on and completes. However on this server it quits.
|
|
|
|

|
I recommend that you use the remote debugging tools in Visual Studio to find where it is hanging up.
Remote Debugging[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|

|
My code looks like this:
int CMainClass::Start()
{
.......
for(int = 0; i<size; i++)
{
CWinThread * pWinThread = AfxBeginThread(MyThreadFunction, this);
}
.......
}
.......
UINT __cdecl MyThreadFunction(LPVOID pParam)
{
CMainClass *pArg = (CMainClass*) pParam;
pArg->GetList(); return 0;
}
........
int CMainClass::GetList()
{
HINSTANCE hLibrary = LoadLibrary(L"winhttp.dll");
........
........
FreeLibrary(hLibrary);
return 0;
}
My problem is that despite the call to FreeLibrary(), winhttp.dll is not unloaded. Each new thread I create allocate memory in the heap, but the call to FreeLibrary() does not release that memory.
Is there a way to force the unloading of the library and the release of the memory?
Thank you!
modified yesterday.
|
|
|
|

|
Member 10215814 wrote: Each new thread I create allocate memory in the heap, but the call to FreeLibrary() does not release that memory.
What makes you think that the first is related to the second?
|
|
|
|

|
I'm not sure I understand your question...
I have no memory leaks and I see the memory usage increasing at every new created thread. So I presume that the "per-thread" heap memory is not released by the call to FreeLibrary().
|
|
|
|

|
MarxF wrote: I presume that the "per-thread" heap memory is not released by the call to FreeLibrary(). Why would it be? The two are not related.
|
|
|
|

|
A common misconception about Task Manager numbers is that they tell something about the memory your program is consuming. This is not what those numbers tell you. They tell you the amount of address space that is in use. This has nothing to do with the amount of that address space your program is actually using. The blocks of memory that your code, or the library, freed are still in the address space, but they are available for subsequent allocation. The numbers you see in Task Manager are almost but not quite completely useless for telling how much of your memory is in use. If you see it shrink, this is good, but if you don't, it is not necessarily bad. If it's really important to you, use the heap-walking functions to track what is going on.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|

|
As already noted, there is no relation between the mapping of the library into the address space of your process and the memory allocated by your threads.
LoadLibrary works per process, not per thread. So you add can add a HINSTANCE member variable to your class, load the library from within the constructor or your Start() function, and free the library in the destructor.
|
|
|
|

|
Dear all:
I try to beep from buzzer(not speaker) on motherboard in win 7. How can I use winRing0.dll to control buzzer make sound?
Does any sample code or link?
And I need the winring0.lib, winring0x64.lib, winring0.sys, winring0.dll, winring0x64.dll, winring0x64.sys.
I search these files so difficult.
Who can give me these files or a valid download link, please?
Thanks for your help, Victor.
modified yesterday.
|
|
|
|
|

|
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 2 days ago.
|
|
|
|

|
- 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 yesterday.
|
|
|
|

|
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 yesterday.
|
|
|
|

|
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.
|
|
|
|
 |