Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Cheiron

    Generics in Whidbey

    You raise an interesting point on readability. Languages always seem to start with ease of use and straigtforward readability as the dominant forces, and then move to power over time, but perhaps the languages never really target simplicity at the beginning; simplicity happens at first because...
  2. Cheiron

    c# equivalent of cin?

    Now that you see from the postings above that C# requires direct method calls instead of cin >> x style programming, you may wonder why nobody has ported this C++ chestnut to C#. One part of the answer is that differences between overloading in C++ and C# would make porting that particular C++...
  3. Cheiron

    Generics in Whidbey

    Thanks Chiph, That is an interesting article. At first the restrictions on generics (compared to C++) seem to make generics almost useless, but then when you see the new where T : IComparable style syntax, things exapand back into usefullness. It seems like a better solution than the looser...
  4. Cheiron

    Simple Casting query

    Matt, No, you are not "going mad", although it can seem that way when something that was working one day stops working the next. There is something changing on you, but it isn't your sanity. Adding to the confusion, the cast problem very well could be on the string column. It isn't...
  5. Cheiron

    How do I pass an array to an ArrayList

    ArrayList knows how to work with any ICollection. Arrays don't show all of their interface based methods (to simplify working with them with intellisense in the IDE) but they support all of the collection oriented interfaces that make sense for arrays. ICollection is supported by all arrays...
  6. Cheiron

    Does a console application know where it lives?

    Here are two method: 1) Environment.GetCommandLineArgs() returns an array containing all of the command line arguments. The first argument in this array is the canonical path to the application. No matter how the application is started ("..\myApp", "debug\myApp", etc.) the...
  7. Cheiron

    Stringbuilder Flush

    There is a member that allows it, but what might be surprising at first is that it isn't a method, but a property. Set "Length" to zero. Length is writeable in the StringBuilder class. The internal buffer will be untouched (which is good for performance), and subsequent...
  8. Cheiron

    Programming Language Convergence?

    Languages have now borrowed so much from each other that the key abstractions – good support for components, convenient access to the operating system API, object oriented programming as the primary abstraction, and support for threading, networking (in its various forms), and GUI development –...
  9. Cheiron

    Microsoft error report generated when trying to run this code. Why??

    The program would work, but I'll bet you a dollar you have an extra line at the end of your "records.txt" file that is causing this problem. Make sure the fields are seperated by tabs, and the last line of text is also the last line of the text file. (In notepad for instance, hitting...
  10. Cheiron

    Namespace problem

    If you put this using ServiceClass = service.ServiceClass; at the top of your program, you can then say ServiceClass sc = new ServiceClass() inside of DatabaseClass.
  11. Cheiron

    are namespace definitions unique?

    Yes, you can. Note that namespaces are all or nothing: 1) You can't start in the middle when using a namespace, for instance you can't say "Collections.ArrayList" in an application that has declared "using System;". 2) Sub namespaces under a namespace are not included for...
  12. Cheiron

    Aggregation

    In a proper implementation of delegation you can expose a subset of interfaces on the inner object. You have a bug in your code in the aggregated (inner) class. You should *not* be able to get I2 directly from the inner class I1 via QueryInterface. Your inner component is supposed to be...
  13. Cheiron

    Multi Thread

    I don't know if this will be good news or bad news, but after finding nothing wrong with a quick desk check, I ran your program on my machine and it ran fine. After pressing "a" a bunch of times I had a zoo of multi-colored happy faces bouncing around in the console. I pressed...
  14. Cheiron

    WMI Management

    Yes, you missed a trick, but fortunately it is a really easy one. You just need to add a reference to the System.Management component. You probably know how to add a reference, but just in case, here are the detailed directions for adding the reference you need from within the IDE. 1) Right...
  15. Cheiron

    C# versus VB question

    The postings already up have covered the main topics, so here are some of the code level differences between the two: C# has operator overloading, like C++; VB.Net doesn't. C# allows "unsafe" code blocks with raw pointers (like C/C++ pointers); VB.Net doesn't Late binding is easy in...
  16. Cheiron

    Problem with deserializing..

    It could be as simple as the server version being different from the version of the server the client was built against. If the version number doesn't match, when the object is passed back to the client, it can't deserialize it. Check the client manifest. Look at the version number for the...
  17. Cheiron

    Creating and displaying a new form

    You were pretty close to the answer when you suspected it had something to do with the message loop. The message loop is run from within the Application.Run(theForm); method. Every time your application responds to anything (mouse click, paint request, etc.) the method is getting called from...
  18. Cheiron

    dcom in c#

    You must have done a little more than you show. For this line to work m_Switcher = (ISwitcherSvr) obj; you had to define "ISwitcherSvr" somewhere. If you had been doing complete late binding, you would have been using "Invoke" methods with named methods, instead of...
  19. Cheiron

    dcom in c#

    Yes, this is easy. You can use "TLBIMP" to generate a wrapper assembly from the TLB file describing your DCOM server. After that, accessing the DCOM server is as easy as accessing any other .Net assembly.
  20. Cheiron

    Serializing an object

    It sure sounds like a cycle exists somewhere, which would only be possible if you are doing manual serialization. When you say the classes A & B are serializable, do you mean that they have marked them with the [Serializable] attribute, or did you do more than that (using ISerializable etc.)

Part and Inventory Search

Back
Top