| calling windows apis, importing dlls in c# (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| I'm trying to create an app bar (like the office app bar, star menu bar) in csharp. I don't think there are any apis built in to do this and so I was going to import the shell32.dll apis. Trying to figure out how to pull in a dll I tried to compile csc ... the sample code I found on the http://www.c sharpcorner.com/ and got the following compile error: CS0246 type or namespace name sysimport could... |
|
| Confusing stuff: Instantiating a class within a static method belonging to its ascendant? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Basically, here is what I'm trying to do: abstract public class Account { public static void LoadAccounts() { .... POP3Account pop3 new POP3Account(); // line 163 .... } } public class POP3Account : Account { .... } I get this error: (line 163) 'POP3Account' denotes a 'class' which is not valid in the given context How can I do this properly? Sam |
|
| When is an objects destructor called (6 replies) |
| microsoft.public.dotnet.languages.csharp |
| I have code that I put in the destructor method of one of my classes, but the destructor never seems to be executed. Can anyone tell me why this might be happening? Below is the destructor for my object in case it might help. ~Item() { CurrentContext.Session.Add("Item" Items); } if it makes a difference Items is of type ArrayList. thanks, Aaron |
|
| Can you assign an enum to a property value? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hey all.... I realize that this is a bone head question butt..... Is there someway I can assign or pass an enum in a set property? I want to restrict the types of selections possible in my property... Thanks! |
|
| Firingng events from worker threads and do events happen asynchronously after all? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| 1) Is it ok to generate events from one thread that will be handled in another thread? 2) When one fires an event, does the handler(s) have to finish handling the event before the function continues? example: void MyBigEventTest() { DoSomeImportantWork(); CallMybigEvent( EventParameters ); // will this wait for the other side to return before continuing? ContinueDoingSomeImportantWork(); } class M... |
|
| Problems with 'DllImport' and to call the API Function 'GetLogicalDriveStrings' (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi How must I declare and call this function? [DllImport("Kernel32.dll", EntryPoint "GetLogicalDriveStrings", SetLastError true)] internal static extern uint APIGetLogicalDriveStrings ( uint nBufferLength, // size of buffer ????? lpBuffer // drive strings buffer ); ????? buffer new ????? (); uint uu APIGetLogicalDriveStrings(200, buffer); TIA p |
|
| Thread Safe? (22 replies) |
| microsoft.public.dotnet.languages.csharp |
| I think I'm still confused about the meaning of Thread Safe. When exactly is a component thread safe? If a component contains only member specific properties, does not use the same resources (ie. does not write to one file, etc) is it thread safe? Also how does object pooling have anything to do with this? If I run a web app where a custom written C# class is initialized, will each page (each user... |
|
| Debugger incosistencies with strings including \x0000 (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, Perhaps this is by design and I'm missing something. I also apologize if this has been covered before; I couldn't find any posts If you place a breakpoint on the third line of code in the debugger and run it, you'll see that s2.Length is 0 in locals/command. However, when evaluated in code, it returns the length of the byte array it was converted from. The array contains 256 "\x0000"s. I've fo... |
|
| Equivalent to CreateObject with a ProgId? (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| In a COM world, I can pass a ProgId and do a late bound COM object instantiation with the CreateObject method. What is the technique for achieving the equivalent of this in .NET (and C#). I don't want to create COM objects, though. Rather, I want to have some .NET assemblies laying around (locally or on another machine on my network) that I can create at runtime. Any info appreciated. Thx! |
|
| How to get the id of the current unnamed thread?(NT) (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| . |
|
| Machine Cramping Bitmaps (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, no questions here, just a comment & warning for others to heed. I've been playing around with doing some programming with UserControls that mimic another program that I've seen, but think could use a lot of improvement. They use a bitmap for one of their screens, so I figured I'd just borrow the bitmap for my version and put it in a docked control. The bitmap was over 1200 KB, which is big, bu... |
|
| What are the equivalents of chr(37) en Asc('%') (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Assume this simple test program: //**************************************** using System; public class MainEntry { public static void Main() { Console.WriteLine("TEST..."); Console.WriteLine(" "); Console.WriteLine("Chr(37) {0}","???"); Console.WriteLine("Asc('%') {0}","???"); } } //************************************************ What could be written instead of "???" to become the desired result... |
|
| retrieve delegate type from a user control dll (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi Do you know how to retrieve a delegate type from a dll (build as user control) not referenced in the Win form application? I successfully retrieve the type of the class of the dll, but the delegate failed. As following Five.chat is my UserControl Type t Type.GetTypeFromProgID("Five.Chat"); succeded DelegateUC is the delegate defined in the user control. Type t2 Type.GetType(Five.Chat DelegateUC... |
|
| How to marshal between threads in same app? (6 replies) |
| microsoft.public.dotnet.languages.csharp |
| Background I'm writing a TCP/IP app that acts both as a server and as client. The server object runs in its own thread but only in a single thread. The client portion is multi threaded and can invoke as many threads as the client wants to access different servers. I thought I was doing the right thing by designing the client and server each in their own class files so I can localize the functional... |
|
| Async Operation through delegates (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi everyBody; class Worker { private int ident; public Worker(int i) { ident i; } public a foo(int x) { //do some lenghty ops return this; } } public delegate Worker del(int x) class Test { static void Main() { IAsyncResult ar Waithandle[] handles new WaitHandle[5] for(int i 0;i 5;i ) { Worker inst1 new Worker(i); del mydel new del(Worker.foo); ar d.BeginInvoke(i,null,null); handles[i] ar.AsyncWai... |
|
| CTS Data Types Question (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Say I create a class in C# that contains an "sbyte" data type. Since this type is not supported in VB.Net, would a VB.Net program be able to instantiate or inherit from this class? Randy |
|
| How to execute a shell command in C#? (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Anyone know how this is done? |
|
| .NET Security Framework vs. CryptoAPI RSA OAEP padding interop? (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| As a few posts have indicated there seems no way of doing certificate based public key cryptography with the current .NET Framework security implementation. This leaves me with a hybrid scenario where I use DllImport, define structs etc and use CryptoAPI for the stuff the framework doesn't. This has uncovered an unusual problem (bug?) If I use an RSA public key and encrypt using CryptEncrypt speci... |
|
| Serializing a class (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi everybody, I am trying to convert a class to byte array, to send over Raw sockets.I am currently using Marshal.StructureToPointer for this, but this involves dealing with the pointers. and i dont want to see any pointers in my C# code(Every C# guru I came over says that I shouldn't need pointers in C# code). Can you put forward any alternative solution for this. Does ISerializable does the tric... |
|
| Lage binding (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, How to use the late binding in c#. if any body have the idia.. pl. help me on this.. Thanks in advance.. Ravinder |
|
| Thread GUID (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi ! Is it possible to get a unique identifier of a thread ?!? I've tried with the hash code of the current thread, but it seems this codes are not unique. Am I wrong ? Thanks, Dot Net Gurueo |
|
| How toSearch in datagrid (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| A datagrid is populated with employee list. Now how can I find a row whose LAST NAME JAIN. Thanks in advance. Vinod Jain |
|
| Unsafe (2 replies) |
| microsoft.public.dotnet.languages.csharp |
| How can i call functions in a *.lib file? Many API use a .lib file and a .h file. Ex. I have a lib name: mylib.lib and a header file look like this: typedef struct Msg { char country; char market; char instrumentGroupc; char modifier; short commodity; short expirationDate; long strikePrice; }Message; int32 QueryAPI (Message *msg); How can i call function QueryAPI in library 'mylib.lib' from CSharp... |
|
| How come HasExited return true even if the process has not exited? (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| After calling Start() method to a process and that this command returns true, I try to check its HasExited property, but it returns true even tho the process is still running. Does anyone know why? Any help is appreciated. |
|
| How download file from FTP (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| hi great programators, give me please simple description how dowload file by ftp protocol from internet or intranet. thank you jenda ps: my english is very horrible, I now. Odchozí zpráva neobsahuje viry. Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz). Verze: 6.0.295 / Virová báze: 159 datum vydání: 1.11.2001 |
|