Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid and threading Pin
quilkin12-Apr-04 21:04
quilkin12-Apr-04 21:04 
GeneralRe: DataGrid and threading Pin
viettrai13-Apr-04 10:58
viettrai13-Apr-04 10:58 
GeneralNT Service Monitor Pin
Makover12-Apr-04 9:33
Makover12-Apr-04 9:33 
GeneralRe: NT Service Monitor Pin
Heath Stewart12-Apr-04 10:11
protectorHeath Stewart12-Apr-04 10:11 
GeneralRe: NT Service Monitor Pin
Makover12-Apr-04 10:48
Makover12-Apr-04 10:48 
GeneralRe: NT Service Monitor Pin
Heath Stewart12-Apr-04 10:51
protectorHeath Stewart12-Apr-04 10:51 
GeneralRe: NT Service Monitor Pin
Makover12-Apr-04 11:48
Makover12-Apr-04 11:48 
QuestionHave you ever used Buffer and/or BitConverter? Pin
Nathan Ridley12-Apr-04 9:18
Nathan Ridley12-Apr-04 9:18 
The last line of code below crashes my program. I am stumped as to why it's happening.
I've double and triple checked the definitions for the BlockCopy and GetBytes functions and I still can't work out what I'm doing wrong. Any insight would be appreciated.

namespace ConsoleApplication1
{
  class Class1
  {
    [STAThread]
    static void Main(string[] args)
    {
      int int1 = 3;
      int int2 = 1000;
      byte[] b = new byte[16];
      Buffer.BlockCopy(BitConverter.GetBytes(int1), 0, b, 0, 8);
      //the following line crashes the program
      Buffer.BlockCopy(BitConverter.GetBytes(int2), 0, b, 12, 4);
    }
  }
}


NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
AnswerRe: Have you ever used Buffer and/or BitConverter? Pin
Nick Parker12-Apr-04 9:38
protectorNick Parker12-Apr-04 9:38 
AnswerRe: Have you ever used Buffer and/or BitConverter? Pin
Jeff Varszegi12-Apr-04 9:49
professionalJeff Varszegi12-Apr-04 9:49 
QuestionOpen source/free asp.net datagrid component? Pin
yetanotherchris12-Apr-04 8:32
yetanotherchris12-Apr-04 8:32 
AnswerRe: Open source/free asp.net datagrid component? Pin
Heath Stewart12-Apr-04 8:39
protectorHeath Stewart12-Apr-04 8:39 
GeneralRe: Open source/free asp.net datagrid component? Pin
yetanotherchris12-Apr-04 9:08
yetanotherchris12-Apr-04 9:08 
GeneralRe: Open source/free asp.net datagrid component? Pin
Heath Stewart12-Apr-04 10:06
protectorHeath Stewart12-Apr-04 10:06 
GeneralStopping all threads when program exits Pin
Flack12-Apr-04 8:00
Flack12-Apr-04 8:00 
GeneralRe: Stopping all threads when program exits Pin
Stefan Troschuetz12-Apr-04 8:16
Stefan Troschuetz12-Apr-04 8:16 
GeneralRe: Stopping all threads when program exits Pin
Heath Stewart12-Apr-04 8:35
protectorHeath Stewart12-Apr-04 8:35 
GeneralRe: Stopping all threads when program exits Pin
Jeff Varszegi12-Apr-04 9:13
professionalJeff Varszegi12-Apr-04 9:13 
GeneralCode-Portability Pin
Stefan Troschuetz12-Apr-04 7:48
Stefan Troschuetz12-Apr-04 7:48 
GeneralRe: Code-Portability Pin
Heath Stewart12-Apr-04 8:31
protectorHeath Stewart12-Apr-04 8:31 
GeneralRe: Code-Portability Pin
Stefan Troschuetz12-Apr-04 10:38
Stefan Troschuetz12-Apr-04 10:38 
GeneralRe: Code-Portability Pin
Heath Stewart12-Apr-04 10:53
protectorHeath Stewart12-Apr-04 10:53 
GeneralReverse engineer Pin
Anonymous12-Apr-04 7:17
Anonymous12-Apr-04 7:17 
GeneralRe: Reverse engineer Pin
Heath Stewart12-Apr-04 8:27
protectorHeath Stewart12-Apr-04 8:27 
GeneralRe: Reverse engineer Pin
Anonymous12-Apr-04 8:40
Anonymous12-Apr-04 8:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.