Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Enabling Menu Items Pin
21-Apr-03 20:07
suss21-Apr-03 20:07 
GeneralRe: Enabling Menu Items Pin
AnkushChopra23-Apr-03 22:16
AnkushChopra23-Apr-03 22:16 
GeneralRe: Enabling Menu Items Pin
Phil Hamer22-Apr-03 13:04
Phil Hamer22-Apr-03 13:04 
GeneralRe: Enabling Menu Items Pin
AnkushChopra23-Apr-03 22:19
AnkushChopra23-Apr-03 22:19 
GeneralRe: Enabling Menu Items Pin
Toni7822-Apr-03 19:38
Toni7822-Apr-03 19:38 
GeneralRefer to Help Pin
Toni7822-Apr-03 19:41
Toni7822-Apr-03 19:41 
GeneralIgnore my message...Sorry Pin
Toni7822-Apr-03 21:16
Toni7822-Apr-03 21:16 
GeneralI set a global hook,But can use SAPI to speak the word typed! Pin
white jungle21-Apr-03 19:09
white jungle21-Apr-03 19:09 
I want to get the word user typed and read it with SAPI.
The code as follow:
<br />
#pragma data_seg("shared")<br />
HHOOK m_hHook=NULL;<br />
ISpVoice * pVoice = NULL;<br />
HRESULT hr =NULL;<br />
#pragma data_seg()<br />
#pragma comment(linker,"/section:shared,rws")<br />
//defien some var for shared<br />
HINSTANCE glhInstance=NULL;<br />
//<big>define the global var and the glhInstance will init the </big><br />
//<big>function InitInstance()</big><br />
<br />
.................<br />
BOOL CHookKBDApp::InitInstance() <br />
{<br />
	glhInstance=::AfxGetInstanceHandle();<br />
	if (FAILED(CoInitialize(NULL)))<br />
    {<br />
        AfxMessageBox("Error to intiliaze COM");<br />
        return	FALSE;	<br />
    }<br />
	return CWinApp::InitInstance();<br />
}<br />
////////////////////<br />
..............<br />
StartHook()<br />
{<br />
...<br />
	m_hHook=::SetWindowsHookEx(WH_CALLWNDPROC,CallWndProc,glhInstance,0);<br />
......<br />
//I set a global hook to get the message WM_IME_COMPOSITION<br />
//because I won't read the english ,just chinese<br />
<br />
//in the CallWndProc function there are some problem!<br />
LRESULT CALLBACK CallWndProc(int nCode,  WPARAM wParam,  LPARAM lParam  )<br />
{<br />
//When Message WM_IME_COMPOSITION occured <br />
//I use following code to read the string<br />
if( SUCCEEDED( hr ) )<br />
				{<br />
					hr = pVoice->Speak(test.AllocSysString(),SPF_DEFAULT,NULL);							<br />
				}<br />
//test is the string I got<br />
//and each time I typed some chinese in other program<br />
//the function pVoice->Speak(test.AllocSysString(),SPF_DEFAULT,NULL);	<br />
//will throw out a error <br />
//just as "the memory address 0x00000 can be read"<br />
//but why?the string test is right!<br />
}<br />
<br />


I don'y know where the bug is ,please someone tell me it!
thanks a lot!

Don't look at me in that way!
GeneralAbout serial communication Pin
maggiet21-Apr-03 17:49
maggiet21-Apr-03 17:49 
GeneralRe: About serial communication Pin
John R. Shaw22-Apr-03 18:33
John R. Shaw22-Apr-03 18:33 
GeneralScope of typedef Pin
Makover21-Apr-03 17:42
Makover21-Apr-03 17:42 
GeneralRe: Scope of typedef Pin
Phil Hamer22-Apr-03 13:18
Phil Hamer22-Apr-03 13:18 
GeneralRe: Scope of typedef Pin
John R. Shaw22-Apr-03 18:51
John R. Shaw22-Apr-03 18:51 
GeneralListBox Pin
hurley21-Apr-03 16:47
hurley21-Apr-03 16:47 
GeneralRe: ListBox Pin
Joan M21-Apr-03 21:43
professionalJoan M21-Apr-03 21:43 
GeneralCStringArray problem! Pin
Miguel Lopes21-Apr-03 15:54
Miguel Lopes21-Apr-03 15:54 
GeneralRe: CStringArray problem! Pin
Phil Hamer22-Apr-03 13:22
Phil Hamer22-Apr-03 13:22 
GeneralShellExecute Pin
John L. DeVito21-Apr-03 15:12
professionalJohn L. DeVito21-Apr-03 15:12 
GeneralRe: ShellExecute Pin
Toni7821-Apr-03 16:20
Toni7821-Apr-03 16:20 
GeneralRe: ShellExecute Pin
Rickard Andersson2021-Apr-03 20:17
Rickard Andersson2021-Apr-03 20:17 
GeneralRe: ShellExecute Pin
David Crow22-Apr-03 5:41
David Crow22-Apr-03 5:41 
GeneralTemplate question in C++ Pin
grscot21-Apr-03 11:36
grscot21-Apr-03 11:36 
GeneralRe: Template question in C++ Pin
Alvaro Mendez21-Apr-03 12:07
Alvaro Mendez21-Apr-03 12:07 
GeneralRe: Template question in C++ Pin
Anonymous21-Apr-03 12:23
Anonymous21-Apr-03 12:23 
GeneralRe: Template question in C++ Pin
Joaquín M López Muñoz21-Apr-03 19:56
Joaquín M López Muñoz21-Apr-03 19:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.