|
sawerr wrote: define my interface in two parts
It seems that would be an appropriate way to go. I would first work on defining the .NET one and getting that to work, then extend that to work with a C DLL.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thanks ravi for all answer.
One more question i have.Why did yo say C DLL?I think i must force developers (that prefer to write native dll) for writing their dlls in COM.Is this wrong?Now i make a decision that:
My UI will be in C# ; plugins which will be in native format must be COM dll.Choosing com technology is wrong?
Thanks again.
|
|
|
|
|
Sorry, yes you could certainly expose a COM interface and P/Invoke that.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I may be an Idiot for asking this but it is friday and my brain is fried, lol. But in a C# Class can you just declare an Enum? Other Classes will use this single Enum as a standard across the application.
|
|
|
|
|
Yes, you can. For example:
public class IceCream
{
protected IceCream()
{
}
public enum Flavor
{
Vanilla = 0,
Chocolate,
Strawberry,
}
} Client classes can then refer to objects of type IceCream.Flavor that could have a possible value of IceCream.Flavor.Vanilla .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hello,
I have got an problem with Painting in C#. When i resize an image, the right side will get more and more transparency.. i dont want that, but i dont know how to fix it.
A part of the code:
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
<br />
Graphics g = e.Graphics;<br />
<br />
g.DrawImage(Properties.Resources.WindowTopMiddle, 12, 0, this.Width - 22, 40);<br />
g.DrawImage(Properties.Resources.WindowTopLeft, 0, 0, 12, 40);<br />
g.DrawImage(Properties.Resources.WindowTopRight, this.Width - 12, 0, 12, 40);<br />
<br />
g.DrawImage(Properties.Resources.WindowLeft, 0, 40, 8, this.Height - 52);<br />
g.DrawImage(Properties.Resources.WindowRight, this.Width - 8, 40, 8, this.Height - 52);<br />
<br />
g.DrawImage(Properties.Resources.WindowBottomLeft, 0, this.Height - 12, 12, 12);<br />
g.DrawImage(Properties.Resources.WindowBottomRight, this.Width - 12, this.Height - 12, 12, 12);<br />
g.DrawImage(Properties.Resources.WindowBottomMiddle, 12, this.Height - 8, this.Width - 22, 8);<br />
}<br />
You can see, some images have their normal size, and wont get the transparancy..
But the sides, top/bottom middle will.
I dont have changed any default settings, the editor I use is 'Microsoft Visual C# 2005 Express Edition'
Could you please help me?
I look forward to your reply.
- Thomas
-- modified at 15:25 Friday 30th June, 2006
|
|
|
|
|
Hi guys!
I have a click event in one of my forms which is supposed to open another form. How can I ask it to close the current form and open the new form. Basically before I open the new form, close the old form.
Thanks for your help in advance!
sasa
|
|
|
|
|
Try this:
Form1.cs
--------------------------
Form2 form2 = new Form2();
form2.Show();
form1.Close();
|
|
|
|
|
I
SASA_1 wrote: before I open the new form, close the old form.
n the click event handler, you could write something like this:
this.Close();
formw.Visible=true;
I guess it should work.
Regards,
Wasif Ehsan.
|
|
|
|
|
Thank you guys for your help. Neither of these worked. If i use form2.show(); and then form1 or this.close(); it closes both the forms. If I use this.close and then form2.showdialog() offcourse it closes form1 and never opens form 2. If I use form2.showdialog and then this.close then it opens form2 but form1 stays open until I close form2.
What I am trying to do is close form1 as soon as form2 opens. Please help!!!
sasa
|
|
|
|
|
If Form1 is the main form of your application then on closing it terminates the main thread. So Form2 are closed too. You should hide Form1 and close it only after Form2 is closed. Try this in your Form1:
<br />
private void ShowForm2()<br />
{<br />
Form2 form2 = new Form2();<br />
form2.Closed += new EventHandler(form2_Closed);<br />
form2.Show();<br />
Hide();<br />
}<br />
<br />
private void form2_Closed(object sender, System.EventArgs e)<br />
{<br />
Close();<br />
}<br />
|
|
|
|
|
Thank you Alygin, I will try this, I really appreciate your help.
sasa
|
|
|
|
|
Hi,
I want to have a little suggetion from you. I am working in a company which needs to connect to several other companies. Now we need to send data to & from other companies using public domain network like Internet. I want to know what is the best, most efficient & particularly secure way of doing it. Web Services, Sockets or any thing else. The amount of data is average i.e. not very small and not very big.
Regards,
Wasif Ehsan.
|
|
|
|
|
I don't know what kind of budget you have for this project, but this[^] would be a good solution for your needs.
I think the cost, excluding hardware, would be around 20K, including licenses for SQL Server 2005 and BizTalk 2006.
I work with this product since 3 years and I must admit I like it.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Imho, web services would be the way to go.
If you're unable to keep a server running at either end and don't require the transfer to be in "real time", you could (programmatically) email each other the data.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I mean to say i want to implement that thing in my own application. I dont(can't) use any already built products like BizTalk etc. I am in process of making an application for which i needed suggestion.
Regards,
Wasif Ehsan.
|
|
|
|
|
I wasn't suggesting you use BizTalk.
Like I said, you could use webservices to easily establish a data transfer (and processing, if you like) conduit. If you can't keep the webservice servers running at all times, you may want to consider a non-realtime SMTP/POP solution. The latter only requires access to an email account.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Tcp sockets would be my first choice, if it's just data transfer.
Best,
Jun
|
|
|
|
|
Hey, i have an int[] that i need to be able to set in the code, but i also want the user to make sure the values are set right. i have a base class that every node in my flowchart uses then to hide and show specific properties i just cast the base class to an "info" class that only shows the properties that matter to that node. i do this for display purposes only the code treats everythign the same...so for this property there are getters and setters in the base class..but in the "info" class i have the property set to read only, and i've tried removing the set part of its declaration, but nothing helps. the first line(where it has the name of the property, and also says Int32[] array) is read only, but when you hit the + sign to expand the array to see what values it contains, the values arent read only. if it matters the values are id numbers that are automatically set for each node, that hte user can see but i dont want to trust them to type them in(they're set via a context menu on the link between two of em) the user just says set to 0 or 2, with 0 or 2 bieng spots in the array and the value being the id of the node that link goes to...so i need the values visible in the property grid just not editable..
sorry for the long post, but most of the time i get more questions than answers in other forums...i'm tryin to get out of that habit.
thanks for your help
|
|
|
|
|
|
yeah thats what makes the first line read only, but doesnt seem to affect the rest. i've also tried removing set from the property declaration but that doesnt seem to be working either.
|
|
|
|
|
Removing set won't work because while the array itself cannot be set to another array, the individual elements can be changed. What you may want to try is use a ReadOnlyCollectionBase . It may be what the properties grid needs to see to know that the elements cannot be changed.
Logifusion[^]
|
|
|
|
|
how would i cast the int[] or arraylist or anything to the ReadOnlyCollectionBase for just the properties grid..i still need to edit the values..i just cant let the user change them via the property grid.
|
|
|
|
|
n/m i have the desired result..i turned it into an ArrayList and used the ArrayList.ReadOnly() function to prevent changes..the only problem is that now it wants to use the collections editor instead of expanding the list like it does for arrays...if you have any ideas on how to force it to show as an array but stay read only it'd be great but if not i'll try to convince them to live with this.
Thanks for all your help
John.
|
|
|
|
|
Try sticking this on the top:
[EditorAttribute(typeof(System.ComponentModel.Design.ArrayEditor), typeof(System.Drawing.Design.UITypeEditor))]<br />
<br /> Using the EditorAttribute allows you to change the UITypeEditor being used in the properties window. When writing a control, this is how you would create your own custom editor for a particular property. From what I can see, there's a CollectionEditor and an ArrayEditor. Using an ArrayEditor may not work with an ArrayList, though. If I weren't lazy (or at work) I would actually create a project and try this out myself. Oh well, let me know if that works.
Logifusion[^]
|
|
|
|