Windows Interface (mgldll.c Library)
The mgldll.c library contains several useful
functions for constructing the interface for a
Windows application. The file is found on the
LogiCad3D CD-ROM under the directory
\win95nt\source\mgldrv\ . The following
sections describe the functions available in this
library.
MagellanInit
This function checks for a running Magellan/
SPACE MOUSE driver and initializes the
interface. It must be the first Magellan/SPACE
MOUSE function to be called.
HMAGELLAN MagellanInit (
Syntax:
/* [in] */ HWND ApplicationWindow );
Application
Handle to the application window.
Window
Normally, this input parameter is a
variable initialized by the Win32 function
InitClassWindow().
If the function succeeds, the return value
Result:
is a Magellan handle. If not, it returns the
value NULL.
File:
mgldll.h
MagellanSetWindow
This function sets the window handle (stored
in ApplicationWindow ) into the Magellan driver
as the current application window. All
messages generated by the Magellan driver
are now sent to the given window. Note that
this function has an operation similar to the
command MagellanSetWindowCommand in the
MagellanInfoWindow
function
Syntax:
int MagellanSetWindow (
/* [in] */ HMAGELLAN MagellanHandle,
/* [in] */ HWND ApplicationWindow );
Magellan
Magellan handle. Normally, this
Handle
parameter is a variable initialized by the
function MagellanInit .
Application
Handle to the application window.
Window
Result:
If the function succeeds, it returns the
value TRUE. If not, it returns the value
FALSE.
File:
mgldll.h
MagellanTranslateEvent
This function identifies and decodes incoming
event messages from the Magellan/SPACE
MOUSE driver and stores the resulting
information into the data structure pointed by
MagellanEvent . The Magellan driver sends a
message to the application window handler if
.
15
one of three different types of events occurs:
MotionEvent , ButtonPressEvent or
ButtonReleaseEvent .
int MagellanTranslateEvent (
Syntax:
/* [in] */ HMAGELLAN MagellanHandle,
/* [in] */ LPMSG Message,
/* [out] */ MagellanIntegerEvent
*MagellanEvent );
Magellan
Magellan handle. Normally, this
Handle
parameter is a variable initialized by the
function MagellanInit .
Message
Points to a standard Win32 MSG structure
with the raw data as sent by the driver.
Magellan
This output variables stores the decoded
Event
information in a structure of type
MagellanIntegerEvent , defined in the file
mgldll.h as follows:
struct _MagellanIntegerEvent_ {
HWND MagellanWindow;
int MagellanType;
int MagellanButton;
int MagellanData[6];
int MagellanPeriod;
};
typedef struct _MagellanIntegerEvent_
MagellanIntegerEvent;
Magellan
The handle to the window of the
Window
Magellan/SPACE MOUSE driver.
MagellanType The event type. Can have one of the
values MotionEvent , ButtonPressEvent or
ButtonReleaseEvent , as defined in
mgldll.h .
Magellan
Stores the number (1 to 12) of the button
Button
which was pressed or released.
MagellanData
An integer array with six elements,
defined as follows:
Index
0
1
2
3
4
5
Magellan
Holds the time period of the data packet
Period
sent by the device (in milliseconds).
Normally, this value is set to 60 ms.
If the message parsed by the function
Result:
corresponds to an event sent by the
Magellan driver, the function returns the
same value as stored in the MagellanType
element of MagellanEvent . If not, it
returns the value FALSE.
File:
mgldll.h
MagellanClose
This function closes the interface to the
Magellan driver and must be last Magellan
function called by the application.
Axis
X
Y
Z
A
B
C
Need help?
Do you have a question about the Magellan/SPACE MOUSE Classic and is the answer not in the manual?
Questions and answers