KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q30827: An Example Where a Protect Mode C Extension Will Not Load

Article: Q30827
Product(s): See article
Version(s): 1.00
Operating System(s): OS/2
Keyword(s): ENDUSER | TAR76121 TAR76251 | mspl13_basic
Last Modified: 8-JUN-1988

Problem:
   I am trying to create an extension to the MEP.EXE editor. I am
unable to get the editor to load my C extension. To simplify things I
tried to get the editor to load the sample SKEL; however, I was
unsuccessful. I receive the following error messages when loading:

   "cannot load skel - invalid argument"
   "skel is an illegal setting"

   My LIBPATH is c:\os2\dll and skel.dll is placed there. If skel.dll
is not in my libpath I would get the error "no such file or
directory". My MAKE and DEF files for SKEL are as follows:

SKEL MAKE FILE
#
# Makefile for the MEP Editor Extensions
#
SYS=\os2\dll

.c.obj:
 cl -c -Gs -Asfu -G2 -Lp $*.c

.obj.dll:
 link  /NOI /NOD exthdrp.obj $*.obj,$*.dll,nul.map,,$*.def;

skel.obj:    skel.c skel

skel.dll:    skel.obj skel.def

$(SYS)\skel.dll:  skel.dll
       copy skel.dll $(SYS)

SKEL DEF FILE

LIBRARY  SKEL

EXPORTS
 _ModInfo
 SKEL

Response:
   The extension is not loaded because the DEF file is incorrect. The
file should be as follows:

SKEL.DEF:
   LIBRARY

   EXPORTS
           _ModInfo
           EntryPoint

   This file should be used with all the extensions that are written.
It need not be modified.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.