Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ExbookAdminDoc.cpp
Package: code_and_note_of_COM.rar [view]
Upload User: weisheen
Upload Date: 2022-07-09
Package Size: 19390k
Code Size: 3k
Category:
ActiveX-DCOM-ATL
Development Platform:
Visual C++
- // ExbookAdminDoc.cpp : implementation of the CExbookAdminDoc class
- //
- #include "stdafx.h"
- #include "ExbookAdmin.h"
- #include "ExbookAdminDoc.h"
- #include <atlbase.h>
- #include "../BooksDAL/BooksDAL_i.c"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CExbookAdminDoc
- IMPLEMENT_DYNCREATE(CExbookAdminDoc, CDocument)
- BEGIN_MESSAGE_MAP(CExbookAdminDoc, CDocument)
- //{{AFX_MSG_MAP(CExbookAdminDoc)
- // 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()
- /////////////////////////////////////////////////////////////////////////////
- // CExbookAdminDoc construction/destruction
- CExbookAdminDoc::CExbookAdminDoc()
- {
- // TODO: add one-time construction code here
- }
- CExbookAdminDoc::~CExbookAdminDoc()
- {
- }
- BOOL CExbookAdminDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
- CComPtr<IDALMyBools> mytools;
- mytools.CoCreateInstance(CLSID_DALMyBools);
- DTOBook* pAllBooks=NULL;
- UINT iSize=0;
- mytools->put_DataSource(::SysAllocString(L"tarena"));
- mytools->put_UID(::SysAllocString(L"scott"));
- mytools->put_PWD(::SysAllocString(L"tiger"));
- mytools->QueryAllBook(&pAllBooks,&iSize);
- for(int i=0;i<iSize;i++)
- {
- BookEntity* p1=new BookEntity;
- p1->BookIsnb=(pAllBooks+i)->BookIsnb;
- p1->BookName=CString((pAllBooks+i)->BookName);
- p1->BookAuthor=CString((pAllBooks+i)->BookAuthor);
- //CString类型用完要释放掉
- ::SysFreeString((pAllBooks+i)->BookName);
- ::SysFreeString((pAllBooks+i)->BookAuthor);
- this->allBooks.AddTail(p1);
- }
- ::CoTaskMemFree(pAllBooks);
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CExbookAdminDoc serialization
- void CExbookAdminDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- // CExbookAdminDoc diagnostics
- #ifdef _DEBUG
- void CExbookAdminDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CExbookAdminDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CExbookAdminDoc commands