G#

cancel
Showing results for 
Search instead for 
Did you mean: 

G# GenericCreate.Vi gives error of 400043, but NOT when you call the G#Object_create.vi (specific)

Solved!
Go to solution

Hello everyone,

 

I am having problem implementing Dependency injection with G# generic Create function. I have ObjA and ObjB. A is a parent class of B. I create objC and objD (all objs under G# framework, not related to previous objects, except through G# ofcourse)) and i encapsulate C & D in ObjA and ObjB. So for example i take objA, when I put objC_create.vi and objD_create.vi inside ObjA_create.vi, and run the G# generic Create to call ObjA, i get this error of 4000043. However, when i run the ObjA_create.vi itself, without using the G# generic Create, It runs completely fine. 

 

Here are the two cases.

[case 1]: Use G# Generic Create: Provided Error 400043

 

[case2] Use ObjA_create.vi: works with no errors.

 

[NOTE] I noticed the error only started to happen when I started to add in ObjC and ObjD_create.vi inside ObjA_create.vi. Once i remove objC_create.vi and objD_create.vi, and run ObjA_create.vi,  i don't have any error.....

 

I would really like to use the dependency injection method so that i can switch between objA and objB within my MAIN program. It's hard to share example code for this situation so i hope these snippets can explain my situation. NEED HELP! Thanks in advance!

 

[ps: I added a labview project, "DependencyInjection.zip", to demonstrate what I just explained].

 

Download All
0 Kudos
Message 1 of 4
(1,674 Views)
Solution
Accepted by topic author villanul

You need to run G#Object.lvclass:G#Object_StartExternalCreateProcess.vi at the start of your application for case 1 to work.

 

There is a hint in the error message "Does a process really reply to the "External create object" event?", but I think the message could point out more specifically to check if the external create process VI is started.

Certified LabVIEW Architect
Message 2 of 4
(1,631 Views)

Thank you very much! This indeed fixed the problem. It would be nice if the examples of G# included this implementation as an example, (or maybe i didnt see it). I traced the event loop structure that output this error, but i was unsure how to start an external process.

 

cheers,

0 Kudos
Message 3 of 4
(1,619 Views)

@villanul wrote:

Thank you very much! This indeed fixed the problem. It would be nice if the examples of G# included this implementation as an example, (or maybe i didnt see it). I traced the event loop structure that output this error, but i was unsure how to start an external process.

 

cheers,


There is a 'short' named example: G# - DependencyInjectionUsingExternalCreateProcessWithDefaultConstructor.vi

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(1,612 Views)