home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************/
- /* SAMPLE PROGRAM 04: SAMP04A.C */
- /* */
- /* COPYRIGHT: */
- /* ---------- */
- /* Copyright (C) International Business Machines Corp., 1991,1992. */
- /* */
- /* DISCLAIMER OF WARRANTIES: */
- /* ------------------------- */
- /* The following [enclosed] code is sample code created by IBM */
- /* Corporation. This sample code is not part of any standard IBM product */
- /* and is provided to you solely for the purpose of assisting you in the */
- /* development of your applications. The code is provided "AS IS", */
- /* without warranty of any kind. IBM shall not be liable for any damages */
- /* arising out of your use of the sample code, even if they have been */
- /* advised of the possibility of such damages. */
- /* */
- /******************************************************************************/
-
- /*
- * The 16-bit routines. These are put into a DLL which is bound to the 32-bit
- * EXE at load time.
- */
-
- #include "sample04.h"
-
- /*
- * Set the global variable foo1 to point at the first string.
- */
-
- void plugh1( void ) {
- foo1 = "And did those feet in ancient time";
- return;
- }
-
- /*
- * Take a pointer to a pointer as an address, and point that pointer at the
- * second string.
- */
-
- void _pascal plugh2( char ** ptr ) {
- *ptr = "Walk upon England's mountains green.";
- return;
- }
-
- /*
- * Print the third string by calling a 32-bit routine which has a 16-bit
- * entry sequence. We get the address of this routine passed in as a function
- * pointer. We have to make the call to the 32-bit routine indirectly
- * becuase it is not currently possible to call 32-bit routines directly.
- */
-
- void _cdecl plugh3( void (* _pascal fn)( void ) ) {
- fn();
- return;
- }