| read double as array (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| I am changing a numerical program in java to c#. First of all, I need to read data file such as junk.txt: 1.1 1.2 1.3 1.4 I can not find a method to read it as a double array like a[1],a[2], a[3], a[4]. could you help me to do this? Thanks, David |
|
| some potentially dumb questions about connecting to the Internet (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| I want to get into some Internet stuff with C#. I started reading about it in the doc and as usual was totally confused within minutes. What I am used to (from VB) is dropping an ActiveX control on a form say a control that encapsulates FTP operations. I would write some kind of code like this: with FTPControl .Host whatever .UserName me .Password yo mamma .Connect end with (I know there is no Wit... |
|
| How to represent LPCTSTR? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| I am calling a external C DLL. One of the arguments is a LPCTSTR? There does not seem to be an equivalent in C#. In the C# declaration of the external function, I have a ref string but modified by a [MarshalAs(UnmanagedType.xxxx)]. I have tried all of LPSTR, LPTSTR, LPWSTR and nothing works. |
|
| File Permissions (9 replies) |
| microsoft.public.dotnet.languages.csharp |
| I am a Java Programmer that has recently taken on the task of developing an application for Win NT/2000/XP platform. I needed to use the Win32 API but Java doesn't allow direct access so I was going to use JNI w/ in conjunction with a C file but I figured I would try this C# thing out. I have no C experience, however, I noticed how C# is very similar to Java. What I need to do is get and maybe set... |
|
| UserControl / Panel? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hello, I want my UserControl derived control to act like a Panel (what means if it is placed on a Form other controls can be put on it in design time). But I don't want a Panel derived class, because it must be derived from another UserControl for some reason, it just has to accept other controls. I already tried the SetStyle method (maybe the wrong way), but my UserControl still does not accept o... |
|
| How to post a message in C# / .NET ? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| How can I send a message ( from a button in a control container) to a control (from another control container) with C#/.NET? Is there something like ::PostMessage(...) from WinAPI? Thanks! |
|
| BLOB again (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hello I had posted a question a few days back regarding how to read a BLOB from a SQL Server 2000 db. I had set the datatype as image as suggested by ppl here. Now the following is my question in continuance to that. What i am trying to do is that insert a hashtable into the db as a blob and at a later stage read the blob back and convert it back to a hashtable. Any ideas ???? TIA Regards Khozema |
|
| TypeInfo from inherited class in static method (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, Here's a simple representation of what I want to do: public class SimpleModule { public static void DoIt() { //here it needs the classname of the calling type //can't use this.GetType().ToString() cause it's static Console.WriteLine(/*the classname*/?); } } public class Logger : SimpleModule { } When I call Logger.DoIt(), DoIt from the parent class SimpleModule is called where it would show th... |
|
| Please explain IEnumerator? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| I have implemented for each syntax on my objects but when I inspect them in the debugger I can't see the list. You know how the debugger will let you see the items in collections, why doesn't that work on my objects? Griffo |
|
| problem about struct! (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Accroding to MSDN Lib about struct keyword ms help://MS.VSCC/MS.MSDNVS/csref/html/vcrefStructTypes.htm It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values. emp e; Console.WriteLine(e.EmpID);//Error!!Use of possibly unassigned field "EmpID" struct emp { public int EmpID; } If ... |
|
| HELP: building a linked list in C# (8 replies) |
| microsoft.public.dotnet.languages.csharp |
| could someone give me pointers on how to construct a linked list in C#? I'm not looking to use the CRL provided collection types and I've already been told that using unmanaged code may not provide the fastest implamentation. However i'm unsure how I can construct something like a binary tree or other styles of collections w/o using unsafe code. thanks, Eamon ( ca remove this mge (a) namllime ) |
|
| Deriving from System::Array (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Does anyone know how to derive a new type from System::Array? In managed extenstions if you do this: public gc class MyArray : public System::Array { public: MyArray(){} ~MyArray(){} static void test() { MyArray * one new MyArray(); } }; And then call test(), the system throws a "System.TypeLoadException: Could not load type MyArray from assembly MyAssembly, Version 1.0.818.19576, Culture neutral,... |
|
| why does it take so loooong to execute? (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hello, I was playing with finalizers in C# and created this little stupid program, it compiles and runs fine, but it takes about two to three seconds from the point you press the ENTER key to execute the program to the point where you start seeing output on the console. The program was created in notepad and compiled with csc, and run on a windows 2000 SP2, Pentium III 1GHz, 512 MB ram with the la... |
|
| Getting the command line params (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi guys (and girls), Do you know how do I get the command line params from C#? I need it on both Console and Windows app... Thanks Lior, Tel Aviv, Israel |
|
| Control Arrays/Dynamic Arrays (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Can someone tell me what I need to do to create both of these? I know it has something to do with the Arraylist. I had a good article in the MSDN site on it but try as I might I haven't been able to find it. Can anyone help me out? NIck |
|
| Adding Functionality to the SaveFileDialog (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| I want to add a ComboBox to the SaveFileDialog, to obtain additional information about the format (like the encoding combobox in notepad.). The SaveFileDialog class is sealed, and the documentation declares that its impossible to inherit from the FileDialog either . Is there a way around, or should I write a whole new form? |
|
| How can I make this work with webforms? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| ms help://MS.VSCC/MS.MSDNVS/vbcon/html/vbwlkwalkthroughaccessingxmldata.htm How does this walkthrough need to be modified to work with webforms(C# ASP.NET application)? It works fine in a windows application, however if you make it into a web app it will read and display the schema in the textbox but does not show the data in the datagrid. Also had to remove this line from the webform code as ther... |
|
| Catch Class Destroy (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| How do you catch that a class is being destroyed? Say I have a class that must create a temp file and it internally maintains the file. When the class is no longer needed, it should delete the temp file. Thanks! class FileInfo { public FileInfo() { // Creates Temp File } // Needs to delete the temp file when destroyed } // Now I use the class FileInfo fi new FileInfo(); // Use fi here // Destroy o... |
|
| Help! What's wrong with this code (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hello Could someone please point out what I'm doing wrong here. It won't compile. I'm new to C# so please bear with me. using System; class format { private float amount; public format(float amount) { this.amount amount; } public string Amount { get { return ("Amount is {0:C}", amount); } } } class formatTest { public static void Main() { format ft new format(123.45F); Console.WriteLine(ft.Amount)... |
|
| Can I use an array or collection like object and update its contents directly? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| I have an array of Point objects (coordinates for a triangle) which I am looping through to change on a timer interval: Point[] points {new Point(0,0), new Point(0,280), new Point(280,0)}; In my timer event, I tried to loop through the points and reassign the value using the foreach iterator, expecting that I would receive a reference to the object which I could use normally (as I could in VB): fo... |
|
| It makes no sense... (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| All objects for Remoting must inherit from MarshalObject. But what if my class already inherits after for example ServiceBase. There is no way to class inherit after two classes so what to do in such case? |
|
| Override TreeView WndProc? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| I tried to override both WndProc and DefWndProc in that way : protected override WndProf( ref Message X ) { WndProc( ref X ) ; } If I don't call WndProc from my overridden WndProc following error occurs in Forms.DLL : Win32Exception error in creating windowhandle ; If I call WndProc, obviously, I get an overflow exception. Can someone give me a hint, please? Thanx :) |
|
| TreeView problems (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| HI, I am developing an application which relies on System.Windows.Forms.TreeView and I noticed a couple of problems. The number one being a right click does not select a TreeNode. Also there is not support for a ContextMenu on a per node basis. I thought this was very common functionality. I obtained a IL C# decompiler to look at the TreeView code in an attempt to extend it's functionality and not... |
|
| Update Object must implement IConvertible? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| When I run the following code, I receive the following error, "Update Object must implement IConvertible" // Set Parameter value from Textbox SqlInt16 NoAdults value; if(tbxHawaiiBookings NoAdults.Text String.Empty) { NoAdults value SqlInt16.Null; } else { NoAdults value SqlInt16.Parse(tbxHawaiiBookings NoAdults.Text); } Update(NoAdults value,strConnectionString); // Update Database with value pub... |
|
| Which MessageID for scroll events? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I've overridden a control's WndProc and would like to catch a scroll event from the Message.Msg . But I don't know the ID of a scroll event. Where can I get a list of that ID's ? |
|