📄 dsapp.h
字号:
#ifndef ___DSAPP_H
#define ___DSAPP_H
#include <dsylib.h>
#include <lvpackon.h>
// Return codes from LoadLibrary - Reported and defined here for completeness
#define DsyAError_InvalidDll 0 // System was out of memory, executable
// file was corrupt, or relocations were invalid.
#define DsyAError_FileNotFound 2 // File was not found.
#define DsyAError_PathNotFound 3 // Path was not found.
#define DsyAError_SharingError 5 // Attempt was made to dynamically link to a task, or
// there was a sharing or network-protection error.
#define DsyAError_SepDataSeg 6 // Library required separate data segments for each task.
#define DsyAError_OutOfMemory 8 // There was insufficient memory to start the application.
#define DsyAError_WinVer 10 // Windows version was incorrect.
#define DsyAError_NoWinApp 11 // Executable file was invalid. Either it was not a
// Windows application or there was an error in the .EXE image.
#define DsyAError_DifferentOS 12 // Application was designed for a different operating system.
#define DsyAError_Dos40 13 // Application was designed for MS-DOS 4.0.
#define DsyAError_UnknownFormat 14 // Type of executable file was unknown.
#define DsyAError_RealModeDll 15 // Attempt was made to load a real-mode application
// (developed for an earlier version of Windows).
#define DsyAError_MultDataSeg 16 // Attempt was made to load a second instance of an executable
// file containing multiple data segments that were not
// marked read-only.
#define DsyAError_CompressedDLL 19 // Attempt was made to load a compressed executable file.
// The file must be decompressed before it can be loaded.
#define DsyAError_MissDll 20 // Dynamic-link library (DLL) file was invalid. One of
// the DLLs required to run this application was corrupt.
#define DsyAError_32Bits 21 // Application requires Microsoft Windows 32-bit extensions.
// Return codes generated by Daisy on loading Dsa files
#define DsyAError_NotDsyApp 32 // The Dll appears to be not a daisy application extension
#define DsyAError_VerMismatch 33 // The Dll requires a different version of Daisy
#define DsyAError_InvalidCfg 34 //
#define DsyAError_InvalidCfgName 35 //
#define DsyAError_InvalidCfgFile 36 //
#define DsyAError_InvalidCfgContent 37 //
#define DsyAError_NotEnoughMemory 38 //
#define _MAXDSAPPID 10
#define _DAIF_BaseNrIf 10
typedef struct _LvDsAppHdr {
char Hdr[4];
} DsAppHdr;
class LvDsyApplication;
LVDSYCLASS LvDsyAppMsgHandler {
public:
LvDsyAppMsgHandler(void) {}
virtual LVSTATUS HandleMessage(LvDsyApplication *MsgSrc, int Id, U32BIT Param1, U32BIT Param2) = 0;
};
// ----------------------------------------------
// Message definition from Sequencer Dral
// ----------------------------------------------
#define DaSeqMsg_ImageAcquired 0x01000001
// ----------------------------------------------
// Sent for each acquired image allowing the application
// to process it. When the configuration flags include
// SqFlg_InternalThread
//
// MsgSrc: Pointer to the DsyApp_Seq32 object.
// Id : DaSeqMsg_ImageAcquired
// Param1: Index of the image to be processed.
// Param2: Not used.
// ----------------------------------------------
LVDSYCLASS LvDsyApplication : public DsAppHdr {
private:
// Initialization fns
LVSTATUS GetDaInterface(void);
LVSTATUS GetDllInterface(void);
LVSTATUS GetDsAppData(void);
void *ReallocCfg(int NewStructLen);
void SetDefaultCfg(void);
char AppId[_MAXDSAPPID];
FARPROC DaIf[_DAIF_BaseNrIf];
LvDsyAppMsgHandler *MsgHandler;
protected:
// int DsAppId;
void UnloadDsApp(void);
void LoadDsApp(LPSTR DllName);
FARPROC *Interface;
int NrIfEntry;
void *Config;
U16BIT CfgLen;
void *Status;
U16BIT StatusLen;
void *AppData;
char CfgFileName[128];
LVSTATUS LoadStatus;
HINSTANCE DllInstance;
public:
LvDsyApplication(LPSTR DllName);
virtual ~LvDsyApplication(void);
virtual LVSTATUS UserFunction(int Id, U32BIT Param1, U32BIT Param2);
void *GetAppDataPtr(void) { return AppData; }
void *GetConfigPtr(void) { return Config; }
LVSTATUS GetLoadStatus(void) { return LoadStatus; }
LVSTATUS LoadCfg(char *FileName=NULL);
LVSTATUS SaveCfg(char *FileName=NULL);
virtual LVSTATUS Activate(void *CfgBuffer=NULL);
int GetConfigSize(void) { return CfgLen; }
LVSTATUS GetConfig(void *CfgBuffer);
int GetStatusSize(void) { return StatusLen; }
LVSTATUS GetStatus(void *StatusBuffer);
virtual LVSTATUS SetConfig(void *CfgBuffer);
LVSTATUS GetAppId(char *Buffer, int Size);
FARPROC *GetInterface(void) { return Interface; }
void SetMsgHandler(LvDsyAppMsgHandler *NewMsgHandler);
#ifdef __UNIX__
virtual int DSA_GetNrIfEntry(void)=0;
virtual int DSA_GetIfEntry(void FAR *Buffer)=0;
virtual void DSA_SetDefaultCfg(void FAR *Buffer)=0;
virtual int DSA_GetCfgSize(void)=0;
virtual LVSTATUS DSA_ActivateCfg(void far *Buffer)=0;
virtual int DSA_GetAppDataSize(void)=0;
virtual int DSA_CfgUI(HWND ParentWnd)=0;
virtual int DSA_CleanUp(void)=0;
virtual int DSA_GetStatusSize(void)=0;
virtual LVSTATUS DSA_GetStatus(void *Status)=0;
#endif
void* operator new(size_t size);
void operator delete(void* p);
};
#include <lvpackof.h>
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -