mklcl32.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 47 行

GML
47
字号
.func MK_LOCAL32
#include <windows.h>
void far *MK_LOCAL32( void * fp16 );
.funcend
.desc begin
The &func function converts a 16-bit near pointer to a 32-bit far
pointer.
This is needed whenever Windows returns a 16-bit near pointer that is
to be accessed by the 32-bit program.
.desc end
.return begin
The &func returns a 32-bit far pointer.
.return end
.see begin
.kw MK_FP32,
.kw MK_FP16
.see end
.exmp begin
#include <windows.h>

  WORD ich,cch;
  char *pch;
  char far *fpch;
  HANDLE hT;

  /*
   * Request the data from an edit window; copy it
   * into a local buffer so that it can be passed
   * to TextOut
   */
  ich = (WORD) SendMessage( hwndEdit,
                            EM_LINEINDEX,
                            iLine,
                            0L );
  cch = (WORD) SendMessage( hwndEdit,
                            EM_LINELENGTH,
                            ich,
                            0L );
  fpch = MK_LOCAL32( LocalLock( hT ) ) ;
  pch = alloca( cch );
  _fmemcpy( pch, fpch + ich, cch );

  TextOut( hdc, 0, yExtSoFar, (LPSTR) pch, cch );
  LocalUnlock( hT );
.exmp end
.class WIN386

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?