// NIST_Visual_CDlg.h : header file
//

#if !defined(AFX_NIST_VISUAL_CDLG_H__76F4ADCD_66A7_4232_9175_D7D64BC2061F__INCLUDED_)
#define AFX_NIST_VISUAL_CDLG_H__76F4ADCD_66A7_4232_9175_D7D64BC2061F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CNIST_Visual_CDlg dialog

class CNIST_Visual_CDlg : public CDialog
{
// Construction
public:
	CNIST_Visual_CDlg(CWnd* pParent = NULL);	// standard constructor


//==================================================
//==================================================
//==================================================


HINSTANCE hNIST_library;

//NIST library declaration of functions
typedef int (*RegisterNIST)();
typedef int (*CreateNewNISTFile)();
typedef int (*WriteNISTToFile)(const char *filename);
typedef unsigned char* (*ReadNISTByteArray)();
typedef int (*ReadSizeOfNISTByteArray)();
typedef int (*ReadNISTFromFile)(const char *filename);
typedef int (*ReadNISTFromMemory)(unsigned char* input_byte_array, int size_of_input_byte_array);
typedef int (*CheckIfRecordTypeExists)(int record_type_number);
typedef int (*ReadNumberOfRecords)(int record_type_number);
typedef int (*ReadIDCofRecord)(int record_type_number, int record_number);
typedef char* (*ReadRecordTxtField)(int record_type_number, int idc, int record_field_number, const char *record_field_name);
typedef int (*ReadSizeOfRecordTxtField)(int record_type_number, int idc, int record_field_number, const char *record_field_name);
typedef char* (*ReadRecordTxtFieldName)(int record_type_number, int idc, int record_field_number);
typedef int (*ReadSizeOfRecordTxtFieldName)(int record_type_number, int idc, int record_field_number, const char *record_field_name);
typedef char* (*ReadRecordTxtFieldDescription)(int record_type_number, int idc, int record_field_number, const char *record_field_name);
typedef int (*ReadSizeOfRecordTxtFieldDescription)(int record_type_number, int idc, int record_field_number, const char *record_field_name);
typedef char* (*ReadRecordExportedTxtFields)(int record_type_number, int idc);
typedef int (*ReadSizeOfRecordExportedTxtFields)(int record_type_number, int idc);
typedef unsigned char* (*ReadRecordBinaryField)(int record_type_number, int idc);
typedef int (*ReadSizeOfRecordBinaryField)(int record_type_number, int idc);
typedef HBITMAP (*CreateHBITMAPfromRecordBinaryField)(int record_type_number, int idc);
typedef int (*InsertRecordBinaryFieldFromFile)(int record_type_number, int idc, const char *filename);
typedef int (*InsertRecordBinaryFieldFromMemory)(int record_type_number, int idc, unsigned char* input_byte_array, int size_of_input_byte_array, const char* CGA, int CGA_int, int HLL, int VLL);
typedef int (*InsertRecordTxtField)(int record_type_number, int idc, int record_field_number, const char *record_field_name, const char * input_data);
typedef int (*DeleteRecord)(int record_type_number, int idc);




RegisterNIST pRegisterNIST;
CreateNewNISTFile pCreateNewNISTFile;
WriteNISTToFile pWriteNISTToFile;
ReadNISTByteArray pReadNISTByteArray;
ReadSizeOfNISTByteArray pReadSizeOfNISTByteArray;
ReadNISTFromFile pReadNISTFromFile;
ReadNISTFromMemory pReadNISTFromMemory;
CheckIfRecordTypeExists pCheckIfRecordTypeExists;
ReadNumberOfRecords pReadNumberOfRecords;
ReadIDCofRecord pReadIDCofRecord;
ReadRecordTxtField pReadRecordTxtField;
ReadSizeOfRecordTxtField pReadSizeOfRecordTxtField;
ReadRecordTxtFieldName pReadRecordTxtFieldName;
ReadSizeOfRecordTxtFieldName pReadSizeOfRecordTxtFieldName;
ReadRecordTxtFieldDescription pReadRecordTxtFieldDescription;
ReadSizeOfRecordTxtFieldDescription pReadSizeOfRecordTxtFieldDescription;
ReadRecordExportedTxtFields pReadRecordExportedTxtFields;
ReadSizeOfRecordExportedTxtFields pReadSizeOfRecordExportedTxtFields;
ReadRecordBinaryField pReadRecordBinaryField;
ReadSizeOfRecordBinaryField pReadSizeOfRecordBinaryField;
CreateHBITMAPfromRecordBinaryField pCreateHBITMAPfromRecordBinaryField;
InsertRecordBinaryFieldFromFile pInsertRecordBinaryFieldFromFile;
InsertRecordBinaryFieldFromMemory pInsertRecordBinaryFieldFromMemory;
InsertRecordTxtField pInsertRecordTxtField;
DeleteRecord pDeleteRecord;





int ret, n;
FILE *infp, *outfp;
int handle;


wchar_t program_file_path[_MAX_PATH];
wchar_t filedirectory[_MAX_PATH];
wchar_t filename[_MAX_PATH];
char* p_image_compression_code;
char image_compression_code[128];
//char output_message[16384];
wchar_t output_message[16384];
int size;
int idc;
int idc_current;
char* nist_txt_field;
wchar_t* w_nist_txt_field;
int nist_int_field;
//char int_converted_to_string[64];
wchar_t int_converted_to_string[64];
unsigned char* nist_binary_field;
unsigned char* byte_array;
int size_of_byte_array;
int type_2_number_of_records;
int type_3_number_of_records;
int type_4_number_of_records;
int type_5_number_of_records;
int type_6_number_of_records;
int type_7_number_of_records;
int type_8_number_of_records;
int type_9_number_of_records;
int type_10_number_of_records;
int type_13_number_of_records;
int type_14_number_of_records;
int type_15_number_of_records;
int type_16_number_of_records;
int type_17_number_of_records;
int type_99_number_of_records;





HBITMAP hBitmap;
HBITMAP hBitmap2;
CStatic *bitmap;
HCURSOR hcurSave;

//==================================================
//==================================================
//==================================================




// Dialog Data
	//{{AFX_DATA(CNIST_Visual_CDlg)
	enum { IDD = IDD_NIST_VISUAL_C_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNIST_Visual_CDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CNIST_Visual_CDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnOpenButton();
	afx_msg void OnRegisterButton();
	afx_msg void OnCreateAndInsertButton();
	afx_msg void OnReadAndModifyButton();
	afx_msg void OnReadAndExportButton();
	afx_msg void OnReadSingleFieldButton();
	afx_msg void OnDeleteSingleFieldButton();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NIST_VISUAL_CDLG_H__76F4ADCD_66A7_4232_9175_D7D64BC2061F__INCLUDED_)
