|
Have you look at MessageQueue class?
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
I'm using VS .NET and in the solution Explorer i can see a .exe file but i can't find a .dll for the same file. I need the .dll for assembly referencing. Is there a way of creating the .dll when i only have a .exe
|
|
|
|
|
Not unless you rewrite the code to be in a .DLL. The two files have very different entry points and startup routines.
Visual Studio wont let you set a reference to an .EXE, but the commandline compiler, csc, will let you reference an .exe. There was another thread in this forum that spelled this out earlier this week.
RageInTheMachine9532
|
|
|
|
|
Just try renaming it from exe -> dll should be ok dll -> exe will obviously not.
top secret
|
|
|
|
|
In the following code pTable is of type CustomerTable, which inherits from DataTable. How can I change the "if" statement to check that pTable is derived from DataTable as the statement currently tests false, because the types are different. I thought I would cast ptable, but the of course that would throw an exception if that cast is invalid.
if (pTable != typeof(DataTable))
{
throw new EwGeneralException(lStk, EwExceptionID.DdlNotDataTable);
}
Many thanks for reading.
Nursey
|
|
|
|
|
Can you try
if (typeof(pTable).BaseType !=typeof(DataTable))
....
James
|
|
|
|
|
You're comparing apples and oranges, there. pTable is an instance, and the typeof operator will always return a Type , so the two would never match unless pTable was a variable which held a Type .
If you want to check is something is an instance of a particular type, simply use the is operator:
if (pTable is DataTable)
{
} You can also use something like this, although it requires more code and more instructions (when compiled to IL):
if (pTable != null)
{
if (pTable.GetType() == typeof(DataTable))
{
}
} There's other ways of doing this, but you don't have to take inheritance into account. If CustomerTable inherits form DataTable , then any instance is a type of CustomerTable , DataTable , MarshalByValueComponent , and - as with everything in .NET - Object . It's also an instance of any interfaces that any classes up the inheritence hierarchy implement.
This isn't true going down the hierarchy, though. For example, if you instantiate a new instance of a DataTable , then it is not an instance of a CustomerTable .
Also keep in mind that it's not the declaration that counts, its the definition. For example:
object o = new DataTable("Example"); While o is declared as an object , it's still an instance of a DataTable . Calling o.GetType will return System.Data.DataTable . This is polymorphism.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've developed a simple attribute EwBindSkipAttr which is then used on an abstract member of a class, in the hope that all derived classes which must then implement this member will inherit the attribute on their overriding members. This seems to be correctly implemented...the documentation states that the default is for derived and overriding members to inherit attributes. Here's my simple attribute in use...
///
/// Return DDL wrapper for table
///
[EwBindSkipAttr]
public abstract DataDDL DDL{get;}
The problem is that in the derived classes I have behaviour which indicates that the attribute has not been inherited. Any thoughts please?
Nursey
|
|
|
|
|
Attributes are inheritted by nature, but code which gets and uses these attributes - like MemberInfo.GetCustomAttributes - provide parameters that specify whether or not the calling code wants to get inheritted parameters.
What behavior is this that you mention? There's many things that can contribute to problems you're facing. Remember, attributes don't provide functionality to Types, they merely extend the metadata of a Type so that if something asks for it the attribute and its data is returned. Simply attributing your class with a custom attribute certainly won't do anything if nothing asks for it and uses it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Everybody - Happy Easter, have a peaceful weekend...
I'd like to ask, to what extent do you use the XML tags in your code (such as summary etc.)
I wonder if you could point me to some code that you consider "model" in its illustration of good practice. Also, do you use any additional tools.
I have a developed an architecture that I consider elegant and simple to use, but to maintain it, it would require good documentation. I would welcome any thoughts and guidance so I can get past my basic use of summary and parameter tags.
Many thanks.
Nursey
|
|
|
|
|
At least document everything public and protected, anything which can be seen by other code. Use all relevent XML tags. This includes, obviously, the <summary> . If your method has parameters, then use the <param> tags. If you return values, use the <returns> tag. If you explicitly throw an exception or let one slide that you want to make sure developers know is possible, use the <exception> tags. Basically, use any tags that are relevent to the to member. If you want to provide more information about something, then use the <remarks> and/or <example> tags.
For a great and free documentation compiler, see NDoc[^]. I've had the pleasure of working on it and I know this product is stable. Just look at the huge list of clients, including Microsoft. It can generate many formats like HTML Help 1 (ex: VS6 docs) and 2 (ex: VS7+ docs). It looks just like the current VS.NET / MSDN documentation as well.
For larger products in a corporate environment, you might consider abstracting all comments away to separate files. Then use the <include> tag to specify an XPath expression that imports the documentation. This seems to be what Microsoft does since many members - especially overloaded methods - share the same content for various sections.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hand, Stop, and Error all use the big X.
Warning and Exclamation share a triangle with an exclamation point.
Asterisk and Information share a bubble with a lower case 'i'.
Does this provide the option for me to replace these icons with my own?
|
|
|
|
|
Bupkus wrote:
Hand, Stop, and Error all use the big X.
Warning and Exclamation share a triangle with an exclamation point.
Asterisk and Information share a bubble with a lower case 'i'.
That is correct. It is a hang-over from the "olden days" ( Am I getting old?) when the enumerations had different names.
Bupkus wrote:
Does this provide the option for me to replace these icons with my own?
Not as far as I am aware.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
If you want a better message box, create one. With the MessageBox in the FCL, what you see is what you get. This P/Invokes the native MessageBoxEx API, which is also limited.
Just build a Form derivative with a lot of the same functionality, perhaps exposing a public property for setting icons or stick the with single, overloaded method like MessageBox.Show where you can provide a custom icon. The Form derivative should be smart enough to resize itself when need and to allow for the customization of Button s based on what's needed, as well as where to place them. It's really not as hard as it might sound, though, and many developers including myself have done this from time to time to provide a more feature-rich dialog.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hiii...alll
i 'd like to send data files and text between clients ,,,with no servers in between(No Ftp Server).....
Also I wanna to know the connection between clients
Thanks,,,all
|
|
|
|
|
kano zangeef wrote:
i 'd like to send data files and text between clients ,,,with no servers in between
This is a little vague. Can you be more specific?
I assume you mean outside of a LAN situation. And I am also assuming you don't want your existing windows to act as FTP servers either (which could have been an option as it is built into Windows). Further, I am assuming that you want the files to be transferred both ways - In other words Computer A can send files to and request files from Computer B, and also Computer B can send files to and request files from Computer A.
kano zangeef wrote:
Also I wanna to know the connection between clients
Sorry, I don't understand this. Do you mean what technology do you need to use in order to achieve your goal? Or what?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
I think he means something like P2P networks without a central server. The Gnutella protocol is one example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If you want to create a P2P network, you need to either define and implement the protocol yourself, implement an existing protocol, or use an existing protocol along with an existing library. Windows XP SP1 introduced a new P2P library that I know someone here was working on wrapping.
If you don't need an entire P2P network of clients and just want to communicate between two distinct clients, then you just need to use simple socket communications or .NET Remoting (a much more powerful technology using ubiquitous protocols like HTTP and SOAP).
For more information on .NET Remoting, see Accessing Objects in Other Application Domains using .NET Remoting[^], as well as http://www.ingorammer.com[^]. Pick up a good book, too. With power (extensibility) comes complixity.
For simple socket communications, see the System.Net.Sockets[^] namespace in the .NET Framework SDK, specifically the Socket class (for low-level comms), or the Tcp* and Udp* classes. Note that using this mechanism you're still left with defining at least a simple protocol whereby clients agree to so that they can communicate correctly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How do I open a Collection Editor for a property in code? I know how to open if via the property editor. I want to force it open via code. Obviously it's doable, because VS.NET is doing it in the property editor.
Any ideas?
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
Jamie Nordmeyer wrote:
Obviously it's doable, because VS.NET is doing it in the property editor
I think that is part of the Visual Studio IDE and not part of the .NET Framework.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Add the Editor attribute to the property, and set it to the type: System.ComponentModel.Design.CollectionEditor
I have a symbiotic relationship with my computer.
|
|
|
|
|
He's asking how you open it, not attribute your collection class/property with one.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
VS.NET provides an implementation of the IWindowsFormsEditorService that UITypeEditor s like the various collection editors use. It's not a simple question of just showing the form.
First, call TypeDescriptor.GetEditor with either the object or Type for which you want to get the collection editor. Cast that to a UITypeEditor . If not null , call UITypeEditor.EditValue passing an implementation of the IServiceProvider - which you must implement - along with the collection to edit.
In your implementation for the IServiceProvider , you must return an instance (could be the same instance) when the IWindowsFormsEditorService is requested, which you would also need to implement. This is what the specific UITypeEditor uses to display its collection editor form.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath. That did the trick!
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
Does anyone have a code in c# for an application for a ticket agency that sells tickets in 3 auditoriums. The program should allow for the sell of specific available seats in the various price and location categories for the specific theater layout and performance and should be graphically displayable.
Thank You
|
|
|
|
|