; icedll1.def : Declares the module parameters for the DLL.
LIBRARY "icedll1"
DESCRIPTION 'icedll1 Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
ice001 @1
// icedll1.h : main header file for the ICEDLL1 DLL
//
#if !defined(AFX_ICEDLL1_H__77EE0A92_652C_4F52_8E70_61C99796540C__INCLUDED_)
#define AFX_ICEDLL1_H__77EE0A92_652C_4F52_8E70_61C99796540C__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
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CIcedll1App
// See icedll1.cpp for the implementation of this class
//
class CIcedll1App : public CWinApp
{
public:
CIcedll1App();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIcedll1App)
//}}AFX_VIRTUAL
//{{AFX_MSG(CIcedll1App)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ICEDLL1_H__77EE0A92_652C_4F52_8E70_61C99796540C__INCLUDED_)
// icedll1.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "icedll1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs, any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CIcedll1App
BEGIN_MESSAGE_MAP(CIcedll1App, CWinApp)
//{{AFX_MSG_MAP(CIcedll1App)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CIcedll1App construction
CIcedll1App::CIcedll1App()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CIcedll1App object
CIcedll1App theApp;
//iceapi.cpp
#include "stdafx.h"
#include "iceapi.h"
extern "C" __declspec(dllexport)
int WINAPI ice001(char *strResult)
{
AfxMessageBox(strResult);
return (0);
}
先建立个DLL工程,文件基本是这个格式,自己理解一下~ |