CLR Assembly Create/Test Sample

Started by stanl, November 18, 2013, 06:12:13 AM

Previous topic - Next topic

stanl

Put together a zip file with VB code, ini file  and script which should create EURO.dll then return a pounds to Euro conversion based on calling a function from the dll.
Original code to create the assembly from Deana, calling code from Tony [credited in header]. This is a sample based on two previous threads.

Deana

Deana F.
Technical Support
Wilson WindowWare Inc.

td

Removing the parameter type specification from a function parameter isn't the best programming style but it obvoiusly does keep you from having to specifiy a type in WinBatch.  Since we are creating an assembly in the context of WinBatch, it makes some sense to take that approach. 

Which you chose depend on your priorities.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

It would probably be better to not mention this but in the interest of complete accuracy...  You don't need to use the 'namespace' keyword in you vb.net assembly  and WinBatch may still be able to access your class by using oTest = ObjectClrNew("Euro")

However, eliminating the namespace keyword to avoid having to type a few letters is a very bad idea. It makes dependent scripts very brittle because of the potential for type name collisions.   
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl


td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: Deana on November 18, 2013, 07:58:20 AM
Stan,
Thanks for sharing.
Using an .ini was to expedite; would have looked better with a dialog. Surprised how little WB code it actually took and it appears re-usable.  Now that my feet are wet I can set about trying to incorporate some VB net for SQL Server.