extern short _callback ConfirmCallBack(char far * str) { if (str!=NULL) { if
(MessageBox(NULL,str,"Backup",MB_YESNO|MB_ICONQUES TION) == IDYES) { return 1; } } return 0; }

extern short _callback MessageCallBack (char far * str) { if (str!=NULL) { } return 0; }

extern short _callback StatusCallBack (char far * str) { if (str!=NULL) { } return 0; }

extern short _callback ErrorCallBack (char far * str) { if (str!=NULL) { } return 0; }

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {

a_backup_db backup_info; a_dbtools_info dbtinfo; char dir_name[MAX_PATH+1]; char
connect[256]; char *command; HINSTANCE hinst; FARPROC dbbackup; FARPROC dbtoolsinit; FARPROC
dbtoolsfini;

memset (&backup_info,0,sizeof(a_backup_db)); memset (&dbtinfo,0,sizeof(a_dbtools_info));
backup_info.version=DB_TOOLS_VERSION_NUMBER; backup_info.quiet=0; backup_info.no_confirm=0;
backup_info.confirmrtn=(MSG_CALLBACK)ConfirmCallBa ck;
backup_info.errorrtn=(MSG_CALLBACK)ErrorCallBack;
backup_info.msgrtn=(MSG_CALLBACK)MessageCallBack;
backup_info.statusrtn=(MSG_CALLBACK)StatusCallBack ;
backup_info.output_dir="e:\\SybaseDBTools\\BackupD ir";
backup_info.connectparms="UID=dba;PWD=SQL;DBF=e:\\ SybaseDBTools\\Data base\\Database.db";
backup_info.startline=""; backup_info.backup_database=1; backup_info.backup_logfile=1;
backup_info.backup_writefile=0; backup_info.rename_log=0; backup_info.truncate_log=0;

hinst=LoadLibrary("dbtool7.dll");

if (hinst==NULL) { return 0; }

dbbackup = GetProcAddress( (HMODULE)hinst, "_DBBackup@4" );
dbtoolsinit = GetProcAddress( (HMODULE)hinst, "_DBToolsInit@4" );
dbtoolsfini = GetProcAddress( (HMODULE)hinst, "_DBToolsFini@4" );
(*dbtoolsinit)( &dbtinfo );
(*dbbackup)( &backup_info );
(*dbtoolsfini)( &dbtinfo );

FreeLibrary(hinst);

return 0; }


When I use this code, I get access violation. Is there something I need to do that Iam missing out? Any advice would be greatly appreciated.

Thanks in advance.