There is a good document to help us about this -- http://zabkat.com/blog/send-emails-with-CDOSYS.htm. You can get first view about this. And there is some sample code in the
http://www.experts-exchange.com/Programming/System/Windows__Programming/A_1820-Sending-Email-with-MAPI.html.
The easiest way is mailto..You can check http://msdn.microsoft.com/en-us/library/aa767737(VS.85).aspx.
The common way is Microsoft MAPI..http://msdn.microsoft.com/en-us/library/windows/desktop/dd296734(v=vs.85).aspx
Anyway..From the MS document..It say..[The use of Simple MAPI is discouraged. It may be altered or unavailable in subsequent versions of Windows.]
Anyway, the MAPI still work in the Win 7/Win 8. But sometime, it will return MAPI_E_FAILURE. Then you can check your application UAC setting. You can check here (http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/63e9f5b2-f5f2-4cf8-bdc2-ca1fad88ebe5).
2013年1月10日 星期四
2013年1月7日 星期一
PHP run executable file in the xampp of Windows
There is the document talk about this -- http://php.net/manual/en/function.exec.php
<?php function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
} ?>
And there is also another document talk about this -- http://www.somacon.com/p395.php. In this document , it provide many methods to do this. And after my try, pclose(popen("start /B ". " c:\\new\\New2.bat", "r")); is workable.
For more information, you can check http://php.net/manual/en/function.popen.php.
<?php function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
} ?>
And there is also another document talk about this -- http://www.somacon.com/p395.php. In this document , it provide many methods to do this. And after my try, pclose(popen("start /B ". " c:\\new\\New2.bat", "r")); is workable.
For more information, you can check http://php.net/manual/en/function.popen.php.
2012年12月28日 星期五
How to create CMFCPropertySheet
1. First, "Project" -> "Class Wizard.."->"Add Class" --> Select "CPropertyPage". If you select "CMFCPropertyPage", it will get error, when you run it.
2.After class was created, we replace all "CPropertyPage" by "CMFCPropertyPage".
3. Add CMFCPropertySheet class. And add the code.
CMySheet.h
public:
CMySheet();
virtual ~CMySheet();
CMyPage m_page1;
CMySheet.cpp
CMySheet::CMySheet()
{
AddPage(&m_page1);
}
4.
//Cf9Dlg dlg;
CMySheet dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
-----------------------
1. The first step, we can check http://msdn.microsoft.com/en-us/library/bb981937.aspx about the MSDN CMFCCpropertySheet Class information (Remarks).
2. We can try to find the information in the http://support.microsoft.com/kb/325613/en-us to know how to add the CPropertySheet and CPropertyPage.
3. There is the http://blog.163.com/xu_chao2000/blog/static/277706102010430338431/ for the CMFCPropertySheet and CMFCPropertyPage. You will need to create new DIALOG resource to add "CPropertyPage" base class, because the Visual studio has the problem to use "CMFCPropertyPage" as the base class. After add OK, then change it to "CMFCPropertyPage".
4. More information about CMFCPropertySheet -- http://blog.csdn.net/tory75034/article/details/5404061
2012年12月26日 星期三
About National Language Support
The msdn document http://msdn.microsoft.com/en-us/library/dd317708(v=vs.85).aspx .
The National Language Support (NLS) functions permit applications to:
- Set the locale for the user
- Identify the language in which the user works
- Retrieve strings representing times, dates, and other information formatted correctly for the specified language and locale
There is also the http://stackoverflow.com/questions/953416/find-out-the-language-windows-was-installed-as talk about this. Two ways to get the OS installed language
1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language\InstallLanguage which returns a four digit language code.
2. The Win32 function is GetSystemDefaultUILanguage() http://msdn.microsoft.com/en-us/library/dd318123(VS.85).aspx.
1. Locale IDs, Input Locales, and Language Collections for Windows XP and Windows Server 2003.
http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx.
2. Re: How to translate the LANGID into strings. http://www.tech-archive.net/Archive/VisualStudio/microsoft.public.vstudio.general/2004-08/0250.html
TCHAR szName[100];
if ( 0 != GetLocaleInfo( MAKELCID( MAKELANGID( 0x411, 0 ),
SORT_DEFAULT ),
LOCALE_SENGLANGUAGE,
szName, 100 ) )
{
printf( szName );
}
SORT_DEFAULT ),
LOCALE_SENGLANGUAGE,
szName, 100 ) )
{
printf( szName );
}
2012年11月7日 星期三
New a Dialog with CEdit and initial string problem
I want to DoModal() a new dialog with a CEdit, and there is one initial string inside the CEdit. It's not easy to put the string in the CEdit and show it when DoModal(). Anyway, the web link (http://stackoverflow.com/questions/11715888/domodal-does-not-show-dialog-but-does-its-work ) show us how to do it.
2012年11月5日 星期一
HTML can't use WMI(Windows Management Instrumentation)?
It's a Microsoft Windows technology for application easy to get the system information and communicate with the kernel driver. For some information about WMI, please check http://msdn.microsoft.com/en-us/library/windows/desktop/aa394582(v=vs.85).aspx
You can check http://msdn.microsoft.com/en-us/library/windows/desktop/aa384642(v=vs.85).aspx to know "About WMI". We can use VBscript to get the WMI information. But anyway, we can't use HTML to get the WMI information, and it seems only ASP can use WMI.
If we can use the HTML with VBScript page to read WMI information, it will be very powerful. But maybe it will also get some security concern.
Purpose
Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. You can write WMI scripts or applications to automate administrative tasks on remote computers but WMI also supplies management data to other parts of the operating system and products, for example System Center Operations Manager, formerly Microsoft Operations Manager (MOM), or Windows Remote Management (WinRM).
You can check http://msdn.microsoft.com/en-us/library/windows/desktop/aa384642(v=vs.85).aspx to know "About WMI". We can use VBscript to get the WMI information. But anyway, we can't use HTML to get the WMI information, and it seems only ASP can use WMI.
If we can use the HTML with VBScript page to read WMI information, it will be very powerful. But maybe it will also get some security concern.
2012年11月3日 星期六
Putting Controls On Toolbars
You can learn how to add combo box into toolbar by http://msdn.microsoft.com/en-us/library/bb983718.aspx in the MFC project.
There is also the information in the http://msdn.microsoft.com/en-us/library/bb982770.aspx (
CMFCToolBarComboBoxButton Class). It also show some code in the Visual Studio Demo sample of the MFC sample codes. You can build the code and play it.
To add a combo box button to a toolbar, follow these steps:
There is also the information in the http://msdn.microsoft.com/en-us/library/bb982770.aspx (
CMFCToolBarComboBoxButton Class). It also show some code in the Visual Studio Demo sample of the MFC sample codes. You can build the code and play it.
To add a combo box button to a toolbar, follow these steps:
1. Reserve a dummy resource ID for the button in the parent toolbar resource.
2. Construct a CMFCToolBarComboBoxButton object.
3. In the message handler that processes the AFX_WM_RESETTOOLBAR message, replace the dummy button with the new combo box button by usingCMFCToolBar::ReplaceButton.
But anyway, it can't work. It take me several days to check this problem. After all, I find we can add m_wndToolBar.ResetAll (); in the SHOWMESSAGE or SIZE message to solve this problem.
訂閱:
文章 (Atom)
