File: Globals.html

package info (click to toggle)
polyml 5.6-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 31,892 kB
  • ctags: 34,453
  • sloc: cpp: 44,983; ansic: 24,520; asm: 14,850; sh: 11,730; makefile: 551; exp: 484; python: 253; awk: 91; sed: 9
file content (59 lines) | stat: -rw-r--r-- 2,206 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Windows Interface Reference: Globals structure</title>
</head>

<body>

<h1>Globals </h1>

<p>The Globals structure contains various functions to operate on handles, functions to
obtain handles to the Poly/ML application and window and a function to get error
information. </p>

<pre>structure Globals :
  sig
    type 'a <a href="#Handles">HANDLE</a>
    type HINSTANCE
    type HWND
    val <a
href="#Handles">hNull</a> : 'a HANDLE
    val <a href="#Handles">handleOfInt</a> : int -&gt; 'a HANDLE
    val <a
href="#Handles">intOfHandle</a> : 'a HANDLE -&gt; int
    val <a href="#Handles">isHNull</a> : 'a HANDLE -&gt; bool

    val <a
href="#ApplicationInstance">ApplicationInstance</a> : unit -&gt; HINSTANCE
    val <a
href="#GetLastError">GetLastError</a> : unit -&gt; OS.syserror
    val <a
href="#MainWindow">MainWindow</a> : unit -&gt; HWND
  end</pre>

<p><tt><a name="Handles"></a>type 'a HANDLE<br>
hNull : 'a HANDLE<br>
handleOfInt(i): 'a HANDLE<br>
intOfHandle(h): int<br>
isHNull(h): bool</tt><br>
<strong>ML Extension:</strong> All handles, such as HWND and HBITMAP, are instances of the
'a HANDLE type. Generally the Windows functions which can take NULL as a valid argument or
return NULL as a valid result take option types.&nbsp; Occasionally it may be necessary to
pass NULL in other circumstances in which case hNull can be used in ML.&nbsp; There are
also a few occasions where a handle has to be cast to or from int.&nbsp; handleOfInt and
intOfHandle can be used for this.</p>

<p><tt><a name="ApplicationInstance">ApplicationInstance</a>(): HINSTANCE</tt><br>
<strong>ML Extension: </strong>Returns the application instance handle passed in to the
WinMain function when Poly/ML was started.</p>

<p><tt><a name="MainWindow">MainWindow</a>(): HWND</tt><br>
<strong>ML Extension: </strong>Returns the handle to the Poly/ML window.</p>

<p><tt><a name="GetLastError">GetLastErro</a>r(): OS.syserror</tt><br>
Returns the error code for the last function call.&nbsp; Generally when a function fails
an exception is raised including the last error as part of the exception packet.</p>
</body>
</html>