06-24-2009 02:50 AM
I have a .NET application in which in try to determine the VI contained in a llb file. This is the code:
LabVIEW.Application lv = new LabVIEW.ApplicationClass();
LabVIEW.Library lib = lv.OpenLibrary(@"C:\Program Files\National Instruments\LabVIEW 8.5\examples\general\strings.llb");
I'm getting the error: LabVIEW: Memory or data structure corrupt.
I know the LabVIEW.Application reference is correct because loading and running normal VIs works fine.
What could be the problem?
Solved! Go to Solution.
06-24-2009 03:06 AM
Hi there
LV documentation of "OpenLibrary" states:
"Opens the LabVIEW project library"
I don't think you need an object for llbs, because they are treated as directories.
06-24-2009 03:19 AM
06-24-2009 03:29 AM
Hmm, in case the llb is part of a project then open the project with OpenLibrary and then use the ProjectItem.Children Property to get a list of all sub items (= VIs in this case).
06-24-2009 03:46 AM
When I use OpenLibrary to open the llb file, I get the 'LabVIEW: Memory or data structure corrupt' error.
LabVIEW.Application lv = new LabVIEW.ApplicationClass();
LabVIEW.Library lib = lv.OpenLibrary(@"C:\Program Files\National Instruments\LabVIEW 8.5\examples\general\strings.llb");
The llb file is not corrupt because I can open it in LabVIEW. I have this error message with every llb file.
06-24-2009 03:57 AM
Like already mentioned before: The purpose of OpenLibrary is to open a project, NOT LLBs! And because every LLB is NOT a project, you get the error with each LLB.
06-24-2009 04:19 AM
OK, now I see...
OpenLibrary is for lvlib files.
OpenProject is for lvproj files.
So there is no way to open a llb file using the COM interface?
06-24-2009 04:25 AM
"So there is no way to open a llb file using the COM interface?"
See my post from 06-24-2009 03:29 AM.
Or create a LV dll that calls "List directory" and returns the list of VIs. Bind that dll tou your app.
08-06-2010 05:48 AM - edited 08-06-2010 05:49 AM
Hi,
I have a similar problem trying to open a project from a .NET application. The codes look like below:
LabVIEW.ApplicationClass lv = new LabVIEW.ApplicationClass();
LabVIEW.Project m_proj = lv.OpenProject("C:\\Projects\\LV_Example\\lv_project1.lvproj");
I am getting the error: LabVIEW: Memory or data structure corrupt. I face to the same error trying to open a library (.lvlib) using openLibrary() function. What can be the reason?
Cheers,
Pari sa