Click here to Skip to main content
15,885,771 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
prasadbuddhika8-Jun-09 5:30 
AnswerRe: is dataset performs well over Lists when navigating data in the memory Pin
Henry Minute8-Jun-09 9:56
Henry Minute8-Jun-09 9:56 
QuestionWeb Cam Problem Pin
S K Y8-Jun-09 5:23
S 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
Simon P Stevens8-Jun-09 5:38 
QuestionHow to embed a internet explorer in a webbrowser control using c# Pin
Yukivi8-Jun-09 5:08
Yukivi8-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
Dennis 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
led 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
Dennis 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
Dennis Lerche8-Jun-09 23:36 
QuestionHow to count a character in a string? Pin
SimpleData8-Jun-09 3:47
SimpleData8-Jun-09 3:47 
AnswerRe: How to count a character in a string? Pin
PIEBALDconsult8-Jun-09 3:52
mvePIEBALDconsult8-Jun-09 3:52 
AnswerRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 3:54
Blue_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
SimpleData8-Jun-09 4:10 
AnswerRe: How to count a character in a string? Pin
Skymir8-Jun-09 4:17
Skymir8-Jun-09 4:17 
GeneralRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 4:26
Blue_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
harold 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
harold aptroot8-Jun-09 7:45 
Questionzedgraph Pin
yankoon8-Jun-09 3:06
yankoon8-Jun-09 3:06 
QuestionDynamically adding checkboxes in datagridview. Pin
deepseeindeepsy8-Jun-09 3:02
deepseeindeepsy8-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.