|
Glad to help you
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi,
I am in need of a MTA (Multithreaded) COM component for one of my application.
I would like to know if VC# can be used to develop the MTA COM component instead of VC++? If possible, how? or any info regarding it will be helpful.
Thanks in advance.
|
|
|
|
|
hello..
does anyone know a sample code for saving a text from a textbox to a textfile example .doc then save it to database..
thanks..
ginji
|
|
|
|
|
|
|
Hi All,
I want to create plugins for visual Studio 2005. I used Addin project option and create plugin for VS2005. I also want to know how to register/integrate my plugin into VS2005. Send me exact steps to create plugin for VS2005.
Thanks
Atul Mahajan
|
|
|
|
|
Atul23 wrote: Send me exact steps to create plugin for VS2005.
English is probably not your mother tongue, but this is still a rude thing to ask for, no one will do this work for you.
You can find an article here[^] that shows how to build a VS plugin.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hello
im not a c# expert thats why i came here!!
okay i am using virtual earth in a browser control.
i can call the javascript functions in it from a button with no worries, it works...
such as
executeScript(SetCenterAndZoom,lat1,long1,zoom1);
and if its in a button it works.
but when i make my own function like this..
private void addanotherpoint()
{
executeScript(SetCenterAndZoom,lat1,long1,zoom1);
}
this throws an System.InvalidCastException
i am sooo stumped how do i fix this???
i need to put the javascript function call in my own function not in a button......
!!!!!!!
please help.
thanks guys.
|
|
|
|
|
Hi All,
When your building applications and you don't want all the required assemblies in the root installation directory how do you configure the app to look in a subdirectory of the main apps install location?
like:
\Program Files\App\app.exe
\Program Files\App\External_Libs\data.dll
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
You need to use AppDomain.AssemblyResolve[^] event. Handle it and load the assemblies in the event handler. Something like
static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string assemblyName = args.Name;
return System.Reflection.Assembly.LoadFrom(assemblyName);
}
Hope this helps
|
|
|
|
|
Thanks for this ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi guys, How can i build this relationship class
ClassA intializes ClassB and ClassC if i add ClassA to my Form1.cs it should put ClassB and ClassC objects on the form. So there are only 2 objects displayed on the form. If I want to delete either ClassB or ClassC objects from the Form.cs it should delete all the instances created by ClassA.
I don't know how to start any kind of boosted answer will be appreciated. Thanks
|
|
|
|
|
Your question is not clear. How can you put class instances into form ? Are you developing any componenent that can be sited in the designer ? If yes, derive your class from Component class.
netJP12L wrote: ClassA intializes ClassB and ClassC
Something like this ?
class ClassA
{
private ClassB instanceB;
public ClassB InstanceB
{
get { return instanceB; }
set { instanceB = value; }
}
private ClassC instanceC;
public ClassC InstanceC
{
get { return instanceC; }
set { instanceC = value; }
}
public ClassA()
{
instanceB = new ClassB();
instanceC = new ClassC();
}
}
class ClassB
{
}
class ClassC
{
}
|
|
|
|
|
Thanks for answering but I am trying to develop controls classes. What i want to achieve is that lets say I have an objecX control, and ObjectY control if i delete objectX control so the classY control should be removed if i delete objectY the objectX control should be removed as well.
These two control are depeneded on each other in terms of they both resides or none of them. Each one of them have different behavior and knows how to draw themselves(objectX control and objectY control).
I could have look for either of these two objects on a Form and if one is going to removed then the other one should be removed. But keep in mind is that there could be multiple instances of these 2 control, I think i could call them a composite objects. That's where i am getting struck and not sure how to solve this.
please help thanks
|
|
|
|
|
Sadly, there isn't any concept of deletion in c#. But, since you are using form controls, you could remove the each control from the form.
But here, since you can have many controls of the same type on the form, and one control is independent of the other, you do not have a proper object communication mechanism in place. A possible solution is not to use your custom classes directly, but to have ObjectManager class that would provide functionality to add, remove controls from the parent control(Form). You can then implement the Remove method to do whatever functionality you need since now everything would lie in the hands of the ObjectManager.
|
|
|
|
|
Exactly, that's what i am realizing too. I would appreciate it if you can provide me a demo examples.
|
|
|
|
|
Hi all.
Always I was seeing object sender in parameters of event's method.
What is this and How we can access to the content of it ?
Sample :
void rectangle_MouseDown(object sender, MouseButtonEventArgs e)
{
}
Thanks in advance.
Freshman
|
|
|
|
|
Hi,
object sender is the object (usually a Control) that fired the event.
You can use it by casting it to the appropriate type.
Example: when several Buttons share the same Click handler, do
Button btn=(Button)sender; and now you can use btn.Name, btn.Text, btn.Tag or
whatever you choose to identify which of those Buttons fired the event.
|
|
|
|
|
Nice
Thanks Luc Pattyn.
Freshman
|
|
|
|
|
To extend Luc's answer slightly - the pattern when raising an event is normally to use something like this:
protected virtual void OnMyEvent()
{
if (MyEvent != null)
MyEvent(this , new EventArgs());
}
|
|
|
|
|
I stand slightly extended.
|
|
|
|
|
Pete O'Hanlon wrote: if (MyEvent != null)
MyEvent(this /* This populates the sender object */, new EventArgs());
What's MyEvent. Is it object or method name.
Freshman
|
|
|
|
|
MyEvent was just an example for a name of an event. It could be any event that you want to use.
|
|
|
|
|
Pete O'Hanlon wrote: new EventArgs());
EventArgs.Empty I say!
|
|
|
|
|
leppie wrote: EventArgs.Empty I say!
MyEvent overloaded him. What do you think this would do?
|
|
|
|