Search the web
Sign In
New User? Sign Up
xAP_developer
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
<DllImport("xFx.dll")> into a compiled VB.net DLL Class   Message List  
Reply | Forward Message #1957 of 2061 |
How would I construct a <DllImport("xFx.dll")> into a compiled VB.net DLL Class.
I am coding a plugin for LCDStudio,(A C#.net app.), that compiles to a VB.net
dll. If I use a module my code compiles, but it throws an exception when I call
the sub "Listen" from my UserControl.

##############################################################
Unhandled Exception:

The type initializer for 'xAPPlugin.xAPListen' threw an exception.

System.TypeInitializationException

Stack Trace:
at xAPPlugin.xAPListen.Listen()
at xAPPlugin.UserControl1.Button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button,
Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)

Inner Exception:
Unhandled Exception:

The given path's format is not supported.

System.NotSupportedException

Stack Trace:
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path,
Boolean needFullPath)
at
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str,
Boolean needFullPath)
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity
directorySecurity)
at System.Windows.Forms.Application.GetDataPath(String basePath)
at System.Windows.Forms.Application.get_LocalUserAppDataPath()
at
ERSP.Utilities.Configuration.LocalFileModuleSettingsProvider.GetPropertyValues(S\
ettingsContext context, SettingsPropertyCollection collection)
at
System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider
provider)
at System.Configuration.SettingsBase.GetPropertyValueByName(String
propertyName)
at System.Configuration.SettingsBase.get_Item(String propertyName)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String
propertyName)
at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
at xFx.Properties.Settings.get_xAPHeaderUseExtendedUID()
at KCS.xAP.Framework.Message.xAPHeaderUID..ctor()
at KCS.xAP.Framework.Message.xAPHeaderBase..ctor()
at KCS.xAP.Framework.Message.xAPHeartbeat..ctor()
at KCS.xAP.Framework.Transport.xAPHubClientListener..ctor()
at xAPPlugin.xAPListen..cctor()
###################################################################

Here is the simple module. I can compile an exe sending its message recieved to
a textbox on a form and it works just fine. The compiled plugin runs just fine
in LCDStudio, till I call the "Listen" sub. Then "Something Bad Has Happened".
:)

#################################################################
Imports System
Imports KCS.xAP.Framework.Transport
Imports KCS.xAP.Framework.Message

Public Module xAPListen


Public Message1 As String
Public WithEvents listener As New xAPHubClientListener



Public Sub Listen()
On Error Resume Next

listener.Start()

'Message1 = (String.Format("My address={0}, UID={1}",
listener.Heartbeat.Source, listener.Heartbeat.UID))


End Sub
Sub Listener_EventHandler(ByVal sender As Object, ByVal msgEvent As
xAPMessageEventArgs) Handles listener.eventMessageReceived
On Error Resume Next
Dim msg As xAPMessage = msgEvent.Message
Dim hdr As xAPHeaderBase = msg.Header
Dim body As xAPMessageBody = msg.Body
Dim strhdr As String
Dim strbdy As String
Dim strmsg As String

strhdr = (String.Format("Received {0} from {1}, UID {2}", hdr.Class,
hdr.Source, hdr.UID))
If InStr(strhdr, "Message.Display") Then
For Each block As xAPMessageBlock In body
Message1 = ""
strbdy = (String.Format("Block: {0}", block.Name))

For Each parameter As String In block.Keys

Dim v As xAPPairValue = block(parameter)

strmsg = (String.Format("{0} = {1}", parameter, v.Value))
Message1 = Message1 & v.Value & vbCr
Next

Next
End If
End Sub


End Module
####################################################################

I have the reference set to the xFx.dll. I have searched google for an answer as
to why.
I believe I need to do a <DllImport("xFx.dll")>? But I cant seem to pull the
proper way to construct the Function from the xAP Framework xFx v2 Help file.
Any ideas? Am I on the right track?
...JJG







Wed Mar 25, 2009 4:49 am

jebusyoda
Offline Offline
Send Email Send Email

Forward
Message #1957 of 2061 |
Expand Messages Author Sort by Date

How would I construct a <DllImport("xFx.dll")> into a compiled VB.net DLL Class. I am coding a plugin for LCDStudio,(A C#.net app.), that compiles to a VB.net...
jebusyoda
Offline Send Email
Mar 25, 2009
12:19 pm

JJG Looks like the xFx.dll is missing its configuration file. You need to put a copy of 'xFx.dll.config' in the same directory as xFx.dll. The xFx.dll keeps...
Edward Pearson
erspearson
Offline Send Email
Mar 25, 2009
12:57 pm

Hmmm, Looking a little closer at this, it looks like it's the .Net Framework that is having problems rather than xFx particularly. xFx, as part of its config...
Edward Pearson
erspearson
Offline Send Email
Mar 25, 2009
5:23 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help