Answer Questions
Astericks How Can I get Keyboard Layout?
Hi I wanna ask about "How Can I get Keyboard Layout ", It may be easy quesion but I stuck on it. 3doorsdown Hi I mean current language of the keyboard, I just wanna know what the language the user write now. 3doorsdown What do you mean by keyboard layout Do you want to know what language/locale the keyboard driver is currently using Or, are you looking to convert scan codes ...Show All
thukralz Interfaces and Contravariance Q. - No Delegates
Hi I was wondering if there was any way to make something like this work: public interface IDataContainer { ... } public class RealDataContainer : IDataContainer { ... } public interface IDataProcessor { ... void Process(IDataContainer cont); } public class RealDataProcessor : IDataProcessor { ... void process(RealDataContainer cont) { ... } } I know that its possible with delegates and generics, I wanted to know if this was possible using some other tricks. VS2005 doesnt seem to like it. Any help would be greatly appreciated. Thanks. AM Like I said, I always have trouble remembering which is which out of covariance and contravariance. :) So I went ...Show All
Tarey Wolf enumerate the list of services associated with a Process in C#
hi everyone i'm looking for a way to display the service(s) associated with a process (eg, services associated with svchost.exe). Searching the net i found that "QueryServiceStatusEx" is the way to go, i looked in MSDN but because i have very little Win32 API experience i got lost in their example and im struggling implementing it in my C# project. can anyone please give me a head start a code example would be great. Thank you Read up on P/Invoke ...Show All
Siebe Tolsma Remoting
How can I call an executable (exe) on a remote machine, residing in the remote machine, from my local machine in the same domain Do you want to run the application on the remote machine or from the remote machine. So From PC1 Start application on PC2. PC2 gets the user interface if there was one ...Show All
Senkwe Chanda printing a form
i'm having serious trouble doing a simple task of printing a form, as i understood this should be enough: if (MyPrintDialog.ShowDialog() == DialogResult .OK) { this .MyPrintDocument.Print(); } but... nothing! i get blank pages from some reason. anyone seen this phenomenon before Hi, Could you pls give some detail info about MyPrintDialog and MyPrintDocument Otherwise, here is the sample code about how to use PrintDialog and PrintDocument : Create a PrintDialog instance: System.Windows.Forms.PrintDialog PrintDialog1=new PrintDialog (); Create a PrintDocument instance: System.Drawing.Printing.PrintDocument docToPrint = n ...Show All
SaraD How to update DB from dataGridView using OdbcCommandBuilder ?
The full text of my program is below. Form has 2 buttons and a data grid. Button 1 fills a dataset with rows from either a local Dbase table or rows from a SQL server table - depending on which connection string you choose to use. The rows show up in the data grid and I am able to edit the data within the grid. Button 2 attempts to update whatever changes have been made to the in memory dataset back to the physical database. After making changes within the data grid, clicking button 2 yields the following error: "The ConnectionString property has not been initialized." No matter if I am getting data from the local Dbase table or from the remote T-SQL server table, I get the same error. I'm stumped. Am I out of scope on s ...Show All
Rattlerr Splitting A File's Path
I am loading a bunch of file paths from one file. Here is an example. Original string is "Projects\\Shine\\bin\\debug". What I want is "Projects", "Shine", "bin", and "debug" all in separate strings. Hi Wasting <g>, If you feel the issue is resolved to your liking...mark the post(s) that helped you as the answer(s), so when others search the forums, they might be more inclined to look at a successful post than a non successful one and determine which post(s) are the most helpful. Also in the search results the Answered posts are bubbled to the top before the unanswered . Or post if you need more help! Thanks Mark Dawson wrote: Hi, y ...Show All
AdeptBlue abstract properties : get; vs. set; vs. get; set;
I would like to define an abstract property where the deriver is forced to implement the get acessor for that property but is free to implement the set acessor. It seems that C# 2.0 has no way of declaring this. Either the deriver has to implement both acessors (get; set;), or the deriver is not allowed to implement the acessor that was not declared in the abstract base class. I am suprised that acessors abstractness can not be controlled separately since the ultimately end up as methods anyway. Why is that so James Curran wrote: True, but you missed a key point made by the OP: Instances of these derived Types will be displayed in a Windows Forms Propertygrid where the user ma ...Show All
David Noy problem with SortedList
Good Afternoon- I'm having a problem using a SortedList to store objects. Here's the example code: public override SortedList derivitives() { SortedList s = new SortedList(); s.Add(xyz,dxdydz); s.Add(uvw,dudvdw); return s; } The code fails during the second Add, with the following error: Unhandles Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. in System.Collections.SortedList:PutImpl in System.Collections.SortedList.Add in System.Collections.MyClass.derivitives() ... I tried an example code with SortedList and I can Add() as many strings as I want, is there a problem with SortedList holding abstract objects they are all of the same type... thanks, Philski ...Show All
JunoJun does managed code take precedence over native code?
i wrote a small demo C app that sends a message and a struct to a managed C++ dll. this C++ dll marshalls over the message and struct to a managed struct and sends it to a C# assembly that just prints out the values of the struct (to see that everything came over ok) and sends back a string reply, it also prints some debug text to console. before the call to the C++ dll, i make a few calls to printf to print to console. when it runs, it does the C# assembly debug statements before the native C printf statements. other than that everything looks ok. does managed code take any sort of precedence over native code the whole thing is a proof of concept. so the quick and dirty: ok so i have a C# assembly, i ...Show All
streetlightman is it possible get something from previous page??
I have a complex quesion about pass argument from page to another page I've a webpage which is forum's list when I run it on IE . which address is display like → 【 http://localhost/news/news_c.aspx cid=26&FK=1 】 and now I have to write a page (use C#) for forum's content I would like to catch "cid" from address of previous page is it possible if yes. how can I do it can somebody give me a tip to start it ( which class should I use which namespace should I import ) thanks ... ( if I don't make my question clearly ... please let me know I will explain it.. many thanks) Response.Redirect("news_c.aspx cid="+data come from here+"&FK="+data co ...Show All
GrayMatter Software windows service running on particular time and debug.write() where it prints ?
Dear All, I have windows service done with C# and able to be install using the installutil.exe. My problem now is that I want to set it like to run on particular time of day for instance 10.00 am daily How can I set this I have tried to use timer but it sets an interval only Another thing is that I have debug.write() in my windows service where can i check the output of the debug.write Where is the file Thanks. Dear Galin, I got your idea. The problem now I need to confirm with you is that am i writing my action codes in the write place or not When I create a new windows service program with VS2005 I get only 2 function OnStart and OnStop. So I am putting my code in the OnStart. So ...Show All
Jurgen Willis Threading, Delegates and a Problem
I'm doing a console for a tiny server application, that's why i'm trying to access a textbox in the main form from somewhere else, and therefore from another thread. This is a fragment of the code corresponding with the console's class that uses the textbox in the main form (which is received by parameter in the constructor): class SRM_Console { public System.Windows.Forms. TextBox SRM_Console_Textbox; delegate void SRM_Console_Delegate (System.Windows.Forms. TextBox ConsoleTextbox); delegate void SRM_Console_Out_Delegate ( string mensaje); public SRM_Console(System.Windows.Forms. TextBox ConsoleTextbox) { if (SRM_Console_Textbox.InvokeRequired == false ) { SRM_Console_Textbox = ...Show All
Bill Baker Uploading With Webservices!
Hi, I have a web serivce to upload file. What will be the best way to upload file using web service . Convert file into Base64string and the pass it to web service or some thing else... Any help will be appreciated... Thanks! Rick van den Bosch wrote: You state you have a webservice to upload a file. I take it the webservice has a description as to how you should upload a file using that webservice. If you want to develop a webservice to upload a file, that's another story. In that case, I would think a byte array is the way to go. Take a look at this article , there's a sample webservice for an (image) upload webservice. Edit: I knew I took too long ... Hi, What could be the Maximum size of file that c ...Show All
Azriel Cross New bug added in VS 2005 SP1? "Unreachable code detected" warning.
Has anyone else experienced this The following code now generates a warning saying "Unreachable code detected". This is new since applying VS 2005 SP1. The warning is given on the throw statement below. public DateTime CurrentTime { set { if (value == null) { throw new ArgumentNullException(); // Error here. } currentTime = value; } } It implies that the value passed in to the setter could never be null which is obviously not true. I just started getting this warning after upgrading with SP1. DateTime type is a value type and obviously cannot be null ! Thanks! I always forget that. I split my time between Java and C# and a ...Show All
