2015-06-25 16:41
下面的是vc6中创建的dll程序|@||@|// TestDll2QT.cpp : Defines the initialization routines for the DLL.|@|//|@||@|#include "stdafx.h"|@|#include "TestDll2QT.h"|@|#include "SetUp.h"|@||@||@|#ifdef _DEBUG|@|#define new DEBUG_NEW|@|#undef THIS_FILE|@|static char THIS_FILE[] = __FILE__;|@|#endif|@||@||@|int __stdcall CatchPhoto_SetUp()|@|//int CatchPhoto_SetUp()|@|{|@| CSetUp dlg;|@||@| BEGIN_DLL_RESOURCE|@||@| dlg.DoModal();|@||@| END_DLL_RESOURCE|@||@| return 1;|@|}|@||@||@|/|@||@|// TestDll2QT.h : main header file for the TESTDLL2QT DLL|@|//|@||@|#if !defined(AFX_TESTDLL2QT_H__BA38A950_47AE_4460_A330_98A0067A5E97__INCLUDED_)|@|#define AFX_TESTDLL2QT_H__BA38A950_47AE_4460_A330_98A0067A5E97__INCLUDED_|@||@|#if _MSC_VER > 1000|@|#pragma once|@|#endif // _MSC_VER > 1000|@||@|#ifndef __AFXWIN_H__|@| #error include 'stdafx.h' before including this file for PCH|@|#endif|@||@||@|#ifdef _AFIS_CATCH_PHOTO_DLL_|@|#define AFIS_CATCH_PHOTO_EXPORT __declspec(dllexport)|@|#else|@|#define AFIS_CATCH_PHOTO_EXPORT __declspec(dllimport)|@|#endif|@||@|//extern "C" _declspec(dllexport) CatchPhoto_SetUp();|@||@|int AFIS_CATCH_PHOTO_EXPORT __stdcall CatchPhoto_SetUp();|@||@|//`AFX_INSERT_LOCATION`|@|// Microsoft Visual C++ will insert additional declarations immediately before the previous line.|@||@|#endif // !defined(AFX_TESTDLL2QT_H__BA38A950_47AE_4460_A330_98A0067A5E97__INCLUDED_)|@||@||@|///|@||@|// SetUp.cpp : implementation file|@|//|@||@|#include "stdafx.h"|@|#include "TestDll2QT.h"|@|#include "SetUp.h"|@||@|#ifdef _DEBUG|@|#define new DEBUG_NEW|@|#undef THIS_FILE|@|static char THIS_FILE[] = __FILE__;|@|#endif|@||@|/|@|// CSetUp dialog|@||@||@|CSetUp::CSetUp(CWnd* pParent /*=NULL*/)|@| : CDialog(CSetUp::IDD, pParent)|@|{|@| //{{AFX_DATA_INIT(CSetUp)|@| // NOTE: the ClassWizard will add member initialization here|@| //}}AFX_DATA_INIT|@|}|@||@||@|void CSetUp::DoDataExchange(CDataExchange* pDX)|@|{|@| CDialog::DoDataExchange(pDX);|@| //{{AFX_DATA_MAP(CSetUp)|@| // NOTE: the ClassWizard will add DDX and DDV calls here|@| //}}AFX_DATA_MAP|@|}|@||@||@|BEGIN_MESSAGE_MAP(CSetUp, CDialog)|@| //{{AFX_MSG_MAP(CSetUp)|@| ON_WM_DESTROY()|@| ON_WM_CLOSE()|@| ON_WM_SIZE()|@| //}}AFX_MSG_MAP|@|END_MESSAGE_MAP()|@||@|/|@|// CSetUp message handlers|@||@|void CSetUp::OnDestroy() |@|{|@| AfxMessageBox("OnDestroy 1");|@||@| CDialog::OnDestroy();|@| |@| AfxMessageBox("OnDestroy 2");|@| |@|}|@||@|BOOL CSetUp::OnInitDialog() |@|{|@| CDialog::OnInitDialog();|@| |@| AfxMessageBox("OnInitDialog");|@| |@| return TRUE; // return TRUE unless you set the focus to a control|@| // EXCEPTION: OCX Property Pages should return FALSE|@|}|@||@|void CSetUp::OnClose() |@|{|@| AfxMessageBox("OnClose 1");|@| |@| CDialog::OnClose();|@||@| AfxMessageBox("OnClose 2");|@|}|@||@|void CSetUp::OnSize(UINT nType, int cx, int cy) |@|{|@| static s_count = 0;|@| s_count++;|@| |@| char buff[32];|@| sprintf(buff, "OnSize1: %d", s_count);|@| AfxMessageBox(buff);|@||@| CDialog::OnSize(nType, cx, cy);|@| |@| sprintf(buff, "OnSize2: %d", s_count);|@| AfxMessageBox(buff);|@|}|@||@||@||@||@|#if !defined(AFX_SETUP_H__B0E66929_5B48_4C53_B505_755051E48FA2__INCLUDED_)|@|#define AFX_SETUP_H__B0E66929_5B48_4C53_B505_755051E48FA2__INCLUDED_|@||@|#if _MSC_VER > 1000|@|#pragma once|@|#endif // _MSC_VER > 1000|@|// SetUp.h : header file|@|//|@||@|/|@|// CSetUp dialog|@|#include "resource.h"|@||@|class CSetUp : public CDialog|@|{|@|// Construction|@|public:|@| CSetUp(CWnd* pParent = NULL); // standard constructor|@||@|// Dialog Data|@| //{{AFX_DATA(CSetUp)|@| enum { IDD = IDD_DIALOG1 };|@| // NOTE: the ClassWizard will add data members here|@| //}}AFX_DATA|@||@||@|// Overrides|@| // ClassWizard generated virtual function overrides|@| //{{AFX_VIRTUAL(CSetUp)|@| protected:|@| virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support|@| //}}AFX_VIRTUAL|@||@|// Implementation|@|protected:|@||@| // Generated message map functions|@| //{{AFX_MSG(CSetUp)|@| afx_msg void OnDestroy();|@| virtual BOOL OnInitDialog();|@| afx_msg void OnClose();|@| afx_msg void OnSize(UINT nType, int cx, int cy);|@| //}}AFX_MSG|@| DECLARE_MESSAGE_MAP()|@|};|@||@|//`AFX_INSERT_LOCATION`|@|// Microsoft Visual C++ will insert additional declarations immediately before the previous line.|@||@|#endif // !defined(AFX_SETUP_H__B0E66929_5B48_4C53_B505_755051E48FA2__INCLUDED_)|@|
回复
点赞
删除