[Migrated content. Thread originally posted on 28 March 2011]
After a couple of weeks of trying to make Net Express process COM correctly I am wondering if anyone is actually using this software from Micro Focus.I have 2 clients who are considering MF NE and have asked me to evaluate it. So far it isn't looking good.
Imagine the simplest COM application possible. An In Process COM server with say, 1 Method, that takes 1 parameter, NO GUI interface or Presentation Layer, and NO public properties.
Under the "COMSERVER" Examples provided with the software is a DLL directory which gives a project file to build a very simple COM server which does a Loan Application. It builds and produces a COM server. The COM server registers with the system. (Interestingly for people who are familiar with COM servers, it doesn't build a Typelib but that isn't essential so we should be all right.)
Now go to the OC directory and build the Client app which calls our newly created server. It builds OK but when you run it, it fails saying it cannot bind to the server.
Set up a new OO CLASS project and specify it to be a COM server.
NE generates the base source code and some ancillaries like a Trigger (which is completely new to me and I've been dealing with COM for years - apparently it is needed to load the COM server .DLL; CreateObject does that for most people), a typelib and a registration file (which you don't need because regsvr32 does the job perfectly adequately...) Modify the source to include the single method with the single parameter, noted above.
Build it and register it. All good. (There is a single .DLL produced so I guess it has incorporated the "trigger" into that?) It is a bit of a worry that if you look at it with an Object Browser (OLEview) it appears to have no application Methods but we can find out whether this is problematic by testing it.
Of course, you CAN'T test it because it is a .DLL and the IDE doesn't generate a sample harness or testbed for you, but that's OK; it is a matter of minutes to knock one up.
Step through the harness. The "new" Method executes and the server is instantiated.
Now our single Method with the single parameter... It crashes saying the Parameter cannot be found (0x80020004).
I tried giving it a non-existent method name and it crashed correctly saying it couldn't find the method. (So the object returned is aware of the application methods, maybe just not aware of their signatures...) I tried every variation of USING and RETURNING (and both of them together, which I thought was illegal in COBOL, but it compiled successfully), returning the same HCODE every time. I most carefully checked the source code method signature in the server and the actual parameter being passed in the Client and they are correct. (It is a single COBOL string PIC X(8192) which should be easily converted to VT-BSTRING under the covers.)
So far MFNE is accumulating demerit points on the following:
1. Inadequate documentation and background. Why isn't there a simple document that explains the approach to COM? including:
Why trigger files are needed?
Why I can only use .CBL as a source extension for COM? (I might be able to address this with the OSEXT directive; been too busy to try...)
Why typelibs are compiled into separate resource files but there is no compiler directive to let me force ODL generation from a command line so I could do it later?
Why I can ONLY build a COM component from a PROJECT (One client has hundreds of these which we need to batch compile - a separate post here elicited NO response so I have to conclude either no one knows or no one cares, which makes me wonder if anyone is actually using OO COBOL and COM from MF...Hence this post.)
2. Why isn't there a simple example of a COM server running IN Process, that actually works?
I am striving to see that this software gets a fair evaluation and I accept that it is new to me, but I have spent many hours going through the documentation provided and I simply can't make this stuff work.
For standard procedural COBOL, the system has scored well (although runtimes and Licensing could still be a show stopper - we'll consider that separately after we are satisifed the software meets our needs, and will balance it against other options and products), but for COM (which is essential for the component based systems these clients have) it is currently batting zero.
I would really appreciate it if anyone can shed light on the problems described or can state they are doing this without problem.
I'll happily send a sample source for the In Process server to anyone who thinks they can make it work.
(Maybe they could return the .DLL and the settings they used...)
Cheers,
Pion.

