converting a windows api into dolphin code, eg ClipCursor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

converting a windows api into dolphin code, eg ClipCursor

John Trinder
Hi,

This is a continuation of a previous thread but I thought it would be
better to open a new one with an appropriate subject so as to
facilitate look-up referencing in the future.

I wrote previously on asking how to convert a windows api into dolphin
code. One example of this is the api, ClipCursor, which I want to use.
The syntax for C++ is:

BOOL ClipCursor(

    CONST RECT *lpRect // pointer to structure with rectangle  
   );

Blair replied:

Dolphin's typelib analyzer can be used to generate external method
call definitions (i.e. methods of the form you see in KernelLibrary,
UserLibrary, etc, that wrap external function calls), however this
functionality is not exposed through the ActiveX Component Wizard. For
example:
    tlb := AXTypeLibraryAnalyzer open: 'win.tlb'.
    "Enumerate all the modules in the library"
    tlb modules. "Ctrl+D"

    "Pick the User module (a TKindModuleAnalyzer)"
    user := tlb at: 'USER'.

    "Generate functions into the existing UserLibrary wrapper class"
    user globalName: #UserLibrary.

    "Generate the Chord() function"
    user generateMethodWrappers: (user functions select: [:each | each
name
=
'ClipCursor']) first.

It is easier to generate a complete wrapper class for a particular
"module"
(ExternalLibrary) by just sending #generate to the relevant
TKindModuleAnalyzer object, however that is probably not what one
would want
to do in this case since there are literally hundreds of functions,
most of
which one does not need.

This seems to be the right direction to go, but there's one major
problem --
The file win.tlb doesn't exist on my system (Windows XP Pro). I know
this may be simple to resolve but I'm stumped.

Regards, John Trinder


Reply | Threaded
Open this post in threaded view
|

Re: converting a windows api into dolphin code, eg ClipCursor

Bill Schwab-2
John,

> This seems to be the right direction to go, but there's one major
> problem --
> The file win.tlb doesn't exist on my system (Windows XP Pro). I know
> this may be simple to resolve but I'm stumped.

If I'm following you and remembering correctly, then Blair gave instructions
for downloading the type library.  Sorry if I'm missing the point.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: converting a windows api into dolphin code, eg ClipCursor

John Trinder
Hi,

Your correct, Blair did give details, I unfortunately couldn't take
all of what he said in but now it makes sense. Thanks Bill. For
reference purposes, this message follows on from the previous thread's
subject: 'How do I restrict mouse cursor movement area?'

Regards, John