LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Packed libraries and class hierarchy issue - error 1448 : Bad Type Cast (with classes)

Hey folks,

 

I'm currently attempting to figure out if (and how) I can utilize packed libraries for a project using LVOOP.  I started out by looking at a demo of the plug in architecture : https://decibel.ni.com/content/docs/DOC-19176

 

I watched and read some ppt's on the idea and thought I was begining to understand the ideas here so I attempted to make a super watered down simple approach to using packed libs...

 

If someone could tell me where I went wrong here' I'd appreciate it, kudos to anyone willing to try and help!

 

I created a project in which I made parent class "jawn", and two child classes "subjawnA" and "subjawnB", all having one method named "Jawn1". (inheritances set in properties)  All this method does is pop up and tell me which method executed.

 

I then built three packed libraries, Jawns.lvlibp, SubJawnA.lvlibp, and SubJawnB.lvlibp.

 

In a new project, I add these packed libraries and I basically used the same code in the example for fetching the packed libraries and their contents.

 

The parent class works just fine when I select it from the pulldown and hit play, but the child classes give me error 1448 saying its a bad cast.

 

One thing I noticed:

 

the parent that works:

http://imgur.com/0uXkeI9

 

child with the error:

http://imgur.com/9hENAzG

 

Thanks again and kudos to anyone willing to help me out here!

 

-pat

 

edit: attaching zip file of project... (LV2013)

 

 

0 Kudos
Message 1 of 2
(2,936 Views)

I haven't looked at your code (I don't have LV2013) but don't forget that a class name changes when it is built into a PPL (eg."jawn.lvclass" turns into "Jawns.lvlibp:jawn.lvclass"). This could break your inheritance hierarchy in your scenario since your child classes are looking for the specific name "jawn.lvclass". If you build your child classes into their own PPLs and include their dependenices (the original jawn.lvclass) then you will end up with a copy (renamed) of this class in that PPL too.

 

PPLs were only ever intended to be stand-alone - linking them together (via classes for example) has always yielded issues that need workflow solutions to work-around.

 

My immediate advice without looking into the code - create your parent class in a seperate project with a seperate build PPL. Then create a new project for your child classes that uses the build PPL from the parent to inherit from.

Message 2 of 2
(2,920 Views)