Click here to Skip to main content
15,920,633 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: GetObject Issues Pin
Dave Kreskowiak3-Jun-04 12:13
mveDave Kreskowiak3-Jun-04 12:13 
GeneralGetting Email Address Pin
Member 112651927-May-04 16:44
Member 112651927-May-04 16:44 
GeneralRe: Getting Email Address Pin
Dave Kreskowiak28-May-04 2:53
mveDave Kreskowiak28-May-04 2:53 
GeneralSimple Syntax Question Pin
eggie527-May-04 13:28
eggie527-May-04 13:28 
GeneralRe: Simple Syntax Question Pin
Aaron Eldreth27-May-04 14:49
Aaron Eldreth27-May-04 14:49 
GeneralRe: Simple Syntax Question Pin
Anonymous27-May-04 14:51
Anonymous27-May-04 14:51 
GeneralVarPtr Function Pin
Pugman81227-May-04 12:29
Pugman81227-May-04 12:29 
GeneralRe: VarPtr Function Pin
Dave Kreskowiak28-May-04 2:37
mveDave Kreskowiak28-May-04 2:37 
VarPtr has no equivelent in VB.NET... All it does is return the address of the variable, which, in managed code, is not guarenteed to stay where it was created thereby invalidating the return of VarPtr.

What you would have to do is, in VB6, step through this code and watch what happens to dataX. the variable dataX looks like it is a Long, or Integer in VB.NET...a 32-bit signed integer. What it looks like it's doing is copying bytes 2, 3, and 4 to byte 1 of dataX. It might help to look at the value of dataX in the Watch window in Hexadecimal.
    dataX before CopyMem               dataX after CopyMem
byte1 | byte2 | byte3 | byte4      byte1 | byte2 | byte3 | byte4
 2B      1A      00      FE         1A      00      FE      FE

In this case, what you would need to do is mask out byte 1, 2, and 3 to get the value of the 4th byte. Then move the numbers in dataX to the left by 8 bits and finally add back in the lastByte:
' From the example above...
Dim dataX As Integer = &H2B1A00FE
Dim lastByte As Integer = (dataX And &H000000FF)     ' lastByte will equal &HFE.

' This moves the data left 8 bits.  This will drop the first byte and move
' the remaining bytes to the left, leaving 00 in the last byte.
'    2B1A00FE becomes 1A00FE00
dataX = dataX * 256

' Now add back in, the byte that we saved above.
'    1A00FE00 becomes 1A00FEFE
dataX = dataX + lastByte



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralData type conversion help needed when Using a VC++ dll with VB.NET Pin
Freddie Code27-May-04 12:23
Freddie Code27-May-04 12:23 
GeneralInVisble specify Column in ListView Ctrl Pin
skoizumi2911027-May-04 11:57
sussskoizumi2911027-May-04 11:57 
GeneralRe: InVisble specify Column in ListView Ctrl Pin
Dave Kreskowiak28-May-04 2:11
mveDave Kreskowiak28-May-04 2:11 
GeneralRe: InVisble specify Column in ListView Ctrl Pin
skoizumi2911028-May-04 15:02
sussskoizumi2911028-May-04 15:02 
GeneralSelecting a value from a combo box using code Pin
mincefish27-May-04 3:40
mincefish27-May-04 3:40 
GeneralRe: Selecting a value from a combo box using code Pin
Dave Kreskowiak27-May-04 4:26
mveDave Kreskowiak27-May-04 4:26 
GeneralRe: Selecting a value from a combo box using code Pin
mincefish27-May-04 6:10
mincefish27-May-04 6:10 
GeneralInterfacing COM Port with PC Pin
Lameta27-May-04 2:46
Lameta27-May-04 2:46 
GeneralRe: Interfacing COM Port with PC Pin
Dave Kreskowiak27-May-04 3:26
mveDave Kreskowiak27-May-04 3:26 
GeneralRe: Interfacing COM Port with PC Pin
Prerak28-May-04 2:50
Prerak28-May-04 2:50 
GeneralInterfacing COM Port with PC Pin
Lameta27-May-04 2:42
Lameta27-May-04 2:42 
GeneralRe: Interfacing COM Port with PC Pin
Dave Kreskowiak27-May-04 2:50
mveDave Kreskowiak27-May-04 2:50 
GeneralCostumizing .NET PropertyGrid at runtime Pin
thlund26-May-04 22:55
thlund26-May-04 22:55 
GeneralNeed help sending SMS with VB.NET Pin
Werner Vos26-May-04 22:05
Werner Vos26-May-04 22:05 
GeneralRe: Need help sending SMS with VB.NET Pin
Dave Kreskowiak27-May-04 1:01
mveDave Kreskowiak27-May-04 1:01 
GeneralFree Visual Studio VB.NET Std. Edition Pin
TigerNinja_26-May-04 16:13
TigerNinja_26-May-04 16:13 
GeneralRe: Free Visual Studio VB.NET Std. Edition Pin
Aaron Eldreth27-May-04 9:58
Aaron Eldreth27-May-04 9:58 

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.