控件没有,也不是VC开发的手段。
可以给你例程,Email!
可以给你例程,Email!
解决方案 »
- 如何动态的改变菜单按钮的状态?
- 如何把在数据库里批量修改数据
- 一个简单的问题
- 如寻找D:\XXX\*.*下的所以文件并得到所以文件路径??
- 网络编程
- 怎样启动一个新的exe程序
- 怎样将unsigned __int64 d64 = 0xFFFFFFFFFFFFFFFF;转换为字符串“18446744073709551614”啊?我用_i64toa得到的结果为字符串“-1”?为
- 《深入浅出MFC 2e》第3章的frame7编译出现错误: error C2101: '&' on constant,是怎么回事?
- 各位高人,小弟又麻烦各位了!!
- 关于安讯士摄像机在openCV3.0下viedo capture 连接问题
- 请问cscrollview::gettotalsize()可以用cview的什么函数来代替?
- 关于cview类如何使用滚动条的问题
我请客,
给我来一个:[email protected]
CWhatWereYouDoingDlg dlg1(this);
dlg1.m_strString = m_strWhatWereYouDoing;
if(dlg1.DoModal() == IDOK)
{
m_strWhatWereYouDoing = dlg1.m_strString;
HINSTANCE hMail = NULL;
hMail = ::LoadLibraryA("MAPI32.DLL"); if (hMail == NULL)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_LOAD);
return;
}
ASSERT(hMail != NULL); ULONG (PASCAL *lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
(FARPROC&)lpfnSendMail = GetProcAddress(hMail, "MAPISendMail");
if (lpfnSendMail == NULL)
{
AfxMessageBox(AFX_IDP_INVALID_MAPI_DLL);
return;
}
ASSERT(lpfnSendMail != NULL); // make a recipient
MapiRecipDesc rec;
char szRName[] = "Clever Porgrammer";
char szRAddress[] = "SMTP:[email protected]";
memset(&rec, 0, sizeof(rec));
rec.ulRecipClass = MAPI_TO;
rec.lpszName = szRName;
rec.lpszAddress = szRAddress;
char szSubject[] = "An Exception has occurred";
// prepare the message -----------------------------------------------------
MapiMessage message;
memset(&message, 0, sizeof(message));
message.nRecipCount = 1;
message.lpRecips = &rec;
message.lpszSubject = szSubject; CString s = m_strWhatWereYouDoing;
s += "\n";
PrepareErrorMessage(s); message.lpszNoteText = s.GetBuffer(s.GetLength()); // prepare for modal dialog box
AfxGetApp()->EnableModeless(FALSE);
HWND hWndTop;
CWnd* pParentWnd = CWnd::GetSafeOwner(NULL, &hWndTop); // some extra precautions are required to use MAPISendMail as it
// tends to enable the parent window in between dialogs (after
// the login dialog, but before the send note dialog).
pParentWnd->SetCapture();
::SetFocus(NULL);
pParentWnd->m_nFlags |= WF_STAYDISABLED; int nError = lpfnSendMail(0, (ULONG)pParentWnd->GetSafeHwnd(),
&message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
s.ReleaseBuffer(); // after returning from the MAPISendMail call, the window must
// be re-enabled and focus returned to the frame to undo the workaround
// done before the MAPI call.
::ReleaseCapture();
pParentWnd->m_nFlags &= ~WF_STAYDISABLED; pParentWnd->EnableWindow(TRUE);
::SetActiveWindow(NULL);
pParentWnd->SetActiveWindow();
pParentWnd->SetFocus();
if (hWndTop != NULL)
::EnableWindow(hWndTop, TRUE);
AfxGetApp()->EnableModeless(TRUE); if (nError != SUCCESS_SUCCESS &&
nError != MAPI_USER_ABORT && nError != MAPI_E_LOGIN_FAILURE)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_SEND);
}
::FreeLibrary(hMail);
}
我自己编了一个生成ADO表集类的软件,自动生成,类型自动转换,自动处理连接参数,有谁想要的话,请和我联系,[email protected]