Home > Back-end > Masters researched and consult the SDK problem, thanks
Masters researched and consult the SDK problem, thanks
Time:10-17
Come help novice to see problems, thank the warrior Want to write a console in researched SDK speech recognition but in set identification error message function, don't know why the forehead, ask master to help see # include # include # include # include # include Void main () { : : CoInitialize (NULL); Char STR [100]. GetConsoleTitle (STR, sizeof (STR)); HWND HWND=FindWindow (NULL, STR); CComPtr Ir; Retrieves the hr=ir. CoCreateInstance (CLSID_SpInprocRecognizer); If (SUCCEEDED (hr)) { CComPtr Ia. Hr=SpGetDefaultTokenFromCategoryId (SPCAT_AUDIOIN, & amp; Ia, TRUE); If (SUCCEEDED (hr)) { Hr=ir - & gt; SetInput (ia, TRUE); CComPtr IC. If (SUCCEEDED (hr)) { Hr=ir - & gt; CreateRecoContext (& amp; IC); CComPtr Ie; Hr=- ie & gt; SetNotifyWindowMessage (HWND WM_LBUTTONDOWN, 0, 0); } } } : : CoUninitialize (); }
Ie - & gt; SetNotifyWindowMessage (HWND WM_LBUTTONDOWN, 0, 0); Why to run this will have a problem
CodePudding user response:
Don't understand, researched, but you are to have what problem, if it is wrong to have what error message
CodePudding user response:
ISpNotifySource: : SetNotifyWindowMessage Tell Windows which is we identify the message HRESULT SetNotifyWindowMessage ( The HWND HWND, UINT Msg, WPARAM WPARAM, LPARAM LPARAM );
Parameters: HWnd: it is the main window handle to the window) (or receiving messages, Msg: is a user-defined message, WParam: [in] wParam that will be passed into the message handler function of the window hWnd. LParam: [in] lParam that will be passed into the message handler function of the window hWnd.
The return value: The Value the Description S_OK Function completed successfully. E_INVALIDARG hWnd is an invalid window handle. FAILED (hr) Appropriate error message.