J
Jon Brunson
Is it possible to load the same DLL on the Full & Compact frameworks
using Assembly.LoadFrom(Filename)?
I've written a plugin-based application, which works brilliantly atm.
However I want to expand it so that the stuff that is currently
PDA-based can be done on a PC, and I don't particularly want to have two
seperate DLLs (Plugins) that do exactly the same thing, one for each
framework.
I've tried loading the PDA Plugins in a test PC application, and they
load ok - so long as they don't use any PDA-specific stuff (mainly
caused by using the OpenNETCF, as those DLLs wont load on the desktop).
So the next thing I tried was creating a PC DLL which references the
OpenNETCF, and wrote different code like so:
[VB.NET]
Friend WithEvents btnShowCalender As Control
Public Sub New()
MyBase.New()
InitializeComponent()
If Environment.OSVersion.Platform = PlatformID.WinCE Then
Dim btn As New OpenNETCF.Windows.Forms.ButtonEx
btn.Image = Me.imgButton.Images(0)
btn.TextAlign = OpenNETCF.Drawing.ContentAlignment.MiddleCenter
btn.TransparentImage = False
Me.btnShowCalender = btn
Else
Dim btn As New Button
btn.Image = Me.imgButton.Images(0)
btn.TextAlign = ContentAlignment.MiddleCenter
Me.btnShowCalender = btn
End If
Me.btnShowCalender.Location = New System.Drawing.Point(176, 0)
Me.btnShowCalender.Size = New System.Drawing.Size(24, 21)
Me.Controls.Add(Me.btnShowCalender)
End Sub
[/VB.NET]
And this works perfectly on the PC, but when I attempt to load it on the
PDA, I get a TypeLoadException - presumably because the DLL references
the full framework System dlls.
So, after all that, how do, or indeed /can/, I create a single DLL that
loads & works on both frameworks?
using Assembly.LoadFrom(Filename)?
I've written a plugin-based application, which works brilliantly atm.
However I want to expand it so that the stuff that is currently
PDA-based can be done on a PC, and I don't particularly want to have two
seperate DLLs (Plugins) that do exactly the same thing, one for each
framework.
I've tried loading the PDA Plugins in a test PC application, and they
load ok - so long as they don't use any PDA-specific stuff (mainly
caused by using the OpenNETCF, as those DLLs wont load on the desktop).
So the next thing I tried was creating a PC DLL which references the
OpenNETCF, and wrote different code like so:
[VB.NET]
Friend WithEvents btnShowCalender As Control
Public Sub New()
MyBase.New()
InitializeComponent()
If Environment.OSVersion.Platform = PlatformID.WinCE Then
Dim btn As New OpenNETCF.Windows.Forms.ButtonEx
btn.Image = Me.imgButton.Images(0)
btn.TextAlign = OpenNETCF.Drawing.ContentAlignment.MiddleCenter
btn.TransparentImage = False
Me.btnShowCalender = btn
Else
Dim btn As New Button
btn.Image = Me.imgButton.Images(0)
btn.TextAlign = ContentAlignment.MiddleCenter
Me.btnShowCalender = btn
End If
Me.btnShowCalender.Location = New System.Drawing.Point(176, 0)
Me.btnShowCalender.Size = New System.Drawing.Size(24, 21)
Me.Controls.Add(Me.btnShowCalender)
End Sub
[/VB.NET]
And this works perfectly on the PC, but when I attempt to load it on the
PDA, I get a TypeLoadException - presumably because the DLL references
the full framework System dlls.
So, after all that, how do, or indeed /can/, I create a single DLL that
loads & works on both frameworks?