Embedded Form Launch  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Embedded Form Launch

Postby SBarnes » Sun Apr 18, 2021 9:20 am

I have a situation where I need to embed a form in a class library to protect the code for security reasons to do with access to an external system but I then want launch the form from the menu system.

I realize I can register the form from the DLL instead of a standard plugin but would prefer to do this from a plugin so that it makes deployment easier is there a way to do this as when I tried Jiwa reported an error about not finding the form in the assembly which given the name was a guid, this I would assume is the assembly for the plugin?

I've tried making sure the embedded assembly was loaded to see if that helped but it made no difference.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Embedded Form Launch  Topic is solved

Postby Mike.Sheen » Sun Apr 18, 2021 2:38 pm

When you launch a form (the FormFactory creates it), we look in the SY_forms table - if it's FormType is 1, then we use the AssemblyFullName to load the assembly and then create an instance of the ClassName.

When the FormType is 2, we treat the AssemblyFullName as the Plugin.RecID - so we find in the loaded plugins the plugin matching the RecID and then create an instance of the ClassName from it's assembly.

We don't support an embedded assembly reference containing the form.

You might be able to fool the system by having the FormType as 1 in SY_Forms and setting the AssemblyFullName being the assembly full name of your embedded reference ("MyEmbeddedReference, Version=1.0, Culture=neutral, PublicKeyToken=null" or whatever) - the AssemblyResolver might need to be handled, however - so that it can be directed to the right folder to find the assembly. We have a RuntimeFolder property of the plugin, so that's how you know which folder to find the embedded reference assembly.

My gut feeling is you probably could make it work, but I can't say for sure without trying it myself.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests