Windows DLL with C++ interface
Jan van der Vorst
jvdvorst at iae.nl
Wed Feb 12 23:41:54 CET 2003
Denys Duchier wrote:
> jvdvorst at iae.nl (Jan van der Vorst) writes:
>
> > E.g. a function like the following 'hello' will print the warning in
> > the emulator-window but will not show a message box. Oz will just
> > stop responding.
>
> You have to keep in mind that Oz threads are not system threads. The
> Oz thread support is very lightweight and implemented by the Oz
> engine. All Oz threads are run by the Oz emulator (i.e. the main
> _system_ thread of the process). They are scheduled fairly (when
> running pure Oz code) and preemptively. Thus, all primitives (native
> extensions - as your example below) are invoked synchronously on the
> main system thread.
>
> > OZ_BI_define(BIhello,0,0)
> > {
> > OZ_warning("Creating message box");
> > MessageBox(NULL, "Hello World!", "Hello Jan!", MB_OK);
> > return OZ_ENTAILED;
> > } OZ_BI_end
>
> Whenever this primitive is invoked, the entire system will block until
> MessageBox returns.
Yes, this is what I would have expected. But the problem is that
MessageBox does not return at all. The messagebox doesn't even show up.
MessageBox is a win32 call to the user32.dll that should show a message
with an OK-button. It is the win32 'Hello World' version, the most simple
program that exists, and yet somehow I can't get it working when called
from Oz
I have the feeling here that somehow there is something wrong with loading
a DLL from a C++ extension DLL.
By the way, I compile under cygwin on WINNT with gcc 3.2 (although 2.95
has the same behaviour).
best regards, Jan
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
Please send bug reports to bugs at mozart-oz.org.
More information about the mozart-users
mailing list