|
Hi All,
My problem is:how to get files/folder names of ftp server in C#. If any one know Plz reply.
Regards
SMK
|
|
|
|
|
Hello everyone,
I am trying to add the Speech Recognission into my Windows Application. I have added a button which activates the Speech Recognission once it is clicked by assigning two Event Handeler shown bellow:
// Get an insance of RecoContext "Using Shared RecoContext".
objRecoContext = new SpeechLib.SpSharedRecoContext();
// Assign an eventhandler for the Hypothesis Event.
objRecoContext.Hypothesis += new _ISpeechRecoContextEvents_HypothesisEventHandler(Hypo_Event);
// Assign an eventhandler for the Recognition Event.
objRecoContext.Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(Reco_Event);
Now I would like to add a button to Disable the Speech Recognission. Can someone be kind enough to tell me how I can do this? I tried the following code in order to release the event handler but it is not doing it.
//code to realease the event handler
objRecoContext = null;
Thank you so much for your help and have a great day.
Khoramdin
|
|
|
|
|
I thought you could use -= to remove an event handler ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Christian,
You were correct. I tried it with " -= " and it worked. I must have been on a different planet, mate.
Thank you so much for your help.
Khoramdin
|
|
|
|
|
Salam Aghayeh khorramdin!
May you explian which function do you use in order to define speech?
May I know your email?
|
|
|
|
|
Hi All,
I need to write some GUI application in MFC that will be able to support some COM call from other application.
I want to do it in C# beside MFC - but i don't know how can i write in C# and support all logical architecture that i have in COM.
How can i register the application ?
How can i define some call from other application ?
Thanks for any help.
|
|
|
|
|
You want to write a C# COM object ? There's a wizard for that, I thought.
Being COM, it will work like any COM app, I'd have thought. Otherwise, it wouldn't be COM.
Your other option is to use C++/CLI to call C# libraries within your MFC app.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What do you mean in there is a wizard for it ? how i getting to this wizard ?
|
|
|
|
|
Dear All,
If have the following question. I have two forms. On form one I open another form with the following code :
Form f = new Form();<br />
f.ShowDialog();
A new instance of that Form opens. However .. in form B I want to run a method from Form A. I have to reference an object.
FormA a = new FormA<br />
a.Method();
This works fine, however it opens a new instance of FormA and run the method in the new instance, while what I really want it to do is go back to the previous FormA ( already open ) and run the Method on that form.
Any suggestions ?
thx !!
|
|
|
|
|
Call the method before you do the ShowDialog
Form f = new Form();
f.Method();
f.ShowDialog();
Hope that helps.
Ben
|
|
|
|
|
Rick van Woudenberg wrote: however it opens a new instance of FormA
Yes, of course.
You can do two things.
1 - pass the instance of Form1 in to Form2 ( hack )
2 - define a delegate between the two forms, so that calling a method in form2, runs code in Form1.
There are tutorials on how to use delegates on code project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
FormA a;
...
...
private void call_Method_On_Form_A()
{
if(a == null)
a = new FormA;
a.Method();
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I use modified Rockford Lhotka excellent SetPropertyValue()
from DataMapper class to load objects from database.
My entity object property names are mixed case.
DataReader returns lower-case only column names.
So SetPropertyValue() cannot map columns to property names.
How to change this code so that it does not depend on the propertyName case ?
public static void SetPropertyValue(
object target, string propertyName, object value)
{
PropertyInfo propertyInfo =
target.GetType().GetProperty(propertyName);
if (value == null)
propertyInfo.SetValue(target, value, null);
else
{
Type pType =
Utilities.GetPropertyType(propertyInfo.PropertyType);
Type vType =
Utilities.GetPropertyType(value.GetType());
if (pType.Equals(vType))
{
propertyInfo.SetValue(target, value, null);
}
else
{
if (pType.Equals(typeof(Guid)))
propertyInfo.SetValue(
target, new Guid(value.ToString()), null);
else if (pType.IsEnum && vType.Equals(typeof(string)))
propertyInfo.SetValue(target, Enum.Parse(pType, value.ToString()), null);
else if (pType.IsEnum && vType.Equals(typeof(decimal)))
propertyInfo.SetValue(target,
Enum.Parse(pType, value.ToString()), null);
else
propertyInfo.SetValue(
target, Convert.ChangeType(value, pType), null);
}
}
}
}
}
Andrus
|
|
|
|
|
You could try to every where you see a ToString() add a .ToLower()
to set the property name to all lower.
The method you posted seems to be where the property value is getting set. I am not sure you can make changes to where the value is getting set to get the property name to make lower case.
Hope that helps.
Ben
|
|
|
|
|
I have a web application that references an access database in my app_data folder. Locally I can reference the db by C:/My Docs/Visual Studio 2005/Website/My Website/App_Data/myaccess.mdb
My question is, in my code how do I reference the database relatively since I do not know what drive and directories my site will be stored on? I've tried ~/App_Data/myaccess.mdb (tried this locally and it does not reference the db) and it does not connect. All suggestions welcome thanks.
|
|
|
|
|
|
I'm not exactly sure how to incorporate this into my connection string
//create an open string
string conString = @"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=C:\Documents and Settings\My Name\My Documents\Visual Studio 2005\WebSites\MySite\App_Data\td.mdb";
i've tried
@"data source=" + Server.MapPath("http://www.mywebsite.com/App_Data/td.mdb");
and get an error.
Please advise. Thanks.
|
|
|
|
|
The MapPath method takes a virtual path, not a complete url. Use just "/App_Data/td.mdb".
dboy221 wrote: and get an error.
That is way too specific. Could you be a bit more vague, please?
---
single minded; short sighted; long gone;
|
|
|
|
|
That did it. Thanks guys.
|
|
|
|
|
Hi.
I need to capture the event when the mouse leaves the panel and its left button pressed.
Can anyone help me with this?
What should i do?To write my own wndProc or ...?
Thank You.
|
|
|
|
|
You can capture the mouse, and then you will get mouse messages even when the mouse leaves your control. Then, you can capture the button click and check if the mouse is over the panel. If not, you have your event. You would then release capture of the mouse, so that the events would be passed to other controls after that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok, and how i should to capture the mouse buttons click?
|
|
|
|
|
The point of capturing the mouse, is that the click event will be fired in your control, even if the mouse has left it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have about 100 dynamically generated panels.
And i need for example press the left-mouse button on the one and then just drag the cursor down and all panels which will be on my way for example must change the color.
I think that now it is more understood able.
|
|
|
|
|
OK, sounds like you need to be handling events in the parent form, not the panel.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|