professor_rumsdiegeige Posted February 23, 2008 Report Share Posted February 23, 2008 Hi! After a .NET constructor node, I use the the Invoke Node to call the following function public void TestFunction_LoadImageFile(ref string filepath) { Debug.WriteLine("TestFunction is called - make sure to use it only in debug mode !"); SrcImage = new System.Drawing.Bitmap(filepath); } where SrcImage is of Type System.Drawing.Bitmap. As soon as this invoke node is reached, Labview crashes. If I debug it, I get a stack overflow is mscore lib... Anyone got an idea why? Thank you very much in advance for your help. Quote Link to comment
BryCoBat Posted October 15, 2008 Report Share Posted October 15, 2008 Without knowing the exact values, my best guess is that the problem is with the "ref" part of the function definition. Pull that out so you're passing the string by value instead of by reference. (The definition will be "public void TestFunction_LoadImageFile(string filepath)".) Passing by reference means you're handing .NET a reference to a string, instead of just handing it the actual string. The glue that allows LabVIEW to call .NET code doesn't create .NET instances for LV values, it just creates the value. (At least, to my knowledge...) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.