2 programming - darwin/visual c, Programming - darwin/visual c -6, Adding the path to the include file – Yokogawa PC-Based MX100 User Manual

Page 1049: Declaration in the source file, Load library statement

Advertising
background image

20-6

IM MX190-01E

20.2 Programming - DARWIN/Visual C -

Adding the Path to the Include File

Add the path of the include file (DAQDA100.h) to the project. The method of adding
the include file varies depending on the environment used.

Declaration in the Source File

Write the declaration in the source file.

#include "DAQDA100.h"

Note

The include file of the common section (DAQHandler.h, DAQDARWIN.h) is referenced
from the include file described above. Thus, declaration for it is not necessary.

Load Library Statement

The statement below is added so that the executable module (.dll) of the extension
API can link to the process.

The executable module (.dll) of the extension API is mapped within the address
space (LoadLibrary). Next, the address of the export function in the executable

module is retrieved (GetProcAddress).

The callback type of the function pointer is the function name with a prefix “DLL”
added and converted to uppercase. It is defined in the include file of the extension

API.

HMODULE pDll = LoadLibrary("DAQDA100";
DLLOPENDA100 openDA100 = (DLLOPENDA100)GetProcAddress(pDll,
"openDA100";

Advertising