home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1999 July
/
PCWorld_1999-07_cd.bin
/
602
/
WBPERSON
/
data1.cab
/
SDK_Files
/
C-lang
/
MFC
/
WBMFC.H
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-09
|
37KB
|
819 lines
// wbmfc.h : header file
//
#ifndef __WBMFC__
#define __WBMFC__
#include "wbprezen.h"
#include "wbkernel.h"
#define SZM_MDI_CHILD_TYPE WM_SZM_BASE + 201
#define MSG_BAD_PASSWORD 1210
#define EDIT_MDI_CHILD 4522
extern "C" DllImport void WINAPI Kernel_error_box(int errnum);
extern "C" DllImport void WINAPI errbox(const char FAR * text);
#ifdef WIN32
inline WORD GetCmdID (WPARAM wPar, LPARAM lPar){return((WORD)wPar);}
inline WORD GetCmdCMD (WPARAM wPar, LPARAM lPar){return(*((WORD *)&wPar + 1));}
inline HWND GetCmdHWND(WPARAM wPar, LPARAM lPar){return((HWND)lPar);}
#else
inline WORD GetCmdID (WPARAM wPar, LPARAM lPar){return(wPar);}
inline WORD GetCmdCMD (WPARAM wPar, LPARAM lPar){return(*((WORD *)&lPar + 1));}
inline HWND GetCmdHWND(WPARAM wPar, LPARAM lPar){return((HWND)lPar);}
#endif
class CWBCursTab
{
public:
tcurstab m_CursTab;
cdp_t m_cdp;
CWBCursTab(cdp_t cdp = NULL){m_cdp = cdp;}
inline trecnum Append()
{return ::Append(m_CursTab);}
inline BOOL Close()
{return IsTable() ? ::Uninst_table(m_CursTab) : ::Close_cursor(m_CursTab);}
inline BOOL C_avg(const char *AttrName, const char *Condition, void *Result)
{return ::C_avg(m_CursTab, AttrName, Condition, Result);}
inline BOOL C_count(const char *AttrName, const char *Condition, trecnum *Result)
{return ::C_count(m_CursTab, AttrName, Condition, Result);}
inline BOOL C_max(const char *AttrName, const char *Condition, void *Result)
{return ::C_max(m_CursTab, AttrName, Condition, Result);}
inline BOOL C_min(const char *AttrName, const char *Condition, void *Result)
{return ::C_min(m_CursTab, AttrName, Condition, Result);}
inline BOOL C_sum(const char *AttrName, const char *Condition, void *Result)
{return ::C_sum(m_CursTab, AttrName, Condition, Result);}
inline BOOL Data_export(tcateg Categ, const char *fName, unsigned Format, int Recode)
{return ::Data_export(m_CursTab, Categ, fName, Format, Recode);}
inline BOOL Delete(trecnum position)
{return ::Delete(m_CursTab, position);}
inline BOOL Delete_all_records()
{return ::Delete_all_records(m_CursTab);}
inline BOOL Get_fcursor(window_id id, WORD *Flags)
{return ::Get_fcursor(id, &m_CursTab, Flags);}
inline trecnum Insert()
{return ::Insert(m_CursTab);}
inline BOOL IsTable()
{return m_CursTab >= 0x8000;}
inline trecnum Look_up(const char *AttrName, void *Res)
{return ::Look_up(m_CursTab, AttrName, Res);}
inline BOOL Read(trecnum Position, tattrib Attr, const modifrec *Access, void *Buffer)
{return ::Read(m_CursTab, Position, Attr, Access, Buffer);}
inline BOOL Read_ind(trecnum Position, tattrib Attr, uns16 Index, void *Buffer)
{return ::Read_ind(m_CursTab, Position, Attr, Index, Buffer);}
inline BOOL Read_ind_cnt(trecnum Position, tattrib Attr, uns16 *Count)
{return ::Read_ind_cnt(m_CursTab, Position, Attr, Count);}
inline BOOL Read_len(trecnum Position, tattrib Attr, uns16 Index, uns32 *Size)
{return ::Read_len(m_CursTab, Position, Attr, Index, Size);}
inline BOOL Read_lock_record(trecnum Position)
{return ::Read_lock_record(m_CursTab, Position);}
inline BOOL Read_lock_table()
{return ::Read_lock_table(m_CursTab);}
inline BOOL Read_record(trecnum Position, void *Buffer, uns16 DataSize)
{return ::Read_record(m_CursTab, Position, Buffer, DataSize);}
inline BOOL Read_unlock_record(trecnum Position)
{return ::Read_unlock_record(m_CursTab, Position);}
inline BOOL Read_unlock_table()
{return ::Read_unlock_table(m_CursTab);}
inline BOOL Read_var(trecnum Position, tattrib Attr, uns16 Index, uns32 Start, uns32 Size, void *Buffer, uns32 *pSize)
{return ::Read_var(m_CursTab, Position, Attr, Index, Start, Size, Buffer, pSize);}
inline BOOL Rec_cnt(trecnum *RecNum)
{return ::Rec_cnt(m_CursTab, RecNum);}
inline BOOL Set_fcursor(window_id id, tcursnum curs, uns32 Flags)
{return ::Set_fcursor(id, m_CursTab, Flags);}
inline BOOL Write(trecnum Position, tattrib Attr, const modifrec *Access, const void *Buffer, uns16 DataSize)
{return ::Write(m_CursTab, Position, Attr, Access, Buffer, DataSize);}
inline BOOL Write_ind(trecnum Position, tattrib Attr, uns16 Index, void * Buffer, uns16 Size)
{return ::Write_ind(m_CursTab, Position, Attr, Index, Buffer, Size);}
inline BOOL Write_ind_cnt(trecnum Position, tattrib Attr, uns16 Count)
{return ::Write_ind_cnt(m_CursTab, Position, Attr, Count);}
inline BOOL Write_len(trecnum Position, tattrib Attr, uns16 Index, uns32 Size)
{return ::Write_len(m_CursTab, Position, Attr, Index, Size);}
inline BOOL Write_lock_record(trecnum Position)
{return ::Write_lock_record(m_CursTab, Position);}
inline BOOL Write_lock_table()
{return ::Write_lock_table(m_CursTab);}
inline BOOL Write_record(trecnum Position, const void *Buffer, uns16 DataSize)
{return ::Write_record(m_CursTab, Position, Buffer, DataSize);}
inline BOOL Write_unlock_record(trecnum Position)
{return ::Write_unlock_record(m_CursTab, Position);}
inline BOOL Write_unlock_table()
{return ::Write_unlock_table(m_CursTab);}
inline BOOL Write_var(trecnum Position, tattrib Attr, uns16 Index, uns32 Start, uns32 Size, void *Buffer)
{return ::Write_var(m_CursTab, Position, Attr, Index, Start, Size, Buffer);}
inline trecnum cd_Append()
{return ::cd_Append(m_cdp, m_CursTab);}
inline BOOL cd_Close()
{return IsTable() ? ::Uninst_table(m_CursTab) : ::cd_Close_cursor(m_cdp, m_CursTab);}
inline BOOL cd_C_avg(const char *AttrName, const char *Condition, void *Result)
{return ::cd_C_avg(m_cdp, m_CursTab, AttrName, Condition, Result);}
inline BOOL cd_C_count(const char *AttrName, const char *Condition, trecnum *Result)
{return ::cd_C_count(m_cdp, m_CursTab, AttrName, Condition, Result);}
inline BOOL cd_C_max(const char *AttrName, const char *Condition, void *Result)
{return ::cd_C_max(m_cdp, m_CursTab, AttrName, Condition, Result);}
inline BOOL cd_C_min(const char *AttrName, const char *Condition, void *Result)
{return ::cd_C_min(m_cdp, m_CursTab, AttrName, Condition, Result);}
inline BOOL cd_C_sum(const char *AttrName, const char *Condition, void *Result)
{return ::cd_C_sum(m_cdp, m_CursTab, AttrName, Condition, Result);}
inline BOOL cd_Delete(trecnum position)
{return ::cd_Delete(m_cdp, m_CursTab, position);}
inline BOOL cd_Delete_all_records()
{return ::cd_Delete_all_records(m_cdp, m_CursTab);}
inline trecnum cd_Insert()
{return ::cd_Insert(m_cdp, m_CursTab);}
inline trecnum cd_Look_up(const char *AttrName, void *Res)
{return ::cd_Look_up(m_cdp, m_CursTab, AttrName, Res);}
inline BOOL cd_Read(trecnum Position, tattrib Attr, const modifrec *Access, void *Buffer)
{return ::cd_Read(m_cdp, m_CursTab, Position, Attr, Access, Buffer);}
inline BOOL cd_Read_ind(trecnum Position, tattrib Attr, uns16 Index, void *Buffer)
{return ::cd_Read_ind(m_cdp, m_CursTab, Position, Attr, Index, Buffer);}
inline BOOL cd_Read_ind_cnt(trecnum Position, tattrib Attr, uns16 *Count)
{return ::cd_Read_ind_cnt(m_cdp, m_CursTab, Position, Attr, Count);}
inline BOOL cd_Read_len(trecnum Position, tattrib Attr, uns16 Index, uns32 *Size)
{return ::cd_Read_len(m_cdp, m_CursTab, Position, Attr, Index, Size);}
inline BOOL cd_Read_lock_record(trecnum Position)
{return ::cd_Read_lock_record(m_cdp, m_CursTab, Position);}
inline BOOL cd_Read_lock_table()
{return ::cd_Read_lock_table(m_cdp, m_CursTab);}
inline BOOL cd_Read_record(trecnum Position, void *Buffer, uns16 DataSize)
{return ::cd_Read_record(m_cdp, m_CursTab, Position, Buffer, DataSize);}
inline BOOL cd_Read_unlock_record(trecnum Position)
{return ::cd_Read_unlock_record(m_cdp, m_CursTab, Position);}
inline BOOL cd_Read_unlock_table()
{return ::cd_Read_unlock_table(m_cdp, m_CursTab);}
inline BOOL cd_Read_var(trecnum Position, tattrib Attr, uns16 Index, uns32 Start, uns32 Size, void *Buffer, uns32 *pSize)
{return ::cd_Read_var(m_cdp, m_CursTab, Position, Attr, Index, Start, Size, Buffer, pSize);}
inline BOOL cd_Rec_cnt(trecnum *RecNum)
{return ::cd_Rec_cnt(m_cdp, m_CursTab, RecNum);}
inline BOOL cd_Write(trecnum Position, tattrib Attr, const modifrec *Access, const void *Buffer, uns16 DataSize)
{return ::cd_Write(m_cdp, m_CursTab, Position, Attr, Access, Buffer, DataSize);}
inline BOOL cd_Write_ind(trecnum Position, tattrib Attr, uns16 Index, void * Buffer, uns16 Size)
{return ::cd_Write_ind(m_cdp, m_CursTab, Position, Attr, Index, Buffer, Size);}
inline BOOL cd_Write_ind_cnt(trecnum Position, tattrib Attr, uns16 Count)
{return ::cd_Write_ind_cnt(m_cdp, m_CursTab, Position, Attr, Count);}
inline BOOL cd_Write_len(trecnum Position, tattrib Attr, uns16 Index, uns32 Size)
{return ::cd_Write_len(m_cdp, m_CursTab, Position, Attr, Index, Size);}
inline BOOL cd_Write_lock_record(trecnum Position)
{return ::cd_Write_lock_record(m_cdp, m_CursTab, Position);}
inline BOOL cd_Write_lock_table()
{return ::cd_Write_lock_table(m_cdp, m_CursTab);}
inline BOOL cd_Write_record(trecnum Position, const void *Buffer, uns16 DataSize)
{return ::cd_Write_record(m_cdp, m_CursTab, Position, Buffer, DataSize);}
inline BOOL cd_Write_unlock_record(trecnum Position)
{return ::cd_Write_unlock_record(m_cdp, m_CursTab, Position);}
inline BOOL cd_Write_unlock_table()
{return ::cd_Write_unlock_table(m_cdp, m_CursTab);}
inline BOOL cd_Write_var(trecnum Position, tattrib Attr, uns16 Index, uns32 Start, uns32 Size, void *Buffer)
{return ::cd_Write_var(m_cdp, m_CursTab, Position, Attr, Index, Start, Size, Buffer);}
inline operator tcurstab() const
{return(m_CursTab);}
};
class CWBTable : public CWBCursTab
{
public:
CWBTable(cdp_t cdp = NULL) : CWBCursTab(cdp){}
inline BOOL Attribute_info(const char *AttrName, tattrib *AttrNum, uns8 *AttrType, uns8 *AttrMult, uns16 *AttrSpecif)
{return ::Attribute_info((ttablenum)m_CursTab, AttrName, AttrNum, AttrType, AttrMult, AttrSpecif);}
inline BOOL Compact_table()
{return ::Compact_table((ttablenum)m_CursTab);}
inline BOOL Enable_index(sig16 Which, BOOL Enable)
{return ::Enable_index((ttablenum)m_CursTab, Which, Enable);}
inline BOOL Enum_attributes(LPVOID callback)
{return ::Enum_attributes((ttablenum)m_CursTab, (enum_attr FAR *)callback);}
inline BOOL Find_object(const char *Name)
{return ::Find_object(Name, CATEG_TABLE, (tobjnum *)&m_CursTab);}
inline BOOL Free_deleted()
{return ::Free_deleted((ttablenum)m_CursTab);}
inline BOOL Get_data_rights(const char *UserName, tright *Rights, tdright *rdRights, tdright *wrRights)
{return ::Get_data_rights((ttablenum)m_CursTab, UserName, Rights, rdRights, wrRights);}
inline BOOL Open(const char *Name)
{return ::Find_object(Name, CATEG_TABLE, (tobjnum *)&m_CursTab);}
inline BOOL Set_data_rights(const char *UserName, tright Rights, tdright rdRights, tdright wrRights)
{return ::Set_data_rights((ttablenum)m_CursTab, UserName, Rights, rdRights, wrRights);}
inline BOOL Undelete(trecnum Position)
{return ::Undelete((ttablenum)m_CursTab, Position);}
inline BOOL Close()
{return ::Uninst_table((ttablenum)m_CursTab);}
inline BOOL Uninst_table()
{return ::Uninst_table((ttablenum)m_CursTab);}
inline BOOL cd_Attribute_info(const char *AttrName, tattrib *AttrNum, uns8 *AttrType, uns8 *AttrMult, uns16 *AttrSpecif)
{return ::cd_Attribute_info(m_cdp, (ttablenum)m_CursTab, AttrName, AttrNum, AttrType, AttrMult, AttrSpecif);}
inline BOOL cd_Compact_table()
{return ::cd_Compact_table(m_cdp, (ttablenum)m_CursTab);}
inline BOOL cd_Enable_index(sig16 Which, BOOL Enable)
{return ::cd_Enable_index(m_cdp, (ttablenum)m_CursTab, Which, Enable);}
inline BOOL cd_Enum_attributes(LPVOID callback)
{return ::cd_Enum_attributes(m_cdp, (ttablenum)m_CursTab, (enum_attr FAR *)callback);}
inline BOOL cd_Find_object(const char *Name)
{return ::cd_Find_object(m_cdp, Name, CATEG_TABLE, (tobjnum *)&m_CursTab);}
inline BOOL cd_Free_deleted()
{return ::cd_Free_deleted(m_cdp, (ttablenum)m_CursTab);}
inline BOOL cd_Open(const char *Name)
{return ::cd_Find_object(m_cdp, Name, CATEG_TABLE, (tobjnum *)&m_CursTab);}
inline BOOL cd_Undelete(trecnum Position)
{return ::cd_Undelete(m_cdp, (ttablenum)m_CursTab, Position);}
};
class CWBCursor : public CWBCursTab
{
public:
CWBCursor(cdp_t cdp = NULL) : CWBCursTab(cdp){}
inline BOOL Add_record(trecnum *Recs, short NumOfRecs)
{return ::Add_record((tcursnum)m_CursTab, Recs, NumOfRecs);}
inline BOOL Close()
{return ::Close_cursor((tcursnum)m_CursTab);}
inline BOOL Close_cursor()
{return ::Close_cursor((tcursnum)m_CursTab);}
inline BOOL Open(tobjnum CursDef)
{return ::Open_cursor(CursDef, (tcursnum *)&m_CursTab);}
inline BOOL Open(const char *Query)
{return ::Open_cursor_direct(Query, (tcursnum *)&m_CursTab);}
inline BOOL Open_cursor(tobjnum CursDef)
{return ::Open_cursor(CursDef, (tcursnum *)&m_CursTab);}
inline BOOL Open_cursor_direct(const char *Query)
{return ::Open_cursor_direct(Query, (tcursnum *)&m_CursTab);}
inline BOOL ODBC_open_cursor(uns32 Connection, const char *Query)
{return ::ODBC_open_cursor(Connection, (tcursnum *)&m_CursTab, Query);}
inline BOOL Open_subcursor(const char *SubcurDef, CWBCursor *Subcurs)
{return ::Open_subcursor((tcursnum)m_CursTab, SubcurDef, (tcursnum *)&Subcurs->m_CursTab);}
inline BOOL Print_view(const char *ViewDef, trecnum FirstRec, trecnum LastRec, FARPROC Filter)
{return ::Print_view(ViewDef, (tcursnum)m_CursTab, FirstRec, LastRec, Filter);}
inline BOOL Super_recnum(tcursnum SuperCursor, trecnum SubRecnum, trecnum *SuperRecnum)
{return ::Super_recnum((tcursnum)m_CursTab, SuperCursor, SubRecnum, SuperRecnum);}
inline BOOL Translate(trecnum cRec, short Tbord, trecnum *tRec)
{return ::Translate((tcursnum)m_CursTab, cRec, Tbord, tRec);}
inline BOOL cd_Add_record(trecnum *Recs, short NumOfRecs)
{return ::cd_Add_record(m_cdp, (tcursnum)m_CursTab, Recs, NumOfRecs);}
inline BOOL cd_Close()
{return ::cd_Close_cursor(m_cdp, (tcursnum)m_CursTab);}
inline BOOL cd_Close_cursor()
{return ::cd_Close_cursor(m_cdp, (tcursnum)m_CursTab);}
inline BOOL cd_Open(tobjnum CursDef)
{return ::cd_Open_cursor(m_cdp, CursDef, (tcursnum *)&m_CursTab);}
inline BOOL cd_Open(const char *Query)
{return ::cd_Open_cursor_direct(m_cdp, Query, (tcursnum *)&m_CursTab);}
inline BOOL cd_Open_cursor(tobjnum CursDef)
{return ::cd_Open_cursor(m_cdp, CursDef, (tcursnum *)&m_CursTab);}
inline BOOL cd_Open_cursor_direct(const char *Query)
{return ::cd_Open_cursor_direct(m_cdp, Query, (tcursnum *)&m_CursTab);}
inline BOOL cd_ODBC_open_cursor(uns32 Connection, const char *Query)
{return ::cd_ODBC_open_cursor(m_cdp, Connection, (tcursnum *)&m_CursTab, Query);}
inline BOOL cd_Open_subcursor(const char *SubcurDef, CWBCursor *Subcurs)
{return ::cd_Open_subcursor(m_cdp, (tcursnum)m_CursTab, SubcurDef, (tcursnum *)&Subcurs->m_CursTab);}
inline BOOL cd_Super_recnum(tcursnum SuperCursor, trecnum SubRecnum, trecnum *SuperRecnum)
{return ::cd_Super_recnum(m_cdp, (tcursnum)m_CursTab, SuperCursor, SubRecnum, SuperRecnum);}
inline BOOL cd_Translate(trecnum cRec, short Tbord, trecnum *tRec)
{return ::cd_Translate(m_cdp, (tcursnum)m_CursTab, cRec, Tbord, tRec);}
};
/////////////////////////////////////////////////////////////////////////////
// CWBApp thread
#define WBAPPI_NOLOGIN (const char *)-1
class CWBApp : public CWinApp
{
DECLARE_DYNAMIC(CWBApp)
protected:
BOOL m_Linked;
// protected constructor used by dynamic creation
inline CWBApp(const char* WinAppName = NULL) : CWinApp(WinAppName)
{
m_Linked = FALSE;
m_LoggedOn = FALSE;
m_cdp = cdp_alloc();
cdp_init(m_cdp);
}
// Attributes
public:
// Operations
public:
BOOL WBAppInit(const char *ApplName = NULL, const char *UserName = NULL,
const char *Password = NULL, const char *ServerPath = NULL);
cdp_t GetCdp(){return m_cdp;}
BOOL LoggedOn(){return m_LoggedOn;}
BOOL Linked(){return m_Linked;}
BOOL SetApplication(const char *Appl)
{
if (cd_Set_application(m_cdp, Appl))
{
OnSetAppErr();
return FALSE;
}
return TRUE;
}
void Logout()
{
if (m_LoggedOn)
{
::Logout();
m_LoggedOn = FALSE;
}
if (m_Linked)
{
::interf_close();
::unlink_kernel();
m_Linked = FALSE;
}
}
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWBApp)
public:
virtual BOOL InitInstance() = 0;
//}}AFX_VIRTUAL
// Implementation
protected:
cdp_t m_cdp;
BOOL m_LoggedOn;
virtual void OnInitErr(int err){::Kernel_error_box(err);}
virtual void OnLoginErr(){::errbox(MAKEINTRESOURCE(MSG_BAD_PASSWORD));}
virtual void OnSetAppErr(){::errbox("Zadanß aplikace v databßzi nenφ");}
//virtual BOOL OnIdle(LONG cnt){return(FALSE);}
// Generated message map functions
//{{AFX_MSG(CWBApp)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CWBFrameWnd frame
class CWBFrameWnd : public CMDIFrameWnd
{
DECLARE_DYNCREATE(CWBFrameWnd)
protected:
// protected constructor used by dynamic creation
WBFramePars FramePars;
// Attributes
public:
// Operations
public:
inline CWBFrameWnd(UINT fStyle = 0, UINT WinMenu = 0x8000)
{
FramePars.Flags = fStyle;
FramePars.WinMenu = WinMenu;
}
void UpdateMenuProps(HMENU hMainMenu, HMENU hWinMenu = (HMENU)-1);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWBFrameWnd)
public:
virtual void RecalcLayout(BOOL bNotify = TRUE);
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
inline LONG DefWinBaseFrameProc(WORD uMsg, WORD wParam, LONG lParam)
{return ::DefWinBaseFrameProc(m_hWnd, uMsg, wParam, lParam);}
inline LONG WinBaseFrameProc(WORD uMsg, WORD wParam, LONG lParam)
{return ::WinBaseFrameProc(m_hWnd, uMsg, wParam, lParam);}
// Generated message map functions
//{{AFX_MSG(CWBFrameWnd)
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CWBViewWnd frame
class CWBViewWnd : public CMDIChildWnd
{
DECLARE_DYNCREATE(CWBViewWnd)
protected:
// protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
inline CWBViewWnd(){ViewWndProc = NULL;m_hMenu = NULL;}
inline void SetMenu(HMENU hMenu){m_hMenu = hMenu;}
inline HMENU GetMenu(){return m_hMenu;}
BOOL Open(const char *ViewDef, tcursnum Base = NO_REDIR, uns32 Flags = 0,
trecnum Pos = 0, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Open_query_view(const char * ViewDef, tcursnum Base = NO_REDIR, BOOL Order = FALSE,
char *Query = NULL, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Select_records(const char *ViewDef, tcursnum Base, uns32 Flags,
short Limit, trecnum *Bindl, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Relate_record(const char *LocalAttr, const char *ViewDef, tcursnum Base = NO_REDIR, uns32 Flags = 0, FARPROC Filter = NULL,
const char *RemoteAttr = NULL);
inline BOOL Active_view()
{m_hWnd = ::Active_view(); return (BOOL)m_hWnd;}
inline BOOL Commit_view(BOOL CanAsk, BOOL ReportError)
{return ::Commit_view(m_hWnd, CanAsk, ReportError);}
inline BOOL Get_fcursor(tcursnum * curs, WORD * flags)
{return ::Get_fcursor((window_id)m_hWnd, curs, flags);}
inline BOOL Get_fcursor(CWBCursTab * curs, WORD * flags)
{return ::Get_fcursor((window_id)m_hWnd, (tcursnum *)&curs->m_CursTab, flags);}
inline BOOL Get_item_value(trecnum intrec, short itemid, char *value)
{return ::Get_item_value((window_id)m_hWnd, intrec, itemid, value);}
inline BOOL Get_view_pos(trecnum * irec, trecnum * erec)
{return ::Get_view_pos((window_id)m_hWnd, irec, erec);}
inline BOOL Print_opt()
{return ::Print_opt((window_id)m_hWnd);}
inline BOOL Print_optEx(BOOL IsLabel)
{return ::Print_optEx((window_id)m_hWnd, IsLabel);}
inline BOOL Register_rec_syn(HWND hWnd2)
{return ::Register_rec_syn(m_hWnd, hWnd2);}
inline BOOL Select_file(char *filename)
{return ::Select_file((window_id)m_hWnd, filename);}
inline BOOL Select_directory(char *filename)
{return ::Select_directory((window_id)m_hWnd, filename);}
inline BOOL Set_ext_pos(trecnum pos, short itemnum = -1)
{return ::Set_ext_pos((window_id)m_hWnd, pos, itemnum);}
inline BOOL Set_int_pos(trecnum pos, short itemnum = -1)
{return ::Set_int_pos((window_id)m_hWnd, pos, itemnum);}
inline BOOL Set_item_value(trecnum intrec, short itemid, const char FAR * value)
{return ::Set_item_value((window_id)m_hWnd, intrec, itemid, value);}
inline BOOL Set_fcursor(tcursnum curs, uns32 flags = 0)
{return ::Set_fcursor((window_id)m_hWnd, curs, flags);}
inline BOOL QBE_state()
{return ::QBE_state(m_hWnd);}
inline short Current_item()
{return ::Current_item((window_id)m_hWnd);}
inline void Close_view()
{::Close_view((window_id)m_hWnd);}
inline void Draw_line(short x1, short y1, short x2, short y2, short colour)
{::Draw_line((window_id)m_hWnd, x1, y1, x2, y2, colour);}
inline void Pick_window()
{::Pick_window((window_id)m_hWnd);}
inline void Printer_dialog()
{::Printer_dialog((window_id)m_hWnd);}
inline void Put_pixel(short x, short y, short colour)
{::Put_pixel((window_id)m_hWnd, x, y, colour);}
inline void Reset_view(trecnum rec = -1, WORD reload = RESET_CONTROLS)
{::Reset_view((window_id)m_hWnd, rec, reload);}
inline void Roll_back_view()
{::Roll_back_view(m_hWnd);}
inline HWND ActWnd()
{return (HWND)::SendMessage(::GetParent(m_hWnd), WM_MDIGETACTIVE, 0, 0);}
inline void FirstRec()
{::SendMessage(ActWnd(), SZM_FIRSTREC, 0, 0);}
inline void LastRec()
{::SendMessage(ActWnd(), SZM_LASTREC, 0, 0);}
inline void NextRec()
{::SendMessage(ActWnd(), SZM_NEXTREC, 0, 0);}
inline void PrevRec()
{::SendMessage(ActWnd(), SZM_PREVREC, 0, 0);}
inline void NextPage()
{::SendMessage(ActWnd(), SZM_NEXTPAGE, 0, 0);}
inline void PrevPage()
{::SendMessage(ActWnd(), SZM_PREVPAGE, 0, 0);}
inline void FirstItem()
{::SendMessage(ActWnd(), SZM_FIRSTITEM, 0, 0);}
inline void LastItem()
{::SendMessage(ActWnd(), SZM_LASTITEM, 0, 0);}
inline void NextTab()
{::SendMessage(ActWnd(), SZM_NEXTTAB, 0, 0);}
inline void PrevTab()
{::SendMessage(ActWnd(), SZM_PREVTAB, 0, 0);}
inline void UpItem()
{::SendMessage(ActWnd(), SZM_UPITEM, 0, 0);}
inline void DownItem()
{::SendMessage(ActWnd(), SZM_DOWNITEM, 0, 0);}
inline void OpenQBE()
{::SendMessage(ActWnd(), SZM_QBE, 0, 0);}
inline void OpenSort()
{::SendMessage(ActWnd(), SZM_ORDER, 0, 0);}
inline void AcceptQuery()
{::SendMessage(ActWnd(), SZM_ACCEPT_Q, 0, 0);}
inline void CancelQuery()
{::SendMessage(m_hWnd, SZM_UNLIMIT, 0, 0);}
inline void Cut()
{::SendMessage(ActWnd(), WM_CUT, 0, 0);}
inline void Copy()
{::SendMessage(ActWnd(), WM_COPY, 0, 0);}
inline void Paste()
{::SendMessage(ActWnd(), WM_PASTE, 0, 0);}
inline void EditFind()
{::SendMessage(ActWnd(), MI_FSED_FIND, 0, 0);}
inline void EditFormat()
{::SendMessage(ActWnd(), MI_FSED_FORMAT, 0, 0);}
inline void EditRefind()
{::SendMessage(ActWnd(), MI_FSED_REFIND, 0, 0);}
inline void EditReplace()
{::SendMessage(ActWnd(), MI_FSED_REPLACE, 0, 0);}
inline void EditSave()
{::SendMessage(ActWnd(), MI_FSED_SAVE, 0, 0);}
inline void Insert()
{::SendMessage(m_hWnd, SZM_INSERT, 0, 0);}
inline void DelAsk()
{::SendMessage(m_hWnd, SZM_DELASK, 0, 0);}
inline void DelRec()
{::SendMessage(m_hWnd, SZM_DELREC, 0, 0);}
inline void UnbindDel()
{::SendMessage(m_hWnd, SZM_UNBINDDEL, 0, 0);}
inline void Print()
{::SendMessage(m_hWnd, SZM_PRINT, 0, 0);}
inline void MultiAttrs()
{::SendMessage(m_hWnd, SZM_INDEX, 0, 0);}
inline void Help()
{::SendMessage(ActWnd(), SZM_HELP, 0, 0);}
inline void Locks()
{::SendMessage(m_hWnd, SZM_LOCKS, 0, 0);}
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWBViewWnd)
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
WNDPROC ViewWndProc;
HMENU m_hMenu;
virtual WNDPROC *GetSuperWndProcAddr(){return &ViewWndProc;}
virtual void OnUpdateFrameMenu(BOOL bActive, CWnd* pActivateWnd, HMENU hMenuAlt);
virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult );
// Generated message map functions
//{{AFX_MSG(CWBViewWnd)
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CWBModalViewWnd frame
class CWBModalViewWnd : public CFrameWnd
{
DECLARE_DYNCREATE(CWBModalViewWnd)
protected:
// protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
CWBModalViewWnd(){ViewWndProc = NULL;}
BOOL Open(const char *ViewDef, tcursnum Base = NO_REDIR, uns32 Flags = 0,
trecnum Pos = 0, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Open_query_view(const char * ViewDef, tcursnum Base = NO_REDIR, BOOL Order = FALSE,
char *Query = NULL, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Select_records(const char *ViewDef, tcursnum Base, uns32 Flags,
short Limit, trecnum *Bindl, FARPROC Filter = NULL, CWBViewWnd *ParWnd = NULL);
BOOL Relate_record(const char *LocalAttr, const char *ViewDef, tcursnum Base = NO_REDIR, uns32 Flags = 0, FARPROC Filter = NULL,
const char *RemoteAttr = NULL);
inline BOOL Active_view()
{m_hWnd = ::Active_view(); return (BOOL)m_hWnd;}
inline BOOL Commit_view(BOOL CanAsk, BOOL ReportError)
{return ::Commit_view(m_hWnd, CanAsk, ReportError);}
inline BOOL Get_fcursor(tcursnum * curs, WORD * flags)
{return ::Get_fcursor((window_id)m_hWnd, curs, flags);}
inline BOOL Get_fcursor(CWBCursTab * curs, WORD * flags)
{return ::Get_fcursor((window_id)m_hWnd, (tcursnum *)&curs->m_CursTab, flags);}
inline BOOL Get_item_value(trecnum intrec, short itemid, char *value)
{return ::Get_item_value((window_id)m_hWnd, intrec, itemid, value);}
inline BOOL Get_view_pos(trecnum * irec, trecnum * erec)
{return ::Get_view_pos((window_id)m_hWnd, irec, erec);}
inline BOOL Print_opt()
{return ::Print_opt((window_id)m_hWnd);}
inline BOOL Register_rec_syn(HWND hWnd2)
{return ::Register_rec_syn(m_hWnd, hWnd2);}
inline BOOL Select_file(char *filename)
{return ::Select_file((window_id)m_hWnd, filename);}
inline BOOL Select_directory(char *filename)
{return ::Select_directory((window_id)m_hWnd, filename);}
inline BOOL Set_ext_pos(trecnum pos, short itemnum = -1)
{return ::Set_ext_pos((window_id)m_hWnd, pos, itemnum);}
inline BOOL Set_int_pos(trecnum pos, short itemnum = -1)
{return ::Set_int_pos((window_id)m_hWnd, pos, itemnum);}
inline BOOL Set_item_value(trecnum intrec, short itemid, const char FAR * value)
{return ::Set_item_value((window_id)m_hWnd, intrec, itemid, value);}
inline BOOL Set_fcursor(tcursnum curs, uns32 flags = 0)
{return ::Set_fcursor((window_id)m_hWnd, curs, flags);}
inline BOOL QBE_state()
{return ::QBE_state(m_hWnd);}
inline short Current_item()
{return ::Current_item((window_id)m_hWnd);}
inline void Close_view()
{::Close_view((window_id)m_hWnd);}
inline void Draw_line(short x1, short y1, short x2, short y2, short colour)
{::Draw_line((window_id)m_hWnd, x1, y1, x2, y2, colour);}
inline void Pick_window()
{::Pick_window((window_id)m_hWnd);}
inline void Printer_dialog()
{::Printer_dialog((window_id)m_hWnd);}
inline void Put_pixel(short x, short y, short colour)
{::Put_pixel((window_id)m_hWnd, x, y, colour);}
inline void Reset_view(trecnum rec = -1, WORD reload = RESET_CONTROLS)
{::Reset_view((window_id)m_hWnd, rec, reload);}
inline void Roll_back_view()
{::Roll_back_view(m_hWnd);}
inline HWND ActWnd()
{return ::GetActiveWindow();}
inline void FirstRec()
{::SendMessage(ActWnd(), SZM_FIRSTREC, 0, 0);}
inline void LastRec()
{::SendMessage(ActWnd(), SZM_LASTREC, 0, 0);}
inline void NextRec()
{::SendMessage(ActWnd(), SZM_NEXTREC, 0, 0);}
inline void PrevRec()
{::SendMessage(ActWnd(), SZM_PREVREC, 0, 0);}
inline void NextPage()
{::SendMessage(ActWnd(), SZM_NEXTPAGE, 0, 0);}
inline void PrevPage()
{::SendMessage(ActWnd(), SZM_PREVPAGE, 0, 0);}
inline void FirstItem()
{::SendMessage(ActWnd(), SZM_FIRSTITEM, 0, 0);}
inline void LastItem()
{::SendMessage(ActWnd(), SZM_LASTITEM, 0, 0);}
inline void NextTab()
{::SendMessage(ActWnd(), SZM_NEXTTAB, 0, 0);}
inline void PrevTab()
{::SendMessage(ActWnd(), SZM_PREVTAB, 0, 0);}
inline void UpItem()
{::SendMessage(ActWnd(), SZM_UPITEM, 0, 0);}
inline void DownItem()
{::SendMessage(ActWnd(), SZM_DOWNITEM, 0, 0);}
inline void OpenQBE()
{::SendMessage(ActWnd(), SZM_QBE, 0, 0);}
inline void OpenSort()
{::SendMessage(ActWnd(), SZM_ORDER, 0, 0);}
inline void AcceptQuery()
{::SendMessage(ActWnd(), SZM_ACCEPT_Q, 0, 0);}
inline void CancelQuery()
{::SendMessage(m_hWnd, SZM_UNLIMIT, 0, 0);}
inline void Cut()
{::SendMessage(ActWnd(), WM_CUT, 0, 0);}
inline void Copy()
{::SendMessage(ActWnd(), WM_COPY, 0, 0);}
inline void Paste()
{::SendMessage(ActWnd(), WM_PASTE, 0, 0);}
inline void EditFind()
{::SendMessage(ActWnd(), MI_FSED_FIND, 0, 0);}
inline void EditFormat()
{::SendMessage(ActWnd(), MI_FSED_FORMAT, 0, 0);}
inline void EditRefind()
{::SendMessage(ActWnd(), MI_FSED_REFIND, 0, 0);}
inline void EditReplace()
{::SendMessage(ActWnd(), MI_FSED_REPLACE, 0, 0);}
inline void EditSave()
{::SendMessage(ActWnd(), MI_FSED_SAVE, 0, 0);}
inline void Insert()
{::SendMessage(m_hWnd, SZM_INSERT, 0, 0);}
inline void DelAsk()
{::SendMessage(m_hWnd, SZM_DELASK, 0, 0);}
inline void DelRec()
{::SendMessage(m_hWnd, SZM_DELREC, 0, 0);}
inline void UnbindDel()
{::SendMessage(m_hWnd, SZM_UNBINDDEL, 0, 0);}
inline void Print()
{::SendMessage(m_hWnd, SZM_PRINT, 0, 0);}
inline void MultiAttrs()
{::SendMessage(m_hWnd, SZM_INDEX, 0, 0);}
inline void Help()
{::SendMessage(ActWnd(), SZM_HELP, 0, 0);}
inline void Locks()
{::SendMessage(m_hWnd, SZM_LOCKS, 0, 0);}
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWBModalViewWnd)
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
WNDPROC ViewWndProc;
virtual WNDPROC *GetSuperWndProcAddr(){return &ViewWndProc;}
virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult );
afx_msg LRESULT OnDisableModal(WPARAM, LPARAM){return TRUE;}
// Generated message map functions
//{{AFX_MSG(CWBModalViewWnd)
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CWBAuxMDIWnd frame
class CWBAuxMDIWnd : public CMDIChildWnd
{
DECLARE_DYNCREATE(CWBAuxMDIWnd)
protected:
// protected constructor used by dynamic creation
CWBAuxMDIWnd(){OrigWndProc = NULL;}
// Attributes
public:
// Operations
public:
inline BOOL QBE_state()
{return ::QBE_state(m_hWnd);}
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWBAuxMDIWnd)
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
WNDPROC OrigWndProc;
virtual WNDPROC *GetSuperWndProcAddr(){return &OrigWndProc;}
// Generated message map functions
//{{AFX_MSG(CWBAuxMDIWnd)
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
friend class CWBFrameWnd;
};
/////////////////////////////////////////////////////////////////////////////
#endif // __WBMFC__