|
I know c++ and c# well.But never develop a big project that have so many components and will be extended for long time.
I want to make a program that can be develop by different users.Some of them prefare native app(com dlls, c++ dlls , etc) for components, some of them prefare managed components(.NET base components).
1-)Especially i think that i want to design my UI in c# and then other parts that my algorithms are working with c++ or c# codes.My UI or my application will able to interact between both .net dll or com dlls( i mean native).Is this right way?
I want to learn all your opinions and advices about such a program.I don't want to make mistake.
2-)I mean is this possible?C# host and native dlls.How can i do this?I mean i want to see my roadmap.In which points must i be careful?
3-)Also if i design my programs UI or shell with .net code(like c#) , in future i can utilize .net plugins but if my shell code or UI in c++ i can not write any plugin with managed code.Is this right?
Also if there are any sample applications like that can you send me their links.I really see how must i design my c# exe so it can be interact with both .net and com plugins that develop by differnet users.
Thanks.
I am looking for your answers.
|
|
|
|
|
|
Thanks ravi
I am reading it now.But it seems exe written in C# also plugins written in C#.But my question is especially for C# exe and native plugins (like COM or something else).I want to learn about how i can interact with native components(plugins) from C# exe(UI).
Thanks again.
Good works.
|
|
|
|
|
sawerr wrote: I want to learn about how i can interact with native components(plugins) from C# exe(UI).
Ah. You should be able to define a C# interface that P/Invokes itself into a DLL that exposes a vanilla C API. Using a C API (vs. C++) might be a safer route to work around name mangling issues.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
OK.
As i said i want to interact my exe both .net plugins and native plugins.So i must define my interface in two parts.One of them as you said(for native plugins).The other as the link that sent me in your first post(for .net pugin).Is this right?If something wrong please correct it.
Or are there different ways to do this?Any advice?If you know any sample codes it will be perfect for me.Because I can not find such a sample application.
Thanks.
|
|
|
|
|
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
|
|
|
|
|