??????C???
????????????????????????IPage??????IDocument??????ITextUnit??????IPage?????????????????IDocument???????????????????????????????????CreateDoc??DestroyDoc??????????????IDocument??????????????????????????(C????????)??????????????C????????(??????)????????????£?
#pragma once
#include "IDocument.h"
#include "IPage.h"
#include "ITextUnit.h"
//===============================================================
//????????????????????????????????STATIC_LIBRARY????????????????STATIC_LIBRARY??
//????????????????????????????????EXPORT????????????????ü?
//===============================================================
#ifdef EXPORT   //??????
#define _API_  __declspec(dllexport)
#else           //?????
#define _API_  __declspec(dllimport)
#endif  //EXPORT
#ifdef STATIC_LIBRARY   //?????????
#define EBAPI int
#else                   //?????????
#define EBAPI extern "C" _API_ int
#endif  //STATIC_LIBRARY
//---------------------------------------------------------------
//function:
//      CreateDoc ????Document????
//Access:
//       public
//Parameter:
//      [in] IDocument * & pDocument -
//Returns:
//      EBAPI -
//Remarks:
//      ...
//author:    luowf[/luoweifu]
//---------------------------------------------------------------
EBAPI CreateDoc(IDocument*& pDocument);
//---------------------------------------------------------------
//function:
//      DestroyDoc ???????Document????
//Access:
//       public
//Parameter:
//      [in] IDocument * pDocument -
//Returns:
//      EBAPI -
//Remarks:
//      ...
//author:    luowf[/luoweifu]
//---------------------------------------------------------------
EBAPI DestroyDoc(IDocument* pDocument);
????????
????????????EBook?????????????????????????μ???????????EBook?????????

????
?3?? ????????(?????????к?????е?EXPORT_STATIC?????????STATIC_LIBRARY??)

????????????μ????UseEBook???EBook??UseEBook?????????
????Generation PropertiesC++PreprocessPreprocess Definitions:STATIC_LIBRARY
????Generation PropertiesLinkerGeneralAddtional Library Directories:lib??????·??
????Generation PropertiesLinkerInputAddtional Dependencies:EBook.lib
???????????
#include "stdafx.h"
#include <iostream>
int _tmain(int argc?? _TCHAR* argv[])
{
IDocument* pDoc = NULL;
if(CreateDoc(pDoc) != 0)
{
return -1;
}
IPage* pPage = pDoc->AddPage();
ITextUnit* pTextUnit = pPage->AddTextUnit();
std::cout << pTextUnit->GetId() << std::endl;
DestroyDoc(pDoc);
return 0;
}