-2

I have tried dllimport and extern command without any success. Searched the net for some examples, which just added more to my confusion :-). Any hints? Thanks in advance.

Here is what I have tried:

Static void Main (string[] args)
{
CallLVSharedVar
}

[DllImport(@"SharedLibtoCSharp.dll")]
private extern static void CallLVSharedVar([MarshalAS(UnmanagedType.
Globalhawk
  • 148
  • 2
  • 8
  • You need to use P/Invoke. Show us what you've tried and what the problem is and we might be able to help. – Nick Mar 16 '12 at 09:48
  • @Nick Thanks for your reply. Here is what I have tried:Static void Main (string[] args) { CallLVSharedVar } [DllImport(@"SharedLibtoCSharp.dll")] private extern static void CallLVSharedVar([MarshalAS(UnmanagedType. – Globalhawk Mar 16 '12 at 10:18
  • Why don't you edit your question to include this information rather than putting it in a comment. – Nick Mar 16 '12 at 10:27
  • @Nick You are right. New guy here. ^_^ – Globalhawk Mar 16 '12 at 10:57
  • It doesn't look that code would compile... What other issues are you having? Do you have the declaration of the function you're looking to import? – Nick Mar 16 '12 at 11:34
  • yes, i do have declaration issues as well ;) – Globalhawk Mar 16 '12 at 12:05
  • I'm trying to help here but you're not making it very easy! In order to help I'll need to see the declaration of the function you're trying to import. – Nick Mar 16 '12 at 14:08
  • 1
    Just insert the entire code you are using for declaration and calling/invoking the dll and we'll be able to help you. – Jontatas Mar 21 '12 at 10:42

1 Answers1

0

LabVIEW also has the ability to create .NET assemblies, so if you have the VI source code, you could do that instead... http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/building_a_net_assembly/

J J
  • 1,550
  • 4
  • 17
  • 27