IRDA with VB2005

  • Thread starter Thread starter Roger Allen
  • Start date Start date
R

Roger Allen

Hi:

I am trying to write an app in VB2005 that can send data to another device
via the IR port on my laptop.

I do not want to use Comm Port workarounds.

Does anyone know of code examples, or any clue how this can be done.

Help will be appreciated.
 
Use the IrDAClient class, whether the one in the .NETCF,
http://msdn.microsoft.com/library/d...frlrfsystemnetsocketsirdaclientclasstopic.asp,
or Peter Foot's enhanced one, which also works on the full Framework,
http://32feet.net/library/InTheHand.Net.Sockets.IrDAClient.html

I've example code of the latter, for IrCOMM and IrLPT usage, on my website,
see http://www.alanjmcf.me.uk/comms/infrared/irdaDotNetCliIrLpt.cs.html and
http://www.alanjmcf.me.uk/comms/infrared/irdaDotNetCliIrComm.vb.html, the
latter being in VB.NET.
 
Alan:
I just downloaded and installed InThehand v1.6.5.1222. I'm using VS2005

The code below generates the following error:

Error 1 Reference required to assembly 'System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes'
containing the type 'System.Net.Sockets.Socket'. Add one to your project.
..........

Does this mean there is a compatibility issue with VS2005 and/or .netV2?

Any advice will be much appreciated

Roger


Option Strict On

Option Explicit On

Imports System

Imports System.Text

Imports System.Net.Sockets.Socket

Imports InTheHand.Net.Sockets

Public Class frmMain

Const SelectPeerNum As Integer = 0

Const ServiceName As String = "IrDA:IRCOMM"

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim Cli As New IrDAClient

Cli.Client()

End Sub

End Class
 
wrote:
I just downloaded and installed InThehand v1.6.5.1222. I'm using
VS2005

The code below generates the following error:
Error 1 Reference required to assembly 'System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes'
containing the type 'System.Net.Sockets.Socket'. Add one to your
project. .........

Does this mean there is a compatibility issue with VS2005 and/or
.netV2?
Yes and no. It appears that the 32feet.NET library is compiled
against the .NET CF v1. But this isn't a problem at runtime as the
reference is "Retargetable" and through a feature called unification
(http://msdn2.microsoft.com/en-us/library/db7849ey.aspx) the runtime
will use its own version of the framework, e.g. if the v2 runtime loads
the library it will redirect references for v1 assemblies to its own.

Now, at compile time; with the CS compiler(s) there's no problem either.
A similar thing seems to happen; it sees the reference to the older
framework assembly, and just continues using its own framework version.

However with the VB compiler this seems not to be the case and this
error is reported. (And unsurprisingly trying supplying an explicit
reference to the old assembly makes the compiler even more confused; at
least when I try with a 1.1 version [...\v2.0.50727\vbc xxxx.vb
/r:System /r:...\v1.1.4322\System.dll]; complaining of ambiguous
references.)

So I guess this is a bug in the VB compiler, but I'm not really expert
enough to know for sure.

Anyone here have any comment?

I you get no answer here, then try posting in http://32feet.net/forums/,
ahh wait I see you've done so already. :-)
(http://32feet.net/forums/452/ShowPost.aspx)
Const ServiceName As String = "IrDA:IRCOMM"
(Should be "IrDA:IrCOMM").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top