Click here to Skip to main content
15,919,245 members
Home / Discussions / C#
   

C#

 
GeneralRe: Single instance forms in an MDI app Pin
Ed.Poore9-Sep-07 9:12
Ed.Poore9-Sep-07 9:12 
GeneralRe: Single instance forms in an MDI app Pin
Ed.Poore9-Sep-07 13:39
Ed.Poore9-Sep-07 13:39 
QuestionNeed an Algorithm like 'Word Wrap' in notepad. Pin
hdv2128-Sep-07 6:54
hdv2128-Sep-07 6:54 
AnswerRe: Need an Algorithm like 'Word Wrap' in notepad. Pin
Giorgi Dalakishvili8-Sep-07 7:26
mentorGiorgi Dalakishvili8-Sep-07 7:26 
QuestionConsuming Java Web Service using C# Pin
arctix8-Sep-07 4:48
arctix8-Sep-07 4:48 
AnswerRe: Consuming Java Web Service using C# Pin
Guffa8-Sep-07 4:58
Guffa8-Sep-07 4:58 
QuestionRe: Consuming Java Web Service using C# [modified] Pin
arctix9-Sep-07 2:57
arctix9-Sep-07 2:57 
QuestionGenerics Problem Question Pin
PaulPrice8-Sep-07 4:44
PaulPrice8-Sep-07 4:44 
Good afternoon gentlemen,

I was hoping somebody could explain what is wrong with the following implementation of a simple Generic function

<br />
protected void SetValue<<T>>(T value, int length)<br />
{<br />
    byte[] data = BitConverter.GetBytes(value);<br />
    if (SrbData.Length < (length + data.Length))<br />
        throw new InvalidOperationException();<br />
    Array.Copy(data, 0, SrbData, length, data.Length);<br />
}<br />


ps, the <<t>> is because I could not work out how to get a single greater than to display and SrbData is a byte array

The Visual Studio error is

Error 1 The best overloaded method match for 'System.BitConverter.GetBytes(bool)' has some invalid arguments C:\Documents and Settings\Paul\My Documents\Visual Studio 2005\Projects\Comet\SrbLibrary\SrbHeader.cs 17 27 SrbLibrary

I do not have much experience with Generics so this is most likely a silly problem, but thanks for the help anyway

Paul
AnswerRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 4:49
mentorGiorgi Dalakishvili8-Sep-07 4:49 
GeneralRe: Generics Problem Question Pin
PaulPrice8-Sep-07 4:58
PaulPrice8-Sep-07 4:58 
GeneralRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 5:05
mentorGiorgi Dalakishvili8-Sep-07 5:05 
GeneralRe: Generics Problem Question Pin
PaulPrice8-Sep-07 5:11
PaulPrice8-Sep-07 5:11 
GeneralRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 5:18
mentorGiorgi Dalakishvili8-Sep-07 5:18 
QuestionAntivirus question Pin
sajid.salim.khan8-Sep-07 4:20
sajid.salim.khan8-Sep-07 4:20 
AnswerRe: Antivirus question Pin
Paul Conrad8-Sep-07 4:26
professionalPaul Conrad8-Sep-07 4:26 
QuestionDataGrid control WinFroms Pin
somagunasekaran8-Sep-07 4:19
somagunasekaran8-Sep-07 4:19 
AnswerRe: DataGrid control WinFroms Pin
Paul Conrad8-Sep-07 4:27
professionalPaul Conrad8-Sep-07 4:27 
QuestionRythm game Pin
pokabot8-Sep-07 3:08
pokabot8-Sep-07 3:08 
AnswerRe: Rythm game Pin
Guffa8-Sep-07 3:56
Guffa8-Sep-07 3:56 
GeneralRe: Rythm game Pin
pokabot8-Sep-07 4:35
pokabot8-Sep-07 4:35 
QuestionArray Pin
edwinlazer8-Sep-07 2:35
edwinlazer8-Sep-07 2:35 
AnswerRe: Array Pin
Guffa8-Sep-07 2:46
Guffa8-Sep-07 2:46 
GeneralRe: Array Pin
edwinlazer9-Sep-07 19:28
edwinlazer9-Sep-07 19:28 
QuestionSharepoint server URL [modified] Pin
Ramamurthi8-Sep-07 2:10
Ramamurthi8-Sep-07 2:10 
QuestionUnhandled Exception Pin
B!Z8-Sep-07 1:22
B!Z8-Sep-07 1:22 

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.