Click here to Skip to main content
15,881,880 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Arranging the box concept Pin
Eddy Vluggen27-Sep-17 5:30
professionalEddy Vluggen27-Sep-17 5:30 
QuestionConverting 32 bit Excel Files to 64 bit Excel files Programatically Pin
indian14326-Sep-17 6:53
indian14326-Sep-17 6:53 
AnswerRe: Converting 32 bit Excel Files to 64 bit Excel files Programatically Pin
Richard Deeming26-Sep-17 7:28
mveRichard Deeming26-Sep-17 7:28 
QuestionNeed to find out which versions of the Oracle and Office Drivers are installed on my machine Pin
indian14321-Sep-17 10:18
indian14321-Sep-17 10:18 
AnswerRe: Need to find out which versions of the Oracle and Office Drivers are installed on my machine Pin
Gerry Schmitz21-Sep-17 12:44
mveGerry Schmitz21-Sep-17 12:44 
GeneralRe: Need to find out which versions of the Oracle and Office Drivers are installed on my machine Pin
Peter R. Fletcher14-Oct-17 11:24
Peter R. Fletcher14-Oct-17 11:24 
QuestionConvert String to HEX Format Represents a 32-Bit Signed Integer Pin
chr1s211-Sep-17 1:40
chr1s211-Sep-17 1:40 
AnswerRe: Convert String to HEX Format Represents a 32-Bit Signed Integer Pin
Richard Deeming1-Sep-17 2:34
mveRichard Deeming1-Sep-17 2:34 
Problem 1:
Convert.ToInt32 expects a string containing a single numeric value, and returns a single Integer value.

You are trying to convert a string containing multiple numeric values, and expecting an array of Integer values.

You would need to split the string, and convert each part separately.

Problem 2:
Convert.ToInt32(ByVal value As String)[^] does not allow you to use a Hex prefix. Neither the VB prefix (&H) nor the C# prefix (0x) will work.

Instead, you need to remove the prefix and call the overload which accepts the base you want to convert from:
Convert.ToInt32(ByVal value As String, ByVal fromBase As Integer)[^]
(NB: The C# prefix would work with this overload, but the VB.NET prefix won't.)

VB.NET
Dim parts() As String = strReturn.Split(" "c)
Dim buffer() As Integer = Array.ConvertAll(parts, Function(p) Convert.ToInt32(p.Substring(2), 16))

Problem 3:
You're converting the values to Integer, but Write[^] expects an array of Byte values.


It would be much simpler to use the Encoding[^] class to convert the string to a series of bytes:
VB.NET
Dim Number1 As String = "2812"
Dim Str As String = "ATDT" & Number1 & "R" & Chr(&HD)
Dim buffer() As Byte = System.Text.Encoding.ASCII.GetBytes(Str)
frmMain.SerialPort1.Write(buffer, 0, buffer.Length)




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer



modified 19-Sep-17 7:38am.

GeneralRe: Convert String to HEX Format Represents a 32-Bit Signed Integer Pin
chr1s211-Sep-17 4:07
chr1s211-Sep-17 4:07 
GeneralRe: Convert String to HEX Format Represents a 32-Bit Signed Integer Pin
jschell18-Sep-17 12:24
jschell18-Sep-17 12:24 
GeneralRe: Convert String to HEX Format Represents a 32-Bit Signed Integer Pin
Richard Deeming19-Sep-17 1:35
mveRichard Deeming19-Sep-17 1:35 
GeneralRe: Convert String to HEX Format Represents a 32-Bit Signed Integer Pin
jschell20-Sep-17 5:08
jschell20-Sep-17 5:08 
QuestionCannot load multiple layers of SWF with Axshockwaveflash due to Adobe Flash security updates Pin
Member 1150681831-Aug-17 19:32
Member 1150681831-Aug-17 19:32 
AnswerRe: Cannot load multiple layers of SWF with Axshockwaveflash due to Adobe Flash security updates Pin
Richard MacCutchan31-Aug-17 20:56
mveRichard MacCutchan31-Aug-17 20:56 
GeneralRe: Cannot load multiple layers of SWF with Axshockwaveflash due to Adobe Flash security updates Pin
Member 1150681831-Aug-17 21:35
Member 1150681831-Aug-17 21:35 
Questionis not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides Pin
indian14329-Aug-17 13:41
indian14329-Aug-17 13:41 
GeneralRe: is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides Pin
PIEBALDconsult29-Aug-17 13:49
mvePIEBALDconsult29-Aug-17 13:49 
AnswerRe: is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides Pin
Richard MacCutchan29-Aug-17 20:52
mveRichard MacCutchan29-Aug-17 20:52 
Questionpie chart report in vb.net Pin
Member 1338013327-Aug-17 1:21
Member 1338013327-Aug-17 1:21 
AnswerRe: pie chart report in vb.net Pin
debasish mishra23-Jan-18 20:38
professionaldebasish mishra23-Jan-18 20:38 
QuestionGUI from CreateProcessWithTokenW does not show up Pin
gobbo-dd16-Aug-17 7:27
gobbo-dd16-Aug-17 7:27 
AnswerRe: GUI from CreateProcessWithTokenW does not show up Pin
Dave Kreskowiak16-Aug-17 12:56
mveDave Kreskowiak16-Aug-17 12:56 
GeneralRe: GUI from CreateProcessWithTokenW does not show up Pin
gobbo-dd16-Aug-17 20:12
gobbo-dd16-Aug-17 20:12 
GeneralRe: GUI from CreateProcessWithTokenW does not show up Pin
Dave Kreskowiak17-Aug-17 4:58
mveDave Kreskowiak17-Aug-17 4:58 
GeneralRe: GUI from CreateProcessWithTokenW does not show up Pin
Eddy Vluggen17-Aug-17 7:46
professionalEddy Vluggen17-Aug-17 7:46 

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.