06-09-2011 07:14 AM
Hi there,
I've build a C# assembly (Version 3.5) under Visual C# 2010 Express which works well with a test project under VC# 2010,
but crashes (see attachment) when called with the same parameters from LV 8.6.
The application uses MathNet.
What do I have to change ?
Best regards,
Ted
06-09-2011 07:26 AM
Are you making any private calls inside the DLL? It seems that you are using System.Reflection in your C# code, and this error is more related to the DLL parameters being passed or its execution.
Post the DLL details if possible.
06-09-2011 07:38 AM
Hi Fragger Fox,
this is the entire using-section of the assembly:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathNet.Numerics.LinearAlgebra.Single;
using System.Numerics;
The C# test class has the following directives:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using NearestNeighbour; //assembly above
Best regards,
Ted
06-10-2011 12:34 AM - edited 06-10-2011 12:36 AM
Ted,
Have you checked with the parameters you are passing to the DLL? When using CLFN, you have number of options to pass data, some of them are:
Instance Data Pointer
ActiveX
Adapt to type etc
Also, you need to check the way you "pass" the data, it can be "by value" or "pointer to value"
Also, check for calling conventions, it should be "C" in this case
(Just for your information, LV2010 doesn't automatically correct the calling convention, so this might cause a problem if calling convention is not correct
LV8.6 however doesn't have this problem)
06-10-2011 02:32 AM
Dear Fragger Fox,
I'm creating assemblies rather than dlls in C#. The assemblies are called through the .NET property nodes,
so the calling convention is dictated by the C# code, not by LV.
The mechanism of calling assemblies from LV _in_ _general_ works fine!
The problem only comes when the assembly itself calls functions from
MathNet.Numerics.LinearAlgebra.Single
and only if the assembly if called from LV (Version 8.6). MathNet is an opensource library not shipped with Visual C# 2010 Express. In can be found here:
So the problem is to correctly including the responsible MathNet assemblies and/or mscorlibs and/or other (right version, right place). This is I think the place where to look at.
Best regards,
Ted