It certainly doesn't crash when I do that although it doesn't run properly. The problem seems to be that the Poly icon is not available in a stand-alone executable and trying to load it results in a exception that stops the program. I've fixed this in the CVS version.
Which compiler did you use to build PolyML 5.0 on Windows?
Regards, David.
Thanks for your quick response. I used VC6 and VC7.1 to build PolyML on Windows. I can build it with VC8 also, but it seems to me, that I do something wrong: I wrote a simple rc file which included poly.ico, so certainly the LoadIcon is not a problem for me.
I have used the following commands to produce mlEdit.exe.
In PolyML:
PolyML.make "mlsource/extra/Win"; PolyML.use "mlsource/extra/Win/Examples/mlEdit"; PolyML.export ("mlEdit", mlEdit);
At the Windows prompt:
rc mlEdit.rc cl /FemlEdit.exe mlEdit.obj mlEdit.res
PolyMainLib.lib PolyLib.lib libcmt.lib /link /subsystem:windows
What I am doing wrong ?
Thanks, Andr?s P?hi
I took another look at this and discovered that there was a problem when mlEdit was used with a Release (optimised) build of Poly/ML. I'd been testing with the debug build. It was all to do with the way that Windows API calls use Pascal calling conventions (called function removes arguments from the stack) rather than the usual C convention of calling function removing arguments. This is very messy for the foreign function interface code. I've improved it and the CVS version now seems to work properly.
Incidentally, the easiest way I found of linking within VS 6 was to create a new project within the PolyML workspace, add the mlEdit.obj to the project as a source file, set the dependencies of the project to depend on PolyLib and PolyMainLib and add libcmtd.lib and libcmt.lib to the libraries under the Debug and Release configurations. Building the project will do all the linking.
Regards, David