It’s also possible to call .NET methods from Clarion directly, without COM. You just need to create unmanaged exports of .NET methods you want to use from Clarion.
Next, using WinApi you need to load the DLL dynamically (instead of creating LIB, as described here), get the address of the method and finally call it in Clarion. WinApi functions: LoadLibraryA, GetProcAddress and eventually FreeLibrary.
For these dynamically loading and call of methods you will need to use some trick in Clarion. You must declare a prototype of the method (like for WinApi functions) and a variable of type LONG with an external name exactly the same as the method’s label declared in Clarion (this label in Clarion does not have to be the same as the method name in .NET). The variable will hold the address of the method read using the GetProcAddress function.
then, using WinApi you have to load your .NET DLL and set the address of the method to this variable AddressOfMyMethod and as the last step you can call your method from Clarion like this: MyNetMethod().
This way you can return a value from the .NET method, use output parameters or even open a window created in .NET.
We can utilize windows created in .NET (WPF) injected into empty Clarion windows - thanks to this, .NET windows behave identically to other windows created in Clarion. We use this solution successfully on production in a large, multi dll, MDI application, but this is a bit too complicated and also requires using some advanced techniques in .NET to describe the details here.