• 大小: 1.39M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-16
  • 语言: C#
  • 标签: ezcad  cad  金橙子  CA  AD  

资源简介

金橙子EZcad3软件包

资源截图

代码片段和文件信息

// D:\项目\EzCad3_VS2015\EzCad3_VS2015\DialogIssue.cpp : 实现文件
//

#include “stdafx.h“
#include “EzCad3_VS2015.h“
#include “DialogIssue.h“
#include “afxdialogex.h“
#include “qglobal.h“

// CDialogIssue 对话框

IMPLEMENT_DYNAMIC(CDialogIssue CDialogEx)

CDialogIssue::CDialogIssue(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_DIALOG_ISSUE pParent)
{
m_nMarkerId = 0;
}

CDialogIssue::~CDialogIssue()
{
}

void CDialogIssue::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDialogIssue CDialogEx)
ON_BN_CLICKED(IDC_BUTTON_SAVETOFILE &CDialogIssue::OnBnClickedButtonSavetofile)
ON_BN_CLICKED(IDCANCEL &CDialogIssue::OnBnClickedCancel)
ON_BN_CLICKED(IDC_BUTTON_EMAIL &CDialogIssue::OnBnClickedButtonEmail)
END_MESSAGE_MAP()

#include “mapi.h“   
// CDialogIssue 消息处理程序
void SendMail(CString strEmailAddressCString strSubjectCString strMsgCString strSenderCString strFile )

//装入MAPI32.DLL动态库
HMODULE hMod = LoadLibrary(_T(“MAPI32.DLL“));
if (hMod == NULL)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_LOAD);
return;
}

//获取发送邮件的函数地址
ULONG(PASCAL *lpfnSendMail)(ULONG ULONG MapiMessage* FLAGS ULONG);
(FARPROC&)lpfnSendMail = GetProcAddress(hMod “MAPISendMail“);

if (lpfnSendMail == NULL)
{
AfxMessageBox(AFX_IDP_INVALID_MAPI_DLL);
return;
}


char* pstrEmailAddress = QGlobal::gf_StrToCharDelBuf(strEmailAddress);
char* pstrSubject = QGlobal::gf_StrToCharDelBuf(strSubject);
char* pstrMsg = QGlobal::gf_StrToCharDelBuf(strMsg);
char* pstrSender = QGlobal::gf_StrToCharDelBuf(strSender);
char* pstrFile = QGlobal::gf_StrToCharDelBuf(strFile);


int nFileCount =1;   //有多少个附件需要发送

  //分配内存保存附件信息 不能使用静态数组,因为不知道要发送附件的个数
MapiFileDesc* pFileDesc = (MapiFileDesc*)malloc(sizeof(MapiFileDesc) * nFileCount);
memset(pFileDesc 0 sizeof(MapiFileDesc) * nFileCount); 

//分配内存保存附件文件路径
TCHAR* pTchPath = (TCHAR*)malloc(MAX_PATH * nFileCount);

CString szText;
for (int i = 0; i < nFileCount; i++)
{
TCHAR* p = pTchPath + MAX_PATH * i;  
(pFileDesc + i)->nPosition = (ULONG)-1;
(pFileDesc + i)->lpszPathName = pstrFile;
(pFileDesc + i)->lpszFileName = pstrFile;
}

//收件人结构信息
MapiRecipDesc recip;
memset(&recip 0 sizeof(MapiRecipDesc));
recip.lpszAddress = pstrEmailAddress;
recip.ulRecipClass = MAPI_TO;
recip.lpszName = pstrSender;

//邮件结构信息
MapiMessage message;
memset(&message 0 sizeof(message));
message.nFileCount = nFileCount;                         //文件个数
message.lpFiles = pFileDesc;                          //文件信息
message.nRecipCount = 1;                                  //收件人个数
message.lpRecips = &recip;                             //收件人
message.lpszSubject = pstrSubject;           //主题
message.lpszNoteText = pstrMsg;              //正文内容

   //保存本程序窗口指针,因为发完邮件后要返回本程序的窗口
CWnd* pParentWnd = CWnd::GetSafeOwner(NULL NULL);

//发送邮件
int nError = lpfnSendMail(0 0 &message MAPI_LOGON_UI | MAPI_DIALOG 0); 
if (nError != SUCCESS_SUCCESS && nError != MAPI_USER_ABOR

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-21 07:34  EzCad3_VS2015-master\
     文件        2518  2018-11-21 07:34  EzCad3_VS2015-master\.gitattributes
     文件        4305  2018-11-21 07:34  EzCad3_VS2015-master\.gitignore
     文件        6383  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015.sln
     目录           0  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\
     文件        5278  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\DialogIssue.cpp
     文件         564  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\DialogIssue.h
     文件       14792  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\EzCad3_VS2015.cpp
     文件        1221  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\EzCad3_VS2015.h
     文件       83096  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\EzCad3_VS2015.rc
     文件       35942  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\EzCad3_VS2015.vcxproj
     文件       36532  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\EzCad3_VS2015.vcxproj.filters
     文件        5089  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\Ezcad3Doc.cpp
     文件        1087  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\Ezcad3Doc.h
     文件        8889  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\Ezcad3View.cpp
     文件        2044  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\Ezcad3View.h
     目录           0  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\
     文件        3260  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitor.cpp
     文件         951  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitor.h
     文件        3112  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorFiber.cpp
     文件         648  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorFiber.h
     文件        2504  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorQcw.cpp
     文件         598  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorQcw.h
     文件        2100  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorSpi.cpp
     文件         600  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorSpi.h
     文件        2044  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorYag.cpp
     文件         622  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\DlgLaserMonitorYag.h
     文件        1499  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\LaserMonitorPanel.cpp
     文件         467  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\LaserMonitor\LaserMonitorPanel.h
     文件       41594  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\MainFrm.cpp
     文件       16103  2018-11-21 07:34  EzCad3_VS2015-master\EzCad3_VS2015\MainFrm.h
............此处省略436个文件信息

评论

共有 条评论