Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

dynamically loading a winform based on a string

$
0
0

The issue.

I have a c# application that does the following: reads an xml file with menu tree items, gets the user and groups from AD then using that information builds the menu tree. Each of the menu tree leaves are visual cobol programs that the user can run.

Currently I have a switch statement looking at the name of the node and opening the appropriate winform (visual cobol). I would like to use reflection by having the visual cobol class name in the xml file. That way when I add a new program, I can update the xml file and upload the cobol program without needing to recompile the c sharp application.

I've tried using:

Activator.CreateInstance which gives me a "could not load type ***** from assembly *******"

 Assembly.GetExecutingAssembly().CreateInstance which throws "object reference not set to as instance of an object"

Any one have any thoughts? I have not issue just writing a large switch and recompiling whenever a new program is added.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>