Answer Questions
Frank722 Overloaded constructors
Can someone please explain why this doesn't work using System; public class MyClass { public MyClass () { MyClass ( 0 , string .Empty); //error here } public MyClass ( int i) { MyClass (i, string .Empty); //error here } public MyClass ( int i, string b) //full constructor { } public static void Main() { MyClass c = new MyClass ( 0 ); } The error is: 'MyClass' denotes a 'class' which is not valid in the given context I mean this error highlited on every line where I call my full constructor. P.S. I know how to make it work but the question ...Show All
T.Vargek Invalid Resx file. A strongly-named assembly is required.
I've been randomly getting this error on a few of my forms in one of my projects for about a week now. Its always the same forms each time and its always in the same place (its the closing tag of a <data> element with the same base-64 encoded resource each time). It seems arbitrary whether or not I get this and usually restarting visual studio will get rid of it, but sometimes i have to restart it several time. The really weird thing is that no one else on my team has gotten this and we're all working off of the same codebase. I've tried blowing away my local copy of the source and getting a completely fresh copy form source control and that seems to help it for a bit, but it always comes back. Has anyone ever seen this or anyone ha ...Show All
turkeytickler Downloading PDF will not open, must save
Hi, Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + oFile.Name); Response.AddHeader("Content-Length", oFile.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(oFile.FullName); Response.End(); The problem here is when a pdf is to be downloaded, it will not open directly in the browser. You must save the file first and then you get a new dialog asking you if you want to open the file. Other file types work correctly, only PDF's are causing me grief. I noticed when downloading a word doc, the Open dialog option was not displayed. Is there anyway to force the display of only Save or Cancel. This problem w ...Show All
priyananda Who know the best way to make an UNDO step for graphical application
Hello I developed a class related to graphic application . One of the class of this application is a drawing surface that has a collection of drawing object. Now I would like to extend the capability of this class to be able to undo and redo each step in such maner that I could set an undo level ( number of step that can be undone and redone in a stack style) . I come up with a class that inherit from collection base class, this work fine with a simple undo and redo step especially for adding and deleting the object . But with moving, rotating , sizing it doesn't work properly. The procedure that I did is, record the object (copy) with all properties just before it has been changed and add it /them to the collection class which I nam ...Show All
John123 Need advise in programming C#.
Hi, I am wondering if anyone can help me or point me to the right direction. Currently, I can program applications in C#. What I am lacking is the know how to setup a proper application structure. Right now when I create a project/application, everything goes in one *.CS file (with form) which works but not professional looking when you peek behind the scenes. I need advise on properly setting up a project so I can, maybe, create other *.CS file to move out procedures/functions, database related stuff, etc. Any books that can help me Can anyone help. Thanks, Rick.. You can divide your application into different layers as per your need. You can use Microsoft Enterprise Library/Application Blo ...Show All
gill Total newbie question regarding dll locations
Hi I am a total newbie to c#. I am in the process of moving a project from 2003 to 2005. I just want to know where I have to put the custom dlls that this application uses. In 2003 it should be \Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\ where should I stick my dlls in 2005 thanks in advance GuusDavidson Hi Just add refrence(s) to the DLL(s) and right click on the Dll in Refrences and select property and set True to the Copy Local property it will copy the DLL(s) to the right place for you. ...Show All
Handi How to avoid page call back in ASP .NET 1.0
Hi i am having a problem when using ASP .NET 1.0 I have 2 dropdownlist. The second one depend on the first one. For example: The first one have the alphabet list. When i choose A the the secong dropdownlist will show all the artist with the name begin with A. With ASP.net 1.0 the page will be load again. In ASP.net 2.0 we don't have this problem. I have found some solution like: using java script to load all the data and fill this again when the dropdownlist 1 is selected. However, i have to load so much data to client side. I am trying to avoid that problem. can you please tell me how to implement a solution to avoid that problem in ASP.net 1.0 If you have some example code that will be very helful! Thanks a l ...Show All
Thomas Olsson Cloning
VS2005 Can anyone show me- if its possible- how to clone a combo box . I have 6 combo boxes on a windows form all contain the same information. After the first only I only want to load the data when the cbo is selected. If you cannot clone a combo box where and how would I check that the cbo is empty OK, well, just check to see the number of items items in comboboxB. If number of items == 0 then populate //SelectIndexChanged Event if (this.comboBoxB.Items.Count == 0) { //populate data/copy/whatever } does this help Thanks that helped but it didnt work when in the selectedindexchanged event I works when in the dropdown event. ...Show All
Jarodtweiss Urgent help
i have created a windows form as main form. I also created another form as close confirmation dialog. So when i click on the close button which locates on the top right corner of my main form, it should display the close confirmation dialog. And there are two buttons on the confirmation dialog, "yes" and "no". Then click "yes", exit the whole application, or click"no", only close the confirmation dialog and focus back to the main form. However, when i click "no", it close (or may just hide) both of the forms, but not exit the whole application, which means the application is still running, but i couldn't see it. why's that I also created a menuitem called "exit", when click o ...Show All
wagnerjp how to call functions in unmanaged C++ dll from C# app
Hi everyone, I would really appreciate some help if anyone knows the answer. I've been reading online about this topic for the past 2 days, and so far can't find an exact example to help me. I have an unmanaged C++ dll that is comprised of several C++ classes. I need to be able to access some of the functions/procedures in this dll from my C# application. I have tried using the [DllImport("MITT.dll")] public static extern void Start(); method, but this results in an EntryPointNotFoundException due to the name decorating/mangling that occurs on the C++ procedure names. I then used the dumpbin.exe to find the decorated name, and used it in the DllImport EntryPoint attribute, and this worked, but I don't want to use that solution j ...Show All
ellen_89 new Modifier behaviour in interfaces
Example: public interface B { string Name { get ; } } internal interface AB : B { // new - hides a member inherited from a base class (!) new string Name { get ; set ; } } internal class MyClass : AB { public string _name; // implementation of the AB.Name property public string Name { get { return _name; } set { _name = value ; } } } then: AB ab = new MyClass (); ab.Name = "!" ; ... B b = (B) ab; Debug.Assert (b.Name == "!" ); //true! Why when I call method get_Name () form interface B - the AB.get_Name () is called I don't get it because in AB interface Name property is declared with ...Show All
ChristianBG Create my own mp3 stream
Is it possible to create your own mp3 so you could theoretically create your own internet radio station Try this: http://www.codeproject.com/cs/media/SHOUTcastRipper.asp http://www.un4seen.com/ Check out the forum and the Net wrapper. Does exactly what you want. Madok wrote: Is it possible to create your own mp3 so you could theoretically create your own internet radio station So your first problem: how to make an mp3 How do you get the 'source sound' Once you have that it's only a matter of sending that source stream to an mp3 encoder... The second problem is simply a matter of starting a TcpListener, accept incoming connections, and write the mp3 encoded stream in ...Show All
Richardthomas1960 The RPC Server Is Unavailable
when i am trying to execute this code i got RPC SErver unavailable excetion HREULT:0x800706BA can anyone who help me.... public void ConnectLocalComputer() { m_WorkingNamespace = new ManagementScope (); m_WorkingNamespace.Path = new ManagementPath ( @"\\.\root\cimv2" ); try { m_WorkingNamespace.Connect(); } catch ( COMException comException) { this .m_WorkingNamespace = null ; throw new ArgumentException ( "Server does not exists or access denied. \nConfigure firewall options." , comException); } catch ( UnauthorizedAccessException authException) { this .m_WorkingNamespace = null ; throw new ArgumentException ( "Access de ...Show All
ShadowRayz Allow only one instance of an application
Is there a way to only allow one instance of an application to run The current application is rather large and it takes a moment for the splash page to show. I would like to ignore all attempts to open the application while its loading so that only one instance can be running at a time. excellent, glad I could help. Actually edited the post an hour later to make it better, no idea what I was thinking of in the first post but glad that its working for you - the "new and improved" approach at least Worked like a champ! Thanks. you can get the list of processes which are of the same processname perhaps, if there is more than 1 (1 being current proces ...Show All
Dominik Mauchle How to write typedef structs and unions in C#
I have this code from a C++ project I want to migrate to C#. How would I write this in C# typedef struct _hdr_struct { char fileType[ 4]; union { char fileVersion[ 4]; struct { char v; char major; char dot; char minor; } version; }; } HDRSTRUCT, *LPHDRSTRUCT; // Then later char buffer[ 1024]; // code to fill the buffer LPHDRSTRUCT lpHS = (LPHDRSTRUCT) &buffer; char major = lpHS->version.major; class HD { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string fileType; [MarshalAs(Unma ...Show All
