1,183
社区成员
发帖
与我相关
我的任务
分享
/////////////////////////////////////////////////////////////////////////////
//调用DuoDLL 080403
typedef int (__stdcall *ReadDuoIniA)(char *);
typedef char * (__stdcall *DuoDirectoryA)(HANDLE);
typedef (__stdcall *DuoCOMA)(HANDLE);
/*typedef char * (__stdcall *MyTestA)(char *);
typedef char * (__stdcall *DuoDirA)(char *,int,int);
typedef (__stdcall *DuoAsf2AviA)(char *);
*/
/////////////////////////////////////////////////////////////////////////////
// CTouchDCApp
BEGIN_MESSAGE_MAP(CTouchDCApp, CWinApp)
//{{AFX_MSG_MAP(CTouchDCApp)
//}}AFX_MSG_MAP
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTouchDCApp construction
CTouchDCApp::CTouchDCApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CTouchDCApp object
CTouchDCApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CTouchDCApp initialization
BOOL CTouchDCApp::InitInstance()
{
AfxEnableControlContainer();//包含ActiveX
CTouchDCDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
return FALSE;
}
//exp.
// Duo_CommDebug=theApp.ReadDuoIni("CommDebug");
int CTouchDCApp::ReadDuoIni(CString sName)
{
ReadDuoIniA aa;
HINSTANCE h=LoadLibrary("DuoDLL.dll");
aa=(ReadDuoIniA)GetProcAddress(h,"ReadDuoIniA");
char *cc=(char *)(LPCTSTR)sName;
return aa(cc);
}
/*
void CTouchDCApp::MyTest(CString AStr)
{
MyTestA aa;
HINSTANCE h=LoadLibrary("DuoDLL.dll");
aa=(MyTestA)GetProcAddress(h,"MyTestA");
char *cc=(char *)(LPCTSTR)AStr;
aa(cc);
}
*/
//exp.
//sPath=theApp.DuoDirectory(theApp.GetMainWnd()->GetSafeHwnd());
CString CTouchDCApp::DuoDirectory(HANDLE hh)
{
DuoDirectoryA aa;
HINSTANCE h=LoadLibrary("DuoDLL.dll");
aa=(DuoDirectoryA)GetProcAddress(h,"DuoDirectoryA");
return aa(hh);
}
void CTouchDCApp::DuoCOM(HANDLE hh)
{
DuoCOMA aa;
HINSTANCE h=LoadLibrary("DuoDLL.dll");
aa=(DuoCOMA)GetProcAddress(h,"DuoCOMA");
aa(hh);
}
function ReadDuoIniA(AName:PChar):Integer;stdcall;
var s:String;
begin
s:=StrPas(AName);
Result:=ReadIni(s);
end;