PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Managing the objects in C
  • Migrating a WINDEV 5.5 application that supports objects in C
  • Managing the data files in C or C++
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
I was using C with WINDEV 5.5. How to proceed in WINDEV 21?
Overview
You have the ability to use external languages with WINDEV. See the external languages in WINDEV for more details.
This paragraph presents the operations that must be performed to migrate a WINDEV 5.5 application that is using C to WINDEV 23.
Several cases must be considered:
  • managing the objects in C
  • managing the HyperFileSQL files in C or C++
Notes:
  • Important: The DDE calls (via CallDDE) in 16-bit mode are no longer available in this version of the external interface.
  • New: The CallWD function of the external interface now supports a syntax identical to the one of nWDExecute. This allows you to pass in a parameter to this function a string containing a standard WLanguage code, without using the former syntax such as "SCREEN,INPUT".
Managing the objects in C

Migrating a WINDEV 5.5 application that supports objects in C

To migrate a WINDEV 5.5 application that supports objects in C:
  1. Migrate your WINDEV 5.5 project to WINDEV 7.5, then open it with WINDEV 23.
  2. Copy the WINDEV.c and WINDEV.h files found in the "ExternalLanguages\C" sub-directory of WINDEV into the directory of your application. These files replace the existing files.
  3. Delete the calls to CALLDDE from your C application. This function could only be used in the applications in 16-bit mode.
  4. The management of menus can be performed by one of the following methods:
    • Retrieving the shortcuts of menus with WDKEY = "*M*":
      BOOL bEnd = FALSE;
      while (!bEnd)
      {
      CALLWD("Screen,Input");
      if (strcmp(WDKey,"*M*") == 0)
      {
      if (strcmp(WDString,"FO") == 0) OpenFile;
      if (strcmp(WDString,"FS") == 0) SaveFile;
      if (strcmp(WDString,"FQ") == 0) bEnd = TRUE;
      }
    • Retrieving the shortcuts of menus by managing the shortcut in the option directly:
      1. In the code of each menu option to process, assign the shortcut to the WDKey keyword. For example, for File..Open:
        WDKey="FO";
      2. Modify the C code as follows:
        BOOL bEnd = FALSE;
        while (!bEnd)
        {
        CALLWD("Screen,Input");
        if (strcmp(WDKey,"FO") == 0) OpenFile;
        if (strcmp(WDKey,"FS") == 0) SaveFile;
        if (strcmp(WDKey,"FQ") == 0) bEnd = TRUE;
        if (strcmp(WDKey,"ESC") == 0) bEnd = TRUE;
        }
  5. Re-create the library of your WINDEV application.
  6. Recompile your C project.
  7. Copy the necessary WINDEV DLLs into the directory of the executable of your application. Caution: wdxxxle.dll is mandatory.
Note: To find out the list of necessary DLLs, create the executable of your application in WINDEV.
Managing the data files in C or C++
To migrate a WINDEV 5.5 application that manages the data files in C or C++:
  1. Migrate your project from WINDEV 5.5 to WINDEV 7.5 and open it with WINDEV 23.
  2. Generate the skeleton of your application ("Analysis .. Advanced generation" in the data model editor).
    Caution: Don't overwrite the skeleton used by your application.
    Generate the skeleton of your application in version 23:
    • open the data model editor ( button among the quick access buttons).
    • on the "Analysis" pane, in the "Analysis" group, expand "Generation" and select "Advanced generation".
      Caution: Don't overwrite the skeleton used by your application.
  3. Create the library of your WINDEV application ("Project .. Create a library").Create the library of your WINDEV application. Create (if necessary) a project configuration of "Library" type and generate this configuration.
  4. Delete the WDHF5.c and WDHF5.h files from the directory of your source codes to avoid any confusion.
  5. In your C project, delete the reference of dependency to the WDHF5.c and WDHF5.H files.
  6. Copy the following files found in the "ExternalLanguages\C" sub-directory of WINDEV into the directory of your application.
    • HFConstant.h
    • HFContext.cpp
    • HFContext.h
    • IHFContext.h
    • WDHF.h
    • WDHF.cpp
    • WINDEV.c
    • WINDEV.h
    • ProXY.h
    • Central.h
    • the <Analysis Name> file. h generated by the WINDEV analysis (point 2). This file is found in the directory of the analysis of the WINDEV project.
    • the <Analysis Name>.cpp file generated by the WINDEV analysis (point 2). This file is found in the directory of the analysis of the WINDEV project.
    • the library (.WDL file) of the WINDEV application.
  7. Add the following files to the C project:
    • HFContext.cpp
    • WDHF.cpp
  8. In the initial C source:
    • Replace #include "wdhf5.h" by #include"wdhf.h".
    • Replace #include "*.WDR" by #include"<Analysis>.h" where <Analysis> corresponds to the name of your analysis.
    • Copy the declarations of structure found in the <Analysis>.cpp skeleton and rename them. These declarations must be copied just after #include"<Analysis>.h".
      The declarations of structure have the following format:
      st<FILE> g<FILE>

      where FILE is the name of the file (in uppercase characters).
      These declarations must be renamed as follows:
      st<FILE> <File Abbreviation>

      where File Abbreviation corresponds to the abbreviation used to designate the file.
    • If your code is using HOpenAnalysis, you must specify the extension of the analysis file (.WDD) in the first parameter of the function.
    • Delete the following lines from the C source code:
      • the declaration of the array corresponding to the HFSQL context.
        /* Array used to initialize the HFSQL context*/
        stHFFileCtx stArrCtx[]=\{
        { (char*)&dp,sizeof(st),"STATE",NULL },
        { (char*)&dp,sizeof(ci),"CITY",NULL },
        .....
        };
        # define NBCTX (sizeof(stArrCtx)/sizeof(stHFFileCtx))
      • the initialization of HyperFileSQL
        /* mandatory initialization of HYPERFILESQL */
        CALLWD("HFCTX");
        if (!Hinitshare(WDLong,&stArrCtx[0],NBCTX))
        {CALLWD("Error, Error initializing the HF context.");}

        This code must be replaced by the following line:
        bInitHF()
      • the call to hfEndShare.
    • Copy the following code lines found in the <Analysis>.cpp skeleton and rename them. These lines must be copied just after the bInitHF line.
      Code found in the skeleton (one line per file):
      gclHF.bAssociate(<FILE>,&g<FILE>,sizeof(g<FILE>));

      where FILE is the name of the file (in uppercase characters).
      These declarations must be modified as follows:
      bAssociate(<FICHIER>,&<File Abbreviation>,sizeof(<File Abbreviation>));

      where File Abbreviation corresponds to the abbreviation used to designate the file.
  9. Recompile your C or C++ project+.
  10. Copy the necessary WINDEV DLLs into the directory of the executable of your application.
    Caution: wdxxxle.dll is mandatory.
Note: To find out the list of necessary DLLs, create the executable of your application in WINDEV.
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment