February 2007

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28      
Blog powered by TypePad

« Vista is Out-a-here! | Main | Vista Security »

Turning a VI into a Function Pointer

As you know, if you do any .NET programming in LabVIEW, you can turn a LabVIEW VI into a callback handler for a .NET event. But what if you need to supply a VI to a C function that needs a function pointer? That isn't a .NET event - it's got nothing to do with .NET...how do you create such a function pointer? Well, you could build the VI into a DLL, write some C code to convert the exported VI's C function into a pointer, call that from LabVIEW, pass that into...I'll stop there. You get the idea - it isn't trivial.

Well, vanDooren, an MVP for Visual C++, has come up with a very clever solution to the problem. Best of all (from my opinion, of course), is that it uses .NET to do it. See, .NET even can solve an interop issue between LabVIEW and C! Let's see Java to that one *laugh*.

Rather than explain the solution myself, I'll let you read it here on vanDooren's blog - after all, he's gone through the trouble of writing it up and providing screenshots, downloads and everything. As he says, writing the post is often longer than the coding. Linking to a post is an even faster solution.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/170720/6862313

Listed below are links to weblogs that reference Turning a VI into a Function Pointer:

Comments

Post a comment

If you have a TypeKey or TypePad account, please Sign In