I am trying to apply the example described in Paul Lefebvre blog post
http://www.xojo.com/blog/en/2014/01/accessing-net-code-from-xojo.php
I am using Visual Studio 2013, and encountering difficulties. I was able to start a new C## class as described, and rename the file to XojoTest.cs. Now I have trouble with VS no recognizing some of the code.
The default using created by VS are as follow :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
I added as instructed (System is part of the default) :
using System.Windows.Forms;
using System.Runtime.InteropServices;
VS complains that :
Error 1 The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\\users\\michel\\documents\\visual studio 2013\\Projects\\XojoTest\\XojoTest\\XojoTest.cs 6 22 XojoTest
Then I paste the code as described, and I get another error :
Error 2 The name 'MessageBox' does not exist in the current context c:\\users\\michel\\documents\\visual studio 2013\\Projects\\XojoTest\\XojoTest\\XojoTest.cs 25 13 XojoTest
To go on with this and see how it goes on the Xojo side, I simply commented out the offending lines, and followed the instructions to make the build for x86 and Register for Interop. After which I built the DLL fine.
In the new Xojo project I was able to locate and add the Xojo Test reference fine. I placed the example code in a button and tried to run, then I got
There is no class by this name
Dim o As New XojoTest.InterfaceImplementation
Which I believe is the reason why there is no item by that name in the next line.
As you see, I am completely stuck. Ultimately, my goal is to be able to build a DLL that returns a string, but if this very simple example does not work, I am very far to get anything done.
I will very much appreciate any help.
Thank you in advance.