georeference.org
Subscribe to this thread
Home - Scripting / All posts - Add-In Script
joebocop
217 post(s)
#17-May-11 00:51

Just in need of some clarification here maybe.

I wrote a script (VB.NET) in a Manifold Map project which imports System.Windows.Forms, and which uses a SaveFileDialog, as well as other classes therefrom (I hope that's a word).

I have now saved that script to a text file, and I've created an XML document pointing to it in the Config folder. My intention is to share this add-in with every Manifold user in my organization.

Ok, you know what I'm getting at here. When I try to run the add-in from within Manifold, I get:

Namespace or type specified in the Imports 'System.Windows.Forms' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. BC40056

First, is it possible to do what I'm hoping to do here, or am I not allowed to make this type of reference in an add-in?

Thanks for the advice.

joe

joebocop
217 post(s)
#17-May-11 01:07

I subsequently added a "reference" line to the XML document:

<reference>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll</reference>

Now I get the error depicted in the attached image.

Thank ya.

Joe

Attachments:
load_dll.png

KlausDE

5,621 post(s)
#17-May-11 07:16

Tags form, path and icon in the xml of an Add-In all are relative to the config/ folder. You could try to configure 'Configuation' to a network drive in Options -> Filel Locations

joebocop
217 post(s)
#17-May-11 19:10

Ok, I seem to be making a sort of progress. I now no longer get the error message about not being able to open the assembly dll, but rather another message which seems to indicate there's a problem with my code.

I have copied and pasted the script code directly from the working script located in a Manifold map project, so I am reasonably certain this isn't a syntax thing.

Anyone else seen this?

This is my first add-in, so there's a chance I've done something else fundamentally wrong. I was able to follow the simple instructions in the help file to create the "Hello World" add-in using vbscript, but have yet to get one working with VB.NET. I've also attached my add-in's XML file, and the script itself.

Thanks in advance for any help you can offer to get me straightened out here.

Manifold Universal x64 8.0.24

.Net Framework 4.0 and 3.5 both installed on this machine.

Windows 7 Professional x64.

Thanks!

Joe

Attachments:
exception.png
export_wpt.xml
MakeWPT.txt

joebocop
217 post(s)
#17-May-11 19:18

I'll let the post stand because it's got the script attached (useful to somebody else, someday, maybe?), but let it be known: I had just mishandled the case of "no window" in my script. All works fine now.

Thanks.

Joe

mikedufty

721 post(s)
#11-May-12 03:35

Dredging up an old thread, but I'm trying to see if I can get a script working to export drawings to gpx, which is pretty similar to this script.

Is the one above your final working one? I get an error when trying to test it.

mikedufty

721 post(s)
#11-May-12 05:02

Ah, It is working now, thanks, I think it was just looking for a table column I don't have.

Will post my results in the gpx import thread.

Manifold User Community Use Agreement Copyright (C) 2007-2011 Manifold Software Limited. All rights reserved.