Click here to Skip to main content
15,917,454 members
Home / Discussions / C#
   

C#

 
QuestionCursor and windows form Pin
indimu8-May-06 9:39
indimu8-May-06 9:39 
AnswerRe: Cursor and windows form Pin
Shy Agam8-May-06 23:38
Shy Agam8-May-06 23:38 
QuestionListbox Pin
JMichael24688-May-06 9:37
JMichael24688-May-06 9:37 
AnswerRe: Listbox Pin
NaNg152418-May-06 9:51
NaNg152418-May-06 9:51 
AnswerRe: Listbox Pin
microsoc8-May-06 16:31
microsoc8-May-06 16:31 
GeneralRe: Listbox Pin
JMichael24689-May-06 2:44
JMichael24689-May-06 2:44 
QuestionFew focused questions Pin
NaNg152418-May-06 9:37
NaNg152418-May-06 9:37 
AnswerRe: Few focused questions Pin
NaNg152418-May-06 9:40
NaNg152418-May-06 9:40 
GeneralRe: Few focused questions Pin
Stefan Troschuetz8-May-06 10:46
Stefan Troschuetz8-May-06 10:46 
AnswerRe: Few focused questions Pin
Stefan Troschuetz8-May-06 10:58
Stefan Troschuetz8-May-06 10:58 
AnswerRe: Few focused questions Pin
DigitalKing8-May-06 17:46
DigitalKing8-May-06 17:46 
GeneralRe: Few focused questions Pin
NaNg152419-May-06 0:52
NaNg152419-May-06 0:52 
QuestionRe: Few focused questions Pin
NaNg152419-May-06 1:54
NaNg152419-May-06 1:54 
AnswerRe: Few focused questions Pin
DigitalKing9-May-06 19:47
DigitalKing9-May-06 19:47 
QuestionFew focused questions Pin
NaNg152418-May-06 9:36
NaNg152418-May-06 9:36 
QuestionWalking an XSL to get node/attribute data Pin
LongRange.Shooter8-May-06 9:05
LongRange.Shooter8-May-06 9:05 
QuestionAsyncCallback Pin
yongwpi8-May-06 8:54
yongwpi8-May-06 8:54 
QuestionRichTextBox throws tab in there Pin
likefood8-May-06 8:25
likefood8-May-06 8:25 
AnswerRe: RichTextBox throws tab in there Pin
LongRange.Shooter8-May-06 9:09
LongRange.Shooter8-May-06 9:09 
GeneralRe: RichTextBox throws tab in there Pin
likefood8-May-06 9:23
likefood8-May-06 9:23 
GeneralRe: RichTextBox throws tab in there Pin
likefood8-May-06 9:28
likefood8-May-06 9:28 
AnswerRe: RichTextBox throws tab in there Pin
likefood8-May-06 10:01
likefood8-May-06 10:01 
GeneralRe: RichTextBox throws tab in there Pin
Office Lineman8-May-06 12:32
Office Lineman8-May-06 12:32 
GeneralRe: RichTextBox throws tab in there Pin
likefood9-May-06 7:27
likefood9-May-06 7:27 
Questionspeech sdk5.1 Pin
TheEagle8-May-06 8:09
TheEagle8-May-06 8:09 
Hi..
I want to use the CmdLoadFromResource() method of ths speech SDK 5.1 to make the xml file that includes the Grammar embeded but i dont know how to use this method in C#.

This code shows how i used this method:

[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern long LoadLibrary(string lpLibFileName);
private void button2_Click(object sender, System.EventArgs e)
{
this.objRecoContext = new SpSharedRecoContext();
this.objRecoContext.Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(RecoContext_Recognition);
this.objRecoContext.State=SpeechRecoContextState.SRCS_Enabled;
grammar = objRecoContext.CreateGrammar(0);
int hModule=Convert.ToInt32(LoadLibrary("ReviewWinApp.dll"));
int langID=409;
grammar.CmdLoadFromResource(hModule,"tryRecog.xml","CFGGRAMMAR",langID,SpeechLoadOption.SLODynamic);

grammar.State=SpeechGrammarState.SGSEnabled;
grammar.CmdSetRuleIdState(1,SpeechRuleState.SGDSActive);

}

When i click this button i got the error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ReviewWinApp.exe
Additional information: The specified resource type cannot be found in the image file.

I am not good in COM programming.Could any one give me a C# code sample for using this method?Cry | :((

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.