Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGridViewCell Pin
Chetan Patel27-Jul-07 1:07
Chetan Patel27-Jul-07 1:07 
QuestionHow to prioritize the UI thread as a process (.exe) eats up the resources Pin
Rafferty Uy27-Jul-07 0:26
Rafferty Uy27-Jul-07 0:26 
AnswerRe: How to prioritize the UI thread as a process (.exe) eats up the resources Pin
Martin#27-Jul-07 0:36
Martin#27-Jul-07 0:36 
AnswerRe: How to prioritize the UI thread as a process (.exe) eats up the resources Pin
Mike Dimmick27-Jul-07 2:22
Mike Dimmick27-Jul-07 2:22 
QuestionHow to convert Struct to array Pin
kobi10i1027-Jul-07 0:13
kobi10i1027-Jul-07 0:13 
AnswerRe: How to convert Struct to array Pin
Christian Graus27-Jul-07 0:28
protectorChristian Graus27-Jul-07 0:28 
AnswerRe: How to convert Struct to array Pin
Guffa27-Jul-07 2:36
Guffa27-Jul-07 2:36 
AnswerRe: How to convert Struct to array Pin
leppie27-Jul-07 3:16
leppie27-Jul-07 3:16 
<FONT color=Blue>using</FONT> System<FONT color=DarkBlue>;</FONT>
<FONT color=Blue>using</FONT> System<FONT color=DarkBlue>.</FONT>Runtime<FONT color=DarkBlue>.</FONT>InteropServices<FONT color=DarkBlue>;</FONT>

<FONT color=Blue>namespace</FONT> ConsoleApplication9
<FONT color=DarkBlue>{</FONT>
  <FONT color=Blue>class</FONT> <FONT color=Teal>Program</FONT>
  <FONT color=DarkBlue>{</FONT>
    <FONT color=DarkGreen>// make pack size of smallest element</FONT>
    <FONT color=DarkBlue>[</FONT><FONT color=Teal>StructLayout</FONT><FONT color=DarkBlue>(</FONT><FONT color=Teal>LayoutKind</FONT><FONT color=DarkBlue>.</FONT>Sequential<FONT color=DarkBlue>,</FONT> Pack<FONT color=DarkBlue>=</FONT><FONT color=Red>1</FONT><FONT color=DarkBlue>)</FONT><FONT color=DarkBlue>]</FONT>
    <FONT color=Blue>public</FONT> <FONT color=Blue>struct</FONT> <FONT color=Teal>Message</FONT>
    <FONT color=DarkBlue>{</FONT>
      <FONT color=Blue>public</FONT> <FONT color=Blue>byte</FONT> id<FONT color=DarkBlue>;</FONT>
      <FONT color=Blue>public</FONT> <FONT color=Blue>int</FONT> value1<FONT color=DarkBlue>;</FONT>
      <FONT color=Blue>public</FONT> <FONT color=Blue>int</FONT> value2<FONT color=DarkBlue>;</FONT>
      <FONT color=Blue>public</FONT> <FONT color=Blue>byte</FONT> chkSum<FONT color=DarkBlue>;</FONT>
    <FONT color=DarkBlue>}</FONT>

    <FONT color=Blue>static</FONT> <FONT color=Blue>unsafe</FONT> <FONT color=Blue>void</FONT> Main<FONT color=DarkBlue>(</FONT><FONT color=Blue>string</FONT><FONT color=DarkBlue>[]</FONT> args<FONT color=DarkBlue>)</FONT>
    <FONT color=DarkBlue>{</FONT>
      <FONT color=Teal>Message</FONT> m <FONT color=DarkBlue>=</FONT> <FONT color=Blue>new</FONT> <FONT color=Teal>Message</FONT><FONT color=DarkBlue>(</FONT><FONT color=DarkBlue>)</FONT><FONT color=DarkBlue>;</FONT>

      <FONT color=Blue>int</FONT> size <FONT color=DarkBlue>=</FONT> <FONT color=Blue>sizeof</FONT><FONT color=DarkBlue>(</FONT><FONT color=Teal>Message</FONT><FONT color=DarkBlue>)</FONT><FONT color=DarkBlue>;</FONT>

      <FONT color=Blue>byte</FONT><FONT color=DarkBlue>[]</FONT> output <FONT color=DarkBlue>=</FONT> <FONT color=Blue>new</FONT> <FONT color=Blue>byte</FONT><FONT color=DarkBlue>[</FONT>size<FONT color=DarkBlue>]</FONT><FONT color=DarkBlue>;</FONT>

      <FONT color=Blue>byte</FONT><FONT color=DarkBlue>*</FONT> p <FONT color=DarkBlue>=</FONT> <FONT color=DarkBlue>(</FONT><FONT color=Blue>byte</FONT><FONT color=DarkBlue>*</FONT><FONT color=DarkBlue>)</FONT><FONT color=DarkBlue>&</FONT>m<FONT color=DarkBlue>;</FONT>
      <FONT color=Blue>for</FONT> <FONT color=DarkBlue>(</FONT><FONT color=Blue>int</FONT> i <FONT color=DarkBlue>=</FONT> <FONT color=Red>0</FONT><FONT color=DarkBlue>;</FONT> i <FONT color=DarkBlue><</FONT> size<FONT color=DarkBlue>;</FONT> i<FONT color=DarkBlue>++</FONT><FONT color=DarkBlue>)</FONT>
      <FONT color=DarkBlue>{</FONT>
        output<FONT color=DarkBlue>[</FONT>i<FONT color=DarkBlue>]</FONT> <FONT color=DarkBlue>=</FONT> p<FONT color=DarkBlue>[</FONT>i<FONT color=DarkBlue>]</FONT><FONT color=DarkBlue>;</FONT>
      <FONT color=DarkBlue>}</FONT>

      <FONT color=Teal>Console</FONT><FONT color=DarkBlue>.</FONT>ReadLine<FONT color=DarkBlue>(</FONT><FONT color=DarkBlue>)</FONT><FONT color=DarkBlue>;</FONT>
    <FONT color=DarkBlue>}</FONT>
  <FONT color=DarkBlue>}</FONT>
<FONT color=DarkBlue>}</FONT>



AnswerRe: How to convert Struct to array Pin
CiNN27-Jul-07 5:39
CiNN27-Jul-07 5:39 
QuestionHow to give attechment with mailto in c# Pin
Dhaval Bhattji26-Jul-07 23:58
Dhaval Bhattji26-Jul-07 23:58 
AnswerRe: How to give attechment with mailto in c# Pin
Christian Graus27-Jul-07 0:30
protectorChristian Graus27-Jul-07 0:30 
QuestionProblem in Deployment of Excel Data Reading WebPart developed in C# Pin
khan SharePoint Developer26-Jul-07 23:45
khan SharePoint Developer26-Jul-07 23:45 
QuestionDiscover a Device in C# Pin
Amjath Rahman26-Jul-07 23:43
Amjath Rahman26-Jul-07 23:43 
AnswerRe: Discover a Device in C# Pin
Martin#26-Jul-07 23:54
Martin#26-Jul-07 23:54 
GeneralRe: Discover a Device in C# Pin
Amjath Rahman29-Jul-07 14:51
Amjath Rahman29-Jul-07 14:51 
Questionprinting a complete datagrid having paging and sorting Pin
samparadise26-Jul-07 23:36
samparadise26-Jul-07 23:36 
Questiondatagrid save Pin
csharpgal26-Jul-07 23:16
csharpgal26-Jul-07 23:16 
AnswerRe: datagrid save Pin
Christian Graus27-Jul-07 0:26
protectorChristian Graus27-Jul-07 0:26 
QuestionRe: datagrid save Pin
csharpgal27-Jul-07 1:41
csharpgal27-Jul-07 1:41 
QuestionControl inside listbox C# .Net Pin
drweb8626-Jul-07 22:53
drweb8626-Jul-07 22:53 
AnswerRe: Control inside listbox C# .Net Pin
Christian Graus26-Jul-07 23:08
protectorChristian Graus26-Jul-07 23:08 
GeneralRe: Control inside listbox C# .Net Pin
drweb8626-Jul-07 23:32
drweb8626-Jul-07 23:32 
GeneralRe: Control inside listbox C# .Net Pin
Christian Graus26-Jul-07 23:36
protectorChristian Graus26-Jul-07 23:36 
GeneralRe: Control inside listbox C# .Net Pin
drweb8626-Jul-07 23:45
drweb8626-Jul-07 23:45 
QuestionShowing an icon in a gridview (WPF) Pin
Johan Lombaard26-Jul-07 22:51
Johan Lombaard26-Jul-07 22:51 

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.