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

Visual Basic

 
AnswerRe: Winhttp and p12 certificate Pin
Richard MacCutchan24-Jul-17 21:15
mveRichard MacCutchan24-Jul-17 21:15 
GeneralRe: Winhttp and p12 certificate Pin
Crazy Joe Devola24-Jul-17 21:28
Crazy Joe Devola24-Jul-17 21:28 
SuggestionRe: Winhttp and p12 certificate Pin
Richard Deeming25-Jul-17 0:55
mveRichard Deeming25-Jul-17 0:55 
GeneralRe: Winhttp and p12 certificate Pin
Crazy Joe Devola25-Jul-17 11:44
Crazy Joe Devola25-Jul-17 11:44 
GeneralRe: Winhttp and p12 certificate Pin
Dave Kreskowiak25-Jul-17 13:17
mveDave Kreskowiak25-Jul-17 13:17 
AnswerRe: Winhttp and p12 certificate Pin
Crazy Joe Devola26-Jul-17 10:51
Crazy Joe Devola26-Jul-17 10:51 
Questionhelp me Pin
ago248621-Jul-17 9:52
ago248621-Jul-17 9:52 
AnswerRe: help me Pin
Afzaal Ahmad Zeeshan21-Jul-17 11:36
professionalAfzaal Ahmad Zeeshan21-Jul-17 11:36 
GeneralRe: help me Pin
ago248622-Jul-17 1:36
ago248622-Jul-17 1:36 
GeneralRe: help me Pin
Richard MacCutchan22-Jul-17 2:44
mveRichard MacCutchan22-Jul-17 2:44 
GeneralRe: help me Pin
Eddy Vluggen23-Jul-17 2:58
professionalEddy Vluggen23-Jul-17 2:58 
GeneralRe: Pin
ago248623-Jul-17 4:31
ago248623-Jul-17 4:31 
GeneralRe: Pin
Eddy Vluggen23-Jul-17 8:16
professionalEddy Vluggen23-Jul-17 8:16 
QuestionConverting C# to VB.net but code gives null reference Pin
Shane James21-Jul-17 0:56
Shane James21-Jul-17 0:56 
AnswerRe: Converting C# to VB.net but code gives null reference Pin
Richard MacCutchan21-Jul-17 1:15
mveRichard MacCutchan21-Jul-17 1:15 
AnswerRe: Converting C# to VB.net but code gives null reference Pin
Ralf Meier21-Jul-17 2:33
mveRalf Meier21-Jul-17 2:33 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Shane James21-Jul-17 3:03
Shane James21-Jul-17 3:03 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Ralf Meier21-Jul-17 3:16
mveRalf Meier21-Jul-17 3:16 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Shane James21-Jul-17 4:30
Shane James21-Jul-17 4:30 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Ralf Meier21-Jul-17 8:44
mveRalf Meier21-Jul-17 8:44 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Shane James21-Jul-17 21:00
Shane James21-Jul-17 21:00 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Shane James21-Jul-17 21:02
Shane James21-Jul-17 21:02 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Ralf Meier22-Jul-17 10:25
mveRalf Meier22-Jul-17 10:25 
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Pawel Wzietek1-Aug-17 2:33
Pawel Wzietek1-Aug-17 2:33 
Shane James wrote:
If I put the reader = New Reader() in the connect sub, the error goes away, but nothing works like it should. it doesnt pick up the events or anything

This is normal: you create a new instance of the Reader class but this one is not configured like the first one was in the constructor of Results_Capture_Enduro. But I don't think the problem is here, you should remove this line.

You did not tell us which variable triggers the exception. To find it you can remove the try...catch block around the call to connect() to let the debugger stop at the line the exception occurs.

There is one line where the VB code is not equivalent to its C# counterpart:
Dim readerDeviceInfo As ReaderDeviceInfo = CType((cbbSportIdentDevices.SelectedItem), ReaderDeviceInfo)

The strictly equivalent version would be:
Dim readerDeviceInfo As ReaderDeviceInfo = DirectCast((cbbSportIdentDevices.SelectedItem), ReaderDeviceInfo)

See this article:
DirectCast vs. CType[^]
for explanations. In general using CType for a simple type cast is dangerous because it will try to do something even if the cast is not possible, so that the error may propagate to other parts of the code where it is difficult to understand.

NB. Also be careful when translating from C# to VB.NET as the latter is not really case sensitive which may cause compilation errors:
vb.net - Is VB really case insensitive? - Stack Overflow[^]
GeneralRe: Converting C# to VB.net but code gives null reference Pin
Eddy Vluggen3-Aug-17 0:06
professionalEddy Vluggen3-Aug-17 0:06 

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.