The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: <DllImport("xFx.dll")> into a compiled VB.net DLL Class



------=_NextPart_000_0079_01C9AD54.7275F140
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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 setup is calling a .Net Framework property
'Application.LocalUserAppDataPath'. It's this that is throwing an
exception.
The LocalUserAppDataPath normally looks like:



'C:\Documents and Settings\username\Local Settings\Application
Data\CompanyName\ProductName\ProductVersion'



.Net will create this path if it does not exist - but in this case it is
failing. Could it be that there is something in the settings for
CompanyName, ProductName or ProductVersion, defined by the main app
(LCDStudio) that would generate an illegal file path?



Try getting values for  Application.ProductName, Application.CompanyName
and
Application.ProductVersion in your code and see what you get.



Or maybe there's some problem with permissions on the directory that .Net
is
trying to create the folder in (but that would probably cause all .Net apps
to fail similarly).



.



From: xAP_developer@xxxxxxx [mailto:xAP_developer@xxxxxxx]
On Behalf Of Edward Pearson
Sent: 25 March 2009 12:51
To: xAP_developer@xxxxxxx
Subject: RE: [xAP_developer] <DllImport("xFx.dll")> into a
compiled VB.net
DLL Class



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 its settings in a separate file to the application
(myapp.exe.config) so that you don't have to add all the xFx settings to
the
application's config file yourself.



You can automate the provision of xFx.dll.config to the project's output
directory using Visual Studio by including it as one of the project's files
and setting its 'Build Action' property to 'Content' and its 'Copy to
Output
Directory' property to 'Copy Always'.



HTH



Edward



From: xAP_developer@xxxxxxx [mailto:xAP_developer@xxxxxxx]
On Behalf Of jebusyoda
Sent: 25 March 2009 04:50
To: xAP_developer@xxxxxxx
Subject: [xAP_developer] <DllImport("xFx.dll")> into a
compiled VB.net DLL
Class



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(FileIOPermissionAcc
ess 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.GetPropertyValu
es(SettingsContext 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




------=_NextPart_000_0079_01C9AD54.7275F140
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit





<head>

<style type="text/css">
<!--

/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}

div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}

div.attach-table div.attach-row {
clear: both;
}

div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}

p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}

p span {
color: #628C2A;
}

div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}

div.attach-table div.attach-row div div span {
font-weight: normal;
}

div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml";
xmlns="http://www.w3.org/TR/REC-html40";>

<head>
<meta http-equiv=Content-Type content="text/html;
charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered
medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.left
{mso-style-name:left;}
span.bld
{mso-style-name:bld;}
p.ad, li.ad, div.ad
{mso-style-name:ad;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad1, li.ad1, div.ad1
{mso-style-name:ad1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad2, li.ad2, div.ad2
{mso-style-name:ad2;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad3, li.ad3, div.ad3
{mso-style-name:ad3;
mso-margin-top-alt:auto;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.replbq, li.replbq, div.replbq
{mso-style-name:replbq;
margin:3.0pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.yshortcuts
{mso-style-name:yshortcuts;}
p.ad4, li.ad4, div.ad4
{mso-style-name:ad4;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad5, li.ad5, div.ad5
{mso-style-name:ad5;
mso-margin-top-alt:auto;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad6, li.ad6, div.ad6
{mso-style-name:ad6;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.yshortcuts1
{mso-style-name:yshortcuts1;
font-family:"Verdana","sans-serif";
font-weight:bold;}
span.yshortcuts2
{mso-style-name:yshortcuts2;
font-family:"Verdana","sans-serif";
color:#1E66AE;
font-weight:normal;}
span.EmailStyle35
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:452944061;
mso-list-template-ids:108174896;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-GB link=blue vlink=purple>



<div class=Section1>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hmmm,<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Looking a little closer at this, it looks like
it&#8217;s the
.Net Framework that is having problems rather than xFx
particularly.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>xFx, as part of its config setup is calling a .Net
Framework property
&#8216;Application.LocalUserAppDataPath&#8217;. It&#8217;s this
that is
throwing an exception. The LocalUserAppDataPath normally looks
like:<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&#8216;C:\Documents and Settings\username\Local
Settings\Application
Data\CompanyName\ProductName\ProductVersion&#8217;<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>.Net will create this path if it does not exist
&#8211; but in
this case it is failing. Could it be that there is something in the
settings
for CompanyName, ProductName or ProductVersion, defined by the main app
(LCDStudio) that would generate an illegal file
path?<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Try getting values for &nbsp;Application.ProductName,
Application.CompanyName
and Application.ProductVersion in your code and see what you
get.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Or maybe there&#8217;s some problem with permissions
on the
directory that .Net is trying to create the folder in (but that would
probably
cause all .Net apps to fail
similarly).<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&#8230;<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm
4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm
0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span
lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>
xAP_developer@xxxxxxx
[mailto:xAP_developer@xxxxxxx]
<b>On Behalf Of </b>Edward Pearson<br>
<b>Sent:</b> 25 March 2009 12:51<br>
<b>To:</b> xAP_developer@xxxxxxx<br>
<b>Subject:</b> RE: [xAP_developer]
&lt;DllImport(&quot;xFx.dll&quot;)&gt; into
a compiled VB.net DLL Class<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div id=ygrp-mlmsg>

<div id=ygrp-msg>

<div id=ygrp-text>

<div>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>JJG</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Looks like the xFx.dll is missing
its
configuration file. You need to put a copy of
&#8216;xFx.dll.config&#8217; in
the same directory as
xFx.dll.</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>The xFx.dll keeps its settings in
a
separate file to the application (myapp.exe.config) so that you
don&#8217;t
have to add all the xFx settings to the application&#8217;s config file
yourself.</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>You can automate the provision of
xFx.dll.config to the project&#8217;s output directory using Visual
Studio by
including it as one of the project&#8217;s files and setting its
&#8216;Build
Action&#8217; property to &#8216;Content&#8217; and its
&#8216;Copy to Output
Directory&#8217; property to &#8216;Copy
Always&#8217;.</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>HTH</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Edward</span><o:p></o:p></p>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm
0cm'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:0cm 0cm
0cm 0cm'>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
lang=EN-US style='font-size:10.0pt'>From:</span></b><span
lang=EN-US
style='font-size:10.0pt'> xAP_developer@xxxxxxx [mailto:xAP_developer@xxxxxxx]
<b>On Behalf Of </b>jebusyoda<br>
<b>Sent:</b> 25 March 2009 04:50<br>
<b>To:</b> xAP_developer@xxxxxxx<br>
<b>Subject:</b> [xAP_developer]
&lt;DllImport(&quot;xFx.dll&quot;)&gt; into a
compiled VB.net DLL Class</span><o:p></o:p></p>

</div>

</div>

<p class=MsoNormal
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>

<div id=ygrp-mlmsg>

<div id=ygrp-msg>

<div id=ygrp-text>

<p>How would I construct a
&lt;DllImport(&quot;xFx.dll&quot;)&gt; 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 &quot;Listen&quot; from my
UserControl.<br>
<br>
##############################################################<br>
Unhandled Exception:<br>
<br>
The type initializer for 'xAPPlugin.xAPListen' threw an
exception.<br>
<br>
System.TypeInitializationException<br>
<br>
Stack Trace:<br>
at xAPPlugin.xAPListen.Listen()<br>
at xAPPlugin.UserControl1.Button1_Click(Object sender, EventArgs
e)<br>
at System.Windows.Forms.Control.OnClick(EventArgs e)<br>
at System.Windows.Forms.Button.OnClick(EventArgs e)<br>
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br>
at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons
button,
Int32 clicks)<br>
at System.Windows.Forms.Control.WndProc(Message&amp; m)<br>
at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)<br>
at System.Windows.Forms.Button.WndProc(Message&amp; m)<br>
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;
m)<br>
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;
m)<br>
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr
wparam, IntPtr lparam)<br>
<br>
Inner Exception:<br>
Unhandled Exception:<br>
<br>
The given path's format is not supported.<br>
<br>
System.NotSupportedException<br>
<br>
Stack Trace:<br>
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path,
Boolean needFullPath)<br>
at
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
str, Boolean needFullPath)<br>
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)<br>
at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean
needFullPath)<br>
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity
directorySecurity)<br>
at System.Windows.Forms.Application.GetDataPath(String basePath)<br>
at System.Windows.Forms.Application.get_LocalUserAppDataPath()<br>
at
ERSP.Utilities.Configuration.LocalFileModuleSettingsProvider.GetPropertyValues(SettingsContext
context, SettingsPropertyCollection collection)<br>
at
System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider
provider)<br>
at System.Configuration.SettingsBase.GetPropertyValueByName(String
propertyName)<br>
at System.Configuration.SettingsBase.get_Item(String
propertyName)<br>
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String
propertyName)<br>
at System.Configuration.ApplicationSettingsBase.get_Item(String
propertyName)<br>
at xFx.Properties.Settings.get_xAPHeaderUseExtendedUID()<br>
at KCS.xAP.Framework.Message.xAPHeaderUID..ctor()<br>
at KCS.xAP.Framework.Message.xAPHeaderBase..ctor()<br>
at KCS.xAP.Framework.Message.xAPHeartbeat..ctor()<br>
at KCS.xAP.Framework.Transport.xAPHubClientListener..ctor()<br>
at xAPPlugin.xAPListen..cctor()<br>
###################################################################<br>
<br>
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 &quot;Listen&quot; sub. Then
&quot;Something Bad
Has Happened&quot;. :)<br>
<br>
#################################################################<br>
Imports System<br>
Imports KCS.xAP.Framework.Transport<br>
Imports KCS.xAP.Framework.Message<br>
<br>
Public Module xAPListen<br>
<br>
Public Message1 As String<br>
Public WithEvents listener As New xAPHubClientListener<br>
<br>
Public Sub Listen()<br>
On Error Resume Next<br>
<br>
listener.Start()<br>
<br>
'Message1 = (String.Format(&quot;My address={0}, UID={1}&quot;,
listener.Heartbeat.Source, listener.Heartbeat.UID))<br>
<br>
End Sub<br>
Sub Listener_EventHandler(ByVal sender As Object, ByVal msgEvent As
xAPMessageEventArgs) Handles listener.eventMessageReceived<br>
On Error Resume Next<br>
Dim msg As xAPMessage = msgEvent.Message<br>
Dim hdr As xAPHeaderBase = msg.Header<br>
Dim body As xAPMessageBody = msg.Body<br>
Dim strhdr As String<br>
Dim strbdy As String<br>
Dim strmsg As String<br>
<br>
strhdr = (String.Format(&quot;Received {0} from {1}, UID {2}&quot;,
hdr.Class,
hdr.Source, hdr.UID))<br>
If InStr(strhdr, &quot;Message.Display&quot;) Then<br>
For Each block As xAPMessageBlock In body<br>
Message1 = &quot;&quot;<br>
strbdy = (String.Format(&quot;Block: {0}&quot;,
block.Name))<br>
<br>
For Each parameter As String In block.Keys<br>
<br>
Dim v As xAPPairValue = block(parameter)<br>
<br>
strmsg = (String.Format(&quot;{0} = {1}&quot;, parameter,
v.Value))<br>
Message1 = Message1 &amp; v.Value &amp; vbCr<br>
Next<br>
<br>
Next<br>
End If<br>
End Sub<br>
<br>
End Module<br>
####################################################################<br>
<br>
I have the reference set to the xFx.dll. I have searched google for an
answer
as to why. <br>
I believe I need to do a
&lt;DllImport(&quot;xFx.dll&quot;)&gt;? 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?<br>
...JJG<o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

<div>

<p class=MsoNormal><span
style='color:white'><o:p></o:p></span></p>

</div>

</div>

</div>





<!-- **begin egp html banner** -->

<br>


<br>

<!-- **end egp html banner** -->


<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- **begin egp html banner** -->

<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9629476/grpspId=1705007709/msgId=1960/stime=1238001822";
width="1" height="1"> <br>

<!-- **end egp html banner** -->


<!-- **begin egp html banner** -->

<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xAP_developer/join;_ylc=X3oDMTJmajJwbjFlBF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyMzgwMDE4MjI-";>Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xAP_developer-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a>  <a
href = "mailto:xAP_developer-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xAP_developer;_ylc=X3oDMTJkdDQ3bjV2BF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjM4MDAxODIy";>
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/";>
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xAP_developer-unsubscribe@xxxxxxx?subject=Unsubscribe";>
Unsubscribe
</a>
<br>
</div>
<br>

<!-- **end egp html banner** -->


<div style="color: white; clear:
both;"/>__,_._,___</div>
</body>

</html>

------=_NextPart_000_0079_01C9AD54.7275F140--


xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.