Click here to Skip to main content
15,924,367 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Get Hard disc Serial number Pin
Rupesh Kumar Swami20-Mar-08 3:42
Rupesh Kumar Swami20-Mar-08 3:42 
Questionselect statement that will retrieve all entries that have a certian letter combination in it? Pin
Mr Oizo19-Mar-08 4:40
Mr Oizo19-Mar-08 4:40 
AnswerRe: select statement that will retrieve all entries that have a certian letter combination in it? Pin
Dave Kreskowiak19-Mar-08 5:51
mveDave Kreskowiak19-Mar-08 5:51 
GeneralRe: select statement that will retrieve all entries that have a certian letter combination in it? Pin
Mr Oizo19-Mar-08 20:59
Mr Oizo19-Mar-08 20:59 
GeneralUnsigned Integers and Marshal.ReadInt32() Pin
VFaul19-Mar-08 4:16
VFaul19-Mar-08 4:16 
GeneralRe: Unsigned Integers and Marshal.ReadInt32() Pin
Dave Kreskowiak19-Mar-08 4:39
mveDave Kreskowiak19-Mar-08 4:39 
GeneralRe: Unsigned Integers and Marshal.ReadInt32() Pin
VFaul19-Mar-08 7:25
VFaul19-Mar-08 7:25 
GeneralRe: Unsigned Integers and Marshal.ReadInt32() Pin
Dave Kreskowiak19-Mar-08 8:15
mveDave Kreskowiak19-Mar-08 8:15 
VFaul wrote:
What baffles me is that there aren't unsigned marshaling methods: Marshal.ReadUInt16(), ReadUIn32(), and ReadUInt64()!? I'm being forced to do four ReadByte() calls when one call to ReadUInt32() is all I would need.


Yep. After looking at the code for the Marshal class, ReadInt32 method, it's sort of obvious why. That method has but a single line of code that calls a function, ND_RI4, exported by mscoree.dll. This function reads a 4 byte value and returns an I4, or Int32. The only other exported functions that do this are:
    ND_RI2  -  Returns a 16-bit signed integer
    ND_RI4  -  Returns a 32-bit signed integer
    ND_RI8  -  Returns a 64-bit signed integer
and
    ND_RU1  -  Returns a single byte

There are counterpart functions that write values too, modeled after these "read" version. Sadly, it boils down to the CLR doesn't natively support what you want to do.

I also looked into the possibility of using Marshal.ReadIntPtr, which returns a processor width pointer. On any non-x64 version of Windows, this always maps to a 32-bit unsigned integer. But, there is no conversion supplied to go from an IntPtr to a UInt, only a conversion to Int32 exists.



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




GeneralChanging VB Project Properties Pin
Jeeva Mary Varghese19-Mar-08 1:06
Jeeva Mary Varghese19-Mar-08 1:06 
QuestionHow to prevent multiple user login using one account in VB Pin
kingascona18-Mar-08 23:48
professionalkingascona18-Mar-08 23:48 
GeneralRe: How to prevent multiple user login using one account in VB Pin
Nilesh Hapse19-Mar-08 0:57
Nilesh Hapse19-Mar-08 0:57 
GeneralChange the title bar heading on a form in code... Pin
Mr Oizo18-Mar-08 22:45
Mr Oizo18-Mar-08 22:45 
AnswerRe: Change the title bar heading on a form in code... Pin
Rajesh Anuhya18-Mar-08 22:54
professionalRajesh Anuhya18-Mar-08 22:54 
GeneralRe: Change the title bar heading on a form in code... Pin
Mr Oizo19-Mar-08 0:34
Mr Oizo19-Mar-08 0:34 
GeneralProblem in opening a textfile in excel using vb.net Pin
Madang18-Mar-08 21:30
Madang18-Mar-08 21:30 
GeneralRe: Problem in opening a textfile in excel using vb.net Pin
Mycroft Holmes18-Mar-08 21:47
professionalMycroft Holmes18-Mar-08 21:47 
GeneralRe: Problem in opening a textfile in excel using vb.net [modified] Pin
Madang18-Mar-08 21:53
Madang18-Mar-08 21:53 
GeneralRe: Problem in opening a textfile in excel using vb.net Pin
Mycroft Holmes19-Mar-08 1:07
professionalMycroft Holmes19-Mar-08 1:07 
GeneralRe: Problem in opening a textfile in excel using vb.net Pin
Dave Kreskowiak19-Mar-08 4:28
mveDave Kreskowiak19-Mar-08 4:28 
Questionhow do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mr Oizo18-Mar-08 21:18
Mr Oizo18-Mar-08 21:18 
AnswerRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mycroft Holmes18-Mar-08 21:52
professionalMycroft Holmes18-Mar-08 21:52 
GeneralRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mr Oizo18-Mar-08 22:41
Mr Oizo18-Mar-08 22:41 
AnswerRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Tom Wright19-Mar-08 8:58
Tom Wright19-Mar-08 8:58 
QuestionHow to retrieve the data by Date/Time Data Type from a Table ? Pin
phowarso18-Mar-08 20:07
phowarso18-Mar-08 20:07 
AnswerRe: How to retrieve the data by Date/Time Data Type from a Table ? Pin
Christian Graus18-Mar-08 20:19
protectorChristian Graus18-Mar-08 20:19 

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.