Home > Java, OCaml, Windows > Making Win32 GUI programs in OCaml, continued #3. Unsorted thoughts

Making Win32 GUI programs in OCaml, continued #3. Unsorted thoughts

WordPress shows me report about my blog, and I can see some people come to my blog by making search requests such as “OCaml MFC”. It seems that MFC is most known class library for Windows. Maybe it’s not bad at all. I know it was created at time then C++ was not mature, that’s why MFC contains so many hacks and looks ugly. It also suffers from bad documentation, but it has lots of dedicated books, so it is counted as very well supported. Some people prefer other libraries for C++, such as Qt, wxWidgets, OWL, Ultimate++, SmartWin++. Those libraries are less known and have different focuses, such as open license, productivity, simplicity, cross-platform support. But, as I already stated several times, making OCaml wrapper around some other class library is not an approach I whould take.

One examle of OO widget library for Win32 is a SWT from Eclipse. I now wonder how is it made. I should take my time and investigate.

Thinking about separate compilation. I belive that only reason why this feature is in place is to speed up compilation by compiling only changed files. First users manually specified which files to compile, later tools like make become doing that job.

I’ve also compared Java run-time linking process with loading shared library in C/C++. Java has two ways of loading classes: implicitly, when some class is referenced from another class, and explicitly, by using “Class” class. First approach is simple, second approach gives excellent flexibility such as “plug-ins” and, combined with some ClassLoader magic, allows even using several versions of same library simulteneously. Shared libraries also have these two approaches. Implicit loading of shared library for Windows is very well described here. Dynamic approach for Windows means usage of LoadLibrary()/GetProcAddress()/FreeLibrary() functions.

OCaml has dynamic linking, but only in byte-code mode. It seems that even ocaml-win32 doesn’t support LoadLibrary()/GetProcAddress()

Advertisements
Categories: Java, OCaml, Windows
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: