Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • Xor()

    question
    3
    0 Votes
    3 Posts
    0 Views
    M
    James T. Johnson wrote: I believe the ^ operator is what you want to use there. Yes,thats it. :) Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
  • memstream to listview icon

    question
    2
    0 Votes
    2 Posts
    0 Views
    J
    You'll have to create a new instance of the Image class from the contents of the stream. treeNode.Image = Image.FromStream(myStream); HTH, James Simplicity Rules!
  • Registry

    windows-admin question
    3
    0 Votes
    3 Posts
    0 Views
    N
    Mazdak wrote: Easy: RegistryKey. Yeah :-) Nish The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
  • Speedup app startup time

    csharp winforms performance question
    11
    0 Votes
    11 Posts
    0 Views
    J
    Kannan Kalyanaraman wrote: but I couldnt follow when you said the underlying IL has changed.. In a .NET application it is possible to change the image of the assembly at runtime. John Lam does this in his aspect weaver, and the JITter does this whenever it JITs a method [before a method is JITted the x86 has a jmp to a stub function that does the JIT, that jmp is then replaced once the method has been JITted]. Kannan Kalyanaraman wrote: Any idea on how do I do the install time JIT stuff ngen is the install-time JIT utility, so you'd just run that program during your setup. Kannan Kalyanaraman wrote: I remember long ago I read an article which said the JITing happens not once or all at a time but only when a particular portion of the code is used eg. a method call is done. The runtime JIT works this way. When a method is JITted any method calls are looked up to see if the method has already been JITted, if it has it outputs an x86 jmp instruction to that method's x86 code; if it hasn't been JITted it instead outputs a jmp instruction to a stub function, which when executed will start the JIT process. James Simplicity Rules!
  • WSDL (Web service description language)

    wcf
    2
    0 Votes
    2 Posts
    0 Views
    N
    Here is the link to the W3C page that has all the information you could want on WSDL Web Services Description Language HTH Nick Parker
  • "Default" attribute to button ?

    c++ question csharp
    3
    0 Votes
    3 Posts
    0 Views
    D
    Which, after all, is a more elegant modeling... Crivo Automated Credit Assessment
  • Amazing Question

    question csharp data-structures
    4
    0 Votes
    4 Posts
    0 Views
    N
    Mazdak wrote: Oh, Thanks Nish. It was stupid question,Wasn't it? Not at all Mazy, not at all. Nish The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
  • A bug in TreeView AfterCheck event?

    csharp visual-studio help question
    3
    0 Votes
    3 Posts
    0 Views
    L
    hi! I have get a replay for me message on an other message board with the solution for this problem. and here is the replay message: Re: A bug in TreeView AfterCheck event? Posted on: April 12 2002 12:10 Pawel, By setting e.Node.Nodes[1].Checked = true; you are firing a new event (because the checked was changed) and displaySaleContractTreeView_AfterCheck will be invoked again even before you come to the second line. I believe you are coming into an infinite loop here. Anyhow, try to disable the AfterCheck event and enable it again at the end of your handler like this: private void displaySaleContractTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e) { displaySaleContractTreeView.AfterCheck -= new System.Windows.Forms.AfterCheckEventHandler(this.displaySaleContractTreeView_AfterCheck); e.Node.Nodes[1].Checked = true; //.. //... do your stuff here // .. displaySaleContractTreeView.AfterCheck += new System.Windows.Forms.AfterCheckEventHandler(this.displaySaleContractTreeView_AfterCheck); } Hope this works, Viel Spass, Minh. ---------------------------------------------------- wow!! thx!! for every bug has enderminh a solution!! IT´s WORK!!!!!!!!!!!!!!! ;) but some events that you used doesn´t exist. this is the 100% correct code: private void displaySaleContractTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e) { displaySaleContractTreeView.AfterCheck -= new System.Windows.Forms.TreeViewEventHandler(this.displaySaleContractTreeView_AfterCheck); e.Node.Nodes[1].Checked = true; e.Node.Nodes[2].Checked = true; e.Node.Nodes[2].Nodes[0].Checked = true; e.Node.Nodes[2].Nodes[1].Checked = true; e.Node.Nodes[2].Nodes[2].Checked = true; e.Node.Nodes[2].Nodes[3].Checked = true; e.Node.Nodes[2].Nodes[4].Checked = true; e.Node.Nodes[2].Nodes[5].Checked = true; e.Node.Nodes[2].Nodes[6].Checked = true; e.Node.Nodes[2].Nodes[7].Checked = true; e.Node.Nodes[3].Checked = true; displaySaleContractTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.displaySaleContractTreeView_AfterCheck); } thx again!! DANKE!! ;) Pawel ------------------------------------------- Pawel, No, it's not a bug. It supposed to happen. You have said that "ey, if anyone changes this checkbox, please let me know and run this method". But since you are changing the checkbox inside this own method, it will recursively call this method
  • Enumerating computer names in local network

    csharp sysadmin help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • C# wrapper for the WinPcap Library

    csharp sysadmin json question announcement
    8
    0 Votes
    8 Posts
    0 Views
    N
    I am confident that the attributed string as I presented, is the right choice. The StringBuilder reference is the size of a pointer, in contrast to the TCHAR array being n TCHAR(s) in length (+ alignment padding if necessary), directly affecting the size of the overall structure and the offsets of its members. Regards
  • some problem about Font

    help question csharp dotnet graphics
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • DataGrid

    question database
    8
    0 Votes
    8 Posts
    0 Views
    M
    DataSet work in disconnected mode,I wanna use connected mode.:) Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
  • C# and Imaging

    csharp java question announcement
    3
    0 Votes
    3 Posts
    0 Views
    N
    Charles Petzold's book on C# is full of information on this topic. Nick Parker
  • Displaying HTML

    html question
    3
    0 Votes
    3 Posts
    0 Views
    T
    Alternatively you can use the DHTML ActiveX control (DHTMLED.ocx) to use it, simply find the file (or download the latest copy from Microsoft), then add it to your toolbox and add it to your form as a normal control. The control as lots of methods that you can use to get HTML in to it, e.g. you can directly load a url: axDHTMLEdit1.LoadURL("http://www.codeproject.com"); or you can access the DOM to add HTML programatically: axDHTMLEdit1.DOM.body.innerHTML = "The Code Project"; I suggest you download the DHTMLEd SDK from Microsoft which includes documentation for all the properties and methods. This is a very powerful control but may be a bit of overkill for what you're doing.
  • Reading From a text file

    question tutorial workspace
    4
    0 Votes
    4 Posts
    0 Views
    G
    I tried using the TextReader but it didn't have the seek option and I couldn't find anything else which was helpful. I need to pick up 3 different things from this file, but I can't figure out how to read through the file and select a certain thing? Or is there a better way to do this other than using a static file. I just need to store some small strings. Thanks
  • How to make a combobox uneditable?

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    J
    How do you want it uneditable? So you can't change the text that is picked from the list? myComboBox.DropDownStyle = ComboBoxStyle.DropDownList; does that If you want to make it so that you can't even change which value is selected then set the Enabled property to false. HTH, James Simplicity Rules!
  • Damned Clipboard keeps changing format

    csharp adobe graphics question
    3
    0 Votes
    3 Posts
    0 Views
    N
    Yeah, this really sucks!!! Nish_ One little CD gone, Then two CDs gone, Then 5 more gone, For a total 7 gones, If I was a CD R, I'd wanna cry, Cause I'd be just a goner, For a nasty CD burner. [funny how frustration wakes up the poet in me]_
  • Using COM Objects (new interfaces)

    com tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    J
    In case you don't get any answers here, the DOTNET mailing list has fielded a TON of questions on COM interop; something I haven't had to do which is why I can't answer your question. Sorry I don't have a straight-up answer, James Simplicity Rules!
  • Converting C structures to C# equivalents...

    csharp json question
    2
    0 Votes
    2 Posts
    0 Views
    J
    Dominique wrote:_ public struct ISC_TIMESTAMP { long TIMESTAMP_DATE; ulong TIMESTAMP_TIME; }; Is this correct or should I be using another more C# style like.. [StructLayout(LayoutKind.Sequential)] public class ISC_TIMESTAMP { // rest of code goes here } You need to use a combination of the two, keep it a struct but apply the StructLayout attribute its your only guarantee that the data will stay in that order; otherwise the compiler could move fields around to better align the data. Dominique wrote: struct blobcallback { short (ISC_FAR *blob_get_segment) (void ISC_FAR* hnd, unsigned char* buffer, ISC_USHORT buf_size, ISC_USHORT* result_len); void ISC_FAR *blob_handle; ISC_LONG blob_number_segments; ISC_LONG blob_max_segment; ISC_LONG blob_total_length; void (ISC_FAR *blob_put_segment) (void ISC_FAR* hnd, unsigned char* buffer, ISC_USHORT buf_size); ISC_LONG (ISC_FAR *blob_lseek) (void ISC_FAR* hnd, ISC_USHORT mode, ISC_LONG offset); } _Call backs are done with delegates, there is an article somewhere on CP that shows how to use a callback for the EnumWindows function, i think it was how to programmatcally control IE. void is usually a object When you have a character buffer pass in a StringBuilder object A ** (pointer to a pointer) usually uses the 'out' keyword followed by its type, a pointer is usually a reference ('ref'). HTH, James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • Get remote object and respond to an event

    sysadmin help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied