import functions with alias-names?

Q&A's, tips, howto's
Post Reply
HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

import functions with alias-names?

Post by HPW »

In other enviroments you can mostly specify an alias name for the imported function.

Example:

Code: Select all

(import "user32.dll" "MessageBoxA" "MSB") 
(MSB 0 "This is the body" "Caption" 1) 
Another point where things can get smaller!
Just a thought.

Or is it this?

Code: Select all

(set 'MSB MessageBoxA)
Yes, it is. So make it in the import-call and I can save one command.
Of cource optional!
Hans-Peter

HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

This would be quit nice to do this:

Code: Select all

(context 'iSEDQPDF)
(import "iSEDQuickPDF.DLL" "iSEDNewDocument" "NewDoc")
(context 'MAIN)
Then I could use:

Code: Select all

(iSEDQPDF:NewDoc)
Hans-Peter

Lutz
Posts: 5282
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

try this:

(set 'Win:Clock (import "kernel32.dll" "GetTickCount"))

(Win:Clock) => 1312656

You don't need to do (context 'Win) at first. The 'set' statement with a context creates the context automatically.

Lutz

Post Reply