home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!torn!news.ccs.queensu.ca!slip201.telnet1.QueensU.CA!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Calling DLL Procs via pointer.
- Message-ID: <dmurdoch.246.725079089@mast.queensu.ca>
- Keywords: Pascal DLL Assembly
- Lines: 23
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <1h8diqINN64q@agate.berkeley.edu>
- Distribution: usa
- Date: Wed, 23 Dec 1992 02:51:29 GMT
-
- In article <1h8diqINN64q@agate.berkeley.edu> matte@plutonium.CChem.Berkeley.EDU (Matt Rose) writes:
-
- >Except that the BP manuals tell me there is no provision for making a
- >call to a procedure that I have a pointer to.
-
- I don't think they say that, because there is: procedural variables are
- just pointers to procedures. There are limits on what you can do with them;
- you'll need absolute declarations or Move to convert a pointer to a
- procedural variable rather than typecasts, but it's not really that hard.
-
- For example:
-
- type
- myproc : procedure(i:integer);
- var
- ptr : pointer;
- proc: myproc absolute ptr;
- begin
- ptr := GetProcAddress(...); { get the address }
- proc(i); { call it }
- end.
-
- Duncan Murdoch
-