Disabling Main Speech Recognition in SAPI 5.3 - c++

I'm coding a program which simply understands basic keywords such as 'left' or 'right'.
It works great, however in order to execute the program, first, i must start Windows Speech Recognition. While my program is running, this 'Windows Speech Recognition' is also processing the commands, and this sometimes shut my program or open a folder.
What i want to do is disable 'Windows Speech Recognition' and still be able to start my program properly.
My code is based on this tutorial: http://msdn.microsoft.com/en-us/vstudio/video/Cc482921
Code: http://download.microsoft.com/download/b/0/1/b01ceff1-5ba9-41e2-ab4f-8b8f4c2f7467/SampleCoding-NativeCoding-ASR2.zip
Also, is there a way to work my program on a Windows editions(such as Windows XP or non-English Windows 7) which does not support speech recognition?

You need to use an inproc instead of a shared recognizer if you only want your application to respond. http://msdn.microsoft.com/en-us/library/ms717071(v=VS.85).aspx may give you some guidance.
Windows XP Tablet edition included a recognizer. Office 2003 included a recognizer that many XP users have installed. I think later updates to XP included a recognizer, but I don't know for sure. I tried to outline the platforms and recognizers as I knew it in https://stackoverflow.com/a/2998963/90236 and in https://stackoverflow.com/a/5861145/90236

Related

How to create GUI programs with Code::Blocks

Previously I used Visual Studio for my C++ programmings. But some cost effects I had to change my IDE, so I chose Code::Clocks (12.11). But I can't find a way to develop GUI applications with C::B. Is there any way to develop GUIs with C::B?
Yes, You can develop GUIs with CodeBlocks if you have GTK+ or wxWidget Libraries. You can use one of them at your own choice. CodeBlocks can't use them until you download and install them, So you have to perform some actions to make them usable in CodeBlocks. For GTK+ configuration steps see this and for wxWidget see this.
I create Win32 gui apps all the time with Code::Blocks 20.3 (uses MinGW-W64 project compiler) because I code them using the Win32 api. This is the manual way of doing things, and it works great; the down-side is that you must learn the Win32 api. (its an aspiring challenge, but for an experienced C/C++ programmer and some google skills, its doable)
Many programmers believe that gui apps must be built with a graphical builder (GTK+, wxWidgets, etc) but not true. In fact, in the stock version of the 20.3 Code::Blocks one of the project options is Win32 app. It builds a 'very' minimal cpp file that displays a blank window and starts the message loop... this is a good place to start if you've never seen a gui cpp text file that produces a blank window. You will need to study the Win32 api and learn how to use the message loop, how to add controls (buttons etc) to your project, and how to debug it; its a learning curve, but it is rewarding education. Get the book, "Programming Windows" fifth edition--- make sure its the fifth edition only!
The Microsoft docs are pretty good for learning the Win32 api also, but the book is the best approach. Take a class.
marcus
If you want to start creating GUI programs with 'Code::Blocks' then using a 'Win32' approach looks promising.
I only recently installed 'Code::Blocks 20.03', using the defaults for the install directory, and type of installation( Full ), and was easily able to create a basic 'Win32 GUI project'.
NB: I was using Windows 10, and the basic project doesn't really do anything.
For some Microsoft documentation, see at
https://learn.microsoft.com/en-us/windows/win32/learnwin32/learn-to-program-for-windows
, please note at the bottom left of this page, a 'Download PDF' link.
You could start at page 18 of the pdf, which is where, 'Module 1. Your First Windows Program', starts, page 20 is illuminating.
For information on 'The Message Loop', mentioned in a previous answer, see page 24.
It might be worth bearing in mind 'Reply #3' to the question at
https://forums.codeblocks.org/index.php?topic=19537.0

Windows Phone: Log to console

Disclaimer: I'm quite new to the MSFT tech world and only started Windows Phone development a month or so ago.
I am unable to figure out how to log information to the Visual Studio Output window from within a C# and C++ (Direct3D) Windows Phone 8 App. Is this possible?
I am building in debug mode, targeting Windows Phone 8, running in the XDE emulator and my development machine is a Windows 8 box with VS2012 Ultimate installed. My App runs fine, my Direct3D scene renders normally, but I can't log anything! This makes tracing code execution difficult and forces me to use breakpoints (which can be overkill in many situations).
I've been searching far and wide and have tried many methods (OutputDebugString being one of them). I can't see anything on MSDN about this - why is this not documented anywhere?
Yep, it's possible to write debug strings from WP8 C++ to the output window in VS2012. I actually have an example of that here.
1) Invoke OutputDebugString from C++.
void Direct3DInterop::MyButtonWasClicked()
{
OutputDebugString(L"Button was clicked!");
}
2) Before running the app make sure to change to the native debugger from the managed debugger in the project's properties.
I believe the methods in System.Diagnostics.Debug (specifically the overloads of WriteLine()) work...although I haven't tried them with C++ apps.

is there a service to create and upload crash dumps for mac and win apps?

I have a cross platform desktop C++ app for Mac OSX and Windows, for which I'd like to collect debug info when a crash happens on a user's computer, so I can find out what the problem is and fix my code. On Windows I'm using visual studio express 2010 and on Mac I'm using Xcode 3 as IDE. I remember an online service where you could sign up and link your code with a library, so the app would upload crash info to the service, which you could then use to fix the app, but I can't find it anymore after googling for 10 minutes. Can anyone help?
Thanks!
B
Please see here for the google-breakpad project. I think this is what you need. I was going to use it for a project so I researched about it but then the project ended so I didn't have a chance to. You link your program with it and when the program crashes, it generates a crash dump that is not compatible with any of the platform-specific crash dump formats but has its own one. You can then analyse them with a program that is part of the breakpad project. As far as I remember, there is also a service that you can install, where the crash dumps can be uploaded. The service then can analyse and group them by reason etc.
Hope that helps.

Phonon problem in Windows 7 with code compiled in XP

I have some code compiled using Visual Studio 2010 (C++), with Qt for the GUI and Phonon to show some videos.
I compile and run the code in a Windows XP machine and everything works fine. The videos and controls are shown correctly, and the same in other Windows XP machines. But at the moment that I try to use a Windows 7 machine, the video is not shown. Phonon controls are loaded, I can adjust the size of the Phonon VideoWidget but nothing is shown. I am using the SetFile method to indicate the file location and I have also tried (of course, with no luck) with setCurrentSource in the MediaObject (it works, though, in Windows XP).
I have tried different locations of files (absolute/relative) but nothing seems to work. Also, in XP when a video is not found an alert message is shown while in Windows 7 there is no error message, but also no video is shown. If I try to open the videos with other players, they work fine (I tried also with videos with different formats).
Any idea on what can be wrong? Is there something that I am missing with Phonon and Windows 7? Thanks!
When deploying your application to a different computer, make sure you don't forget to copy the Phonon backend. Not just the DLL contained in it (the ds backend for me), but also the directory itself.
That is
-Application Directory
¦-myexe.exe
¦-phonon_backend
¦-phonon_ds94.dll
Furthermore the Phonon backend on Windows (and Mac I think) makes use of the QtOpenGL module. So don't forget to copy this either. It can go inside the application directory.
In any case you could help yourself out a bit by adding a small bit of code that shows (perhaps writes to a file) which mimetypes are available. If it doesn't spit out anything, there is a problem with your backend. (Well, that of your application...)
This is what I had to do when I used Phonon to play video inside my application. Since I only quickly added this some time ago to my application, I'm not 100% sure that this is the only (or even the proper) way to do this, so anyone who has different insights feel free to comment on this.

Console application in C++ for smart devices (WinCE)?

I am new in developing application for WinCE 5.0. I want to start from "Hello world" program or console application. But I couldn't find anything like that or any other sample applications to start from.
I am using Visual Studio 2005. I created new project >> visual C++ >> Win32 smart device project >> console application >> finish.
The project compiles fine. I was trying simple
printf("Hello world");
But When I ran in smart phone 2003 emulator, it showed no output.
I couldn't find a good tutorial to start from. Please suggest me some good tutorials or sample applications to start from.
Thanks in advance.
What does the log say? That the application has terminated successfully with return code 0x0?
If you did not put anything to stop the application it might be that it runs good and terminates without you noticing it. Try to add a scanf or Sleep(5000) after the printf statement so things will be visible. You can also compile it in debug mode and put a breakpoint after the printf statement and see the results.
In addition, I am not too familiar with Windows Mobile and its incarnations (smart phone 2003 being one of them), but I am not sure how it handles a printf. You can try create an MFC application and use the MessageBox to display your text.
OK. I just tried the two options and there is no CMD windows in Windows Mobile (Smartphone or PocketPC) so the application runs successfully, but prints nothing.
Use the MFC option or deploy your application to a Windows CE 5.0 device emulator image. I have not tried that download myself, but it says that it should save you the hassle of handling Platform Builder. Note that you might be missing some components in the image down the road, but I suppose that for practicing purposes it should suite you just fine.
WinMo/Pocket pC devices have no console, so your output went nowhere. You can always add a console on like PocketConsole.
there is CMD windows in POCKET PC 2003 emulator you can try it using visual basic code