[[ header START ]]

Welcome to OS2.GURU site! (eComStation.RU)

Select your language: Russian English Deutch Spanish Italian Portuguese Czech Polish French

Frequently asked questions and answers:
telegram

Форум обсуждение

telegram

Send message

telegram

[ +7-981-8529467 (Санкт-Петербург)

telegram

t.me/os2_guru

eComStation.RU


ru · en · de · es · it · pt · cz · pl · fr
OS/2 is a greatly different operating system for PC (ArcaOS, eComStation, IBM OS/2 Warp)
Applications, news, reviews, support of users, hardware, questions and answers.
 
[What is OS/2?  News  Install  Update  
 
 
Usage  Future  Community  Projects  

How to buy
russian OS/2 apps?

The concept of
OS/2 development

(Map of the site)

 
 
[[ head-3-search ]]

Database of OS/2 compatible hardware

[[ head-3-search END ]]

 
Update

 
Applications

 
Advantages:

 
For developer:

 
(Пайпы программ)

 
Companies:

 
History:

 
(Бонусы)

 
Advice:

 
(Барьеры и решения)

 
Technologies:

 
(Применение в науке, лаборатории, ..)

 

 
Solutions

 
New eComStation:

 
Future:

 
(Ссылки на другие сайты)

 
(Картинка дня)

 
OS/2 artefacts:

 
Gadgets:

eCo Software Developer Connection


About DevCon
Subscription to DevCon
Budget of DevCon
FAQ


Roadmap
eCo Software runtime
eCo Software toolkit
Contacts

  You can sponsor the development of the libraries,
control the expenses

Which rules to observe when projecting an API? Follow this rules when creating a library.

В первом приближении
  • Функции должны экспортироваться по ординалам.
  • К dll должен прилагаться .h-файл с описанием функций
  • Если интерфейс опубликован, то менять его нельзя. Если нужны новые функции, исправленные, то добавляй их как новые.
Don't return pointers Functions, messages, methods and other structures of API shouldn't return pointers. Better use handles. Functions shouldn't allocate the memory by themselves and pass it to calling process. The calling process must allocate memory and free it. Study the examples in OS/2 Toolkit.
Возможность расширять структуры в будущем Структуры данных должны позволять в дальнейшем вводить новые поля. Т.е. каждый составной тип первым полем должен иметь переменную с информацией о размере структуры. Примеры см. в OS/2 Toolkit. При передаче клиентом в функцию структуры (буфера) меньшей длины, структура должна заполняться частично. Т.е. если API использовал ранее структуру типа:
       
      struct DemoType1 {
        USHORT size;
        LONG item1;
      };

А потом стал использовать

      struct DemoType2 {
        USHORT size;
        LONG item1;
        PSZ item2;
      };

То при передаче клиентом буфера размером sizeof(DemoType1) должны быть заполнены поля по Item1 (включительно), несмотря на то, что функция API может заполнить и более полную структуру.

Fix the alignment
  • The structures used between the library and program should keep the size of the structure
      
            USHORT size;
    
  • Fix the alignment of the structures, the .h file should contain:
    #pragma pack(1)
    
  • Export by ordinals, not names

    Экспортировать надо всегда по ординалам (чтобы старые программы работали с новыми версиями .dll). Импортировать надо всегда по имени, а не по ординалам.

    OpenWatcom, wlink.exe

    Добавьте в .def на линковку dll:

    EXPORTS
        RegisterPluginProc  @501 NONAME
    

    если в makefile, то

    export VfmParserVersion.1
    

    Visual Age for C, v.4

       option link(export, "PLINIT",,1,NONAME)
    
    Simple C Don't use C++ inside dll library
    Other mistakes Don't use functions abort() and exit() inside the libraries
    Parameters: char * or const char* Declare parameters as const char*

    Char* parameters can be changed (by mistake) inside the function.

    Useful functions

    Check dll presence:

    APIRET CheckDll(PSZ pszModname)
    {
        HMODULE hmod;
        char    szPath[CCHMAXPATH];
        APIRET  rc;
    
        rc = DosLoadModule( szPath, sizeof(szPath), pszModname, &hmod);
        if (!rc)
           DosFreeModule( hmod);
        return (rc);
    } 
    

    Useful tools

    • which dll -- find the active instance of a DLL
    • pmdll -- view DLL dependencies of OS/2 executables

     

     
    For dummies

    Report: OS/2 compatible hardware

     
    Reviews


         
      Why eComStation?
    Features
    Advantages
    Usage
    Clips and screenshots
       eComStation for
    for businessmen
    for students and engineers
    for reselles of computers
    community of users
       Developer
    Distribute the program
    Description of API, libraries
    Start new project
    Competition
       Applications
    On-line catalogue
    Select from eCo Market
       Support service
    Contact the web-master
    Buy eComStation
    Frequently asked questions
    for Beginners
     
     
    © 2001 - 2021 eCo Software, All rights reserved
    Сибирский Медведь технологическая компания
    eComStation Serenity Systems International • OS/2 Warp IBM Corporation • ArcaOS Arca Noae