home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7644 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.2 KB  |  37 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!torn!news.ccs.queensu.ca!slip201.telnet1.QueensU.CA!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: Calling DLL Procs via pointer.
  5. Message-ID: <dmurdoch.246.725079089@mast.queensu.ca>
  6. Keywords: Pascal DLL Assembly
  7. Lines: 23
  8. Sender: news@knot.ccs.queensu.ca (Netnews control)
  9. Organization: Queen's University
  10. References: <1h8diqINN64q@agate.berkeley.edu>
  11. Distribution: usa
  12. Date: Wed, 23 Dec 1992 02:51:29 GMT
  13.  
  14. In article <1h8diqINN64q@agate.berkeley.edu> matte@plutonium.CChem.Berkeley.EDU (Matt Rose) writes:
  15.  
  16. >Except that the BP manuals tell me there is no provision for making a
  17. >call to a procedure that I have a pointer to.  
  18.  
  19. I don't think they say that, because there is:  procedural variables are 
  20. just pointers to procedures.  There are limits on what you can do with them; 
  21. you'll need absolute declarations or Move to convert a pointer to a 
  22. procedural variable rather than typecasts, but it's not really that hard.
  23.  
  24. For example:
  25.  
  26.   type
  27.     myproc : procedure(i:integer);
  28.   var
  29.     ptr : pointer;
  30.     proc: myproc absolute ptr;
  31.   begin
  32.     ptr := GetProcAddress(...);  { get the address }
  33.     proc(i);             { call it }
  34.   end.
  35.  
  36. Duncan Murdoch
  37.