|
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 )
|
|
|
|
|
i have a greduation work about real time simulation.i have already modeled my robot arm on 3d max studio and i have XAML converter.but i dont know how to write my code in visual c#.net.what must i do?i have net framework 3.how can i simulate my robot arm with visual c#?please anyone writes step by step.
|
|
|
|
|
If you have a XAML converter, then I'd guess you have your model in XAML, so it shows in WPF. The next step, is to write the code that moves it. Really, your question is both too vague, and too broad for you to expect an answer in a forum to solve your issue for you. I'm not even clear on if you know the first thing about C#, if you know more about WPF than you saw in an ad somewhere, or what skills you're bringing to the table, you just sound like a confused guy who knows some buzzwords and is hoping for a magic bullet.
So, try asking your question more clearly, the answer will probably be, try to write it and ask specific questions when you get stuck.
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 )
|
|
|
|
|
1)i have modeled my robot arm.
2)than i export it to XAML
which platform will i use for doing WPF project?
visual c# is enough for me?or will i use another platform?(aurora and like this?)
can u write me step by step how can i do wpf simulation? which platform i need?and which converter can be better?ok: )i dont know anything about wpf and explain me as you try to write small baby(me: )) please can u write step by step how can i do wpf project?which platform will be used in simulation?
|
|
|
|