Click here to Skip to main content
14,659,214 members
Home » Discussions » C#
   

C#

 
GeneralRe: threading and timercallback Pin
Luc Pattyn9-Jun-09 6:32
sitebuilderLuc Pattyn9-Jun-09 6:32 
Questionis dataset performs well over Lists when navigating data in the memory Pin
prasadbuddhika8-Jun-09 5:30
Memberprasadbuddhika8-Jun-09 5:30 
AnswerRe: is dataset performs well over Lists when navigating data in the memory Pin
Henry Minute8-Jun-09 9:56
MemberHenry Minute8-Jun-09 9:56 
QuestionWeb Cam Problem Pin
S K Y8-Jun-09 5:23
MemberS K Y8-Jun-09 5:23 
AnswerRe: Web Cam Problem Pin
DaveyM698-Jun-09 5:31
professionalDaveyM698-Jun-09 5:31 
AnswerRe: Web Cam Problem Pin
Simon P Stevens8-Jun-09 5:38
MemberSimon P Stevens8-Jun-09 5:38 
QuestionHow to embed a internet explorer in a webbrowser control using c# Pin
Yukivi8-Jun-09 5:08
MemberYukivi8-Jun-09 5:08 
QuestionCast where XML file defines what integer and floating point values should be cast to. Pin
Dennis Lerche8-Jun-09 4:10
MemberDennis Lerche8-Jun-09 4:10 
Hi

I'm having a problem solving this problem.
I have an XML file describing how the different types (double, float, int and so on) should be interprettet, or how many bits the size of them should be. My application reads the XML and then have to cast for example a double to a float or an int to a short, based on the configuration. Afterward, the new casted or converted value has to converted to a byte array of the size of the type defined in the XML file.

I will just give an example to clarify.

1. Double value received.
2. Convert double value based on the conversion size in XML, double is cast / converted to float.
3. Create byte array from casted / converted value.

I can convert the value without problems using Convert.ChangeType(doubleValue,Type.GetType("System.Single")), but this give an object that I do not know how to make to a byte array of the correct size (32 bits).

Can anyone help me with solving the problem with converting / casting a double to a specific type defined in a XML file and converting this to a byte array ?
What I'm interrested in is the byte array being the size defined in the XML with signed values.

Thanks alot Smile | :)

Dennis
AnswerRe: Cast where XML file defines what integer and floating point values should be cast to. Pin
led mike8-Jun-09 5:08
Memberled mike8-Jun-09 5:08 
GeneralRe: Cast where XML file defines what integer and floating point values should be cast to. Pin
Dennis Lerche8-Jun-09 9:52
MemberDennis Lerche8-Jun-09 9:52 
GeneralRe: Cast where XML file defines what integer and floating point values should be cast to. Pin
Dennis Lerche8-Jun-09 23:36
MemberDennis Lerche8-Jun-09 23:36 
QuestionHow to count a character in a string? Pin
SimpleData8-Jun-09 3:47
MemberSimpleData8-Jun-09 3:47 
AnswerRe: How to count a character in a string? Pin
PIEBALDconsult8-Jun-09 3:52
professionalPIEBALDconsult8-Jun-09 3:52 
AnswerRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 3:54
MemberBlue_Boy8-Jun-09 3:54 
GeneralRe: How to count a character in a string? Pin
Luc Pattyn8-Jun-09 4:50
sitebuilderLuc Pattyn8-Jun-09 4:50 
AnswerRe: How to count a character in a string? Pin
Manas Bhardwaj8-Jun-09 3:54
professionalManas Bhardwaj8-Jun-09 3:54 
GeneralRe: How to count a character in a string? Pin
SimpleData8-Jun-09 4:10
MemberSimpleData8-Jun-09 4:10 
AnswerRe: How to count a character in a string? Pin
Skymir8-Jun-09 4:17
MemberSkymir8-Jun-09 4:17 
GeneralRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 4:26
MemberBlue_Boy8-Jun-09 4:26 
AnswerRe: How to count a character in a string? [modified] Pin
Luc Pattyn8-Jun-09 4:51
sitebuilderLuc Pattyn8-Jun-09 4:51 
GeneralRe: How to count a character in a string? Pin
harold aptroot8-Jun-09 5:52
Memberharold aptroot8-Jun-09 5:52 
GeneralRe: How to count a character in a string? Pin
Luc Pattyn8-Jun-09 7:17
sitebuilderLuc Pattyn8-Jun-09 7:17 
GeneralRe: How to count a character in a string? Pin
harold aptroot8-Jun-09 7:45
Memberharold aptroot8-Jun-09 7:45 
Questionzedgraph Pin
yankoon8-Jun-09 3:06
Memberyankoon8-Jun-09 3:06 
QuestionDynamically adding checkboxes in datagridview. Pin
deepseeindeepsy8-Jun-09 3:02
Memberdeepseeindeepsy8-Jun-09 3:02 

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.