|
Well, what I really want to do is a project which scans an incoming email content and puts it to a folder dependently what the content looks like.
Please give me any suggestions, maybe a piece of code.
Thank you
|
|
|
|
|
Get the Outlook Express ActiveX component. It is available freely for evaluation, and exposes the entire OE Interface for your use. Works much like Word/Excel/Outlook automation objects.
Of course there are alternative, and free, ways to accomplish all this, but it would be much more difficult. Use the ActiveX component, as it is available. Trust me, although the component does cost £19, it will make your work a whole lot easier. Especially if you're trying to build a spam filter or something similar...
Here's a link to the component creator's website: Small Office Solutions Ltd.[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Well, I would rather write it in C++ without using any components(especially in case the component is written in VB). How to check in spy++ what kind of message is comming when an email arrives?
I know there are some products which have control on Outlook, without using any components, so I want to achive the same.
Any more sugestions?
P.S Thank ypu for your help
|
|
|
|
|
Another question. Can I use MAPI to solve the problem?
|
|
|
|
|
Outlook Express does not get notified if there are new messages in the POP3 mailbox (it is Outlook which does get notications), OE rather checks itself the contents of the POP3 mailbox after a user defined time intervall has elapsed.
That means you can programmatically do the same from your own prog, independently of Outlook Express. You can also use for this ready made POP3 classes like
http://www.codeproject.com/internet/win32_pop3.asp
Then analyze the messages in the POP3 mailbox, and also let OE download them.
The data (like user, server name etc.) of the predefined POP3 mailboxes of OE you can find find under HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts
The full path to the message files (like incoming messages, sent messages etc. is under HKEY_CURRENT_USER\Identities\..Identity GUID..\Software\Microsoft\Outlook Express\...Version...\Store Root
Peter Molnar
|
|
|
|
|
Int the following code, I'm overriding CPropertySheet::RemovePage(int nPage)
How can I return a pointer to cdxCDynamicPropPage?
class cdxCDynamicPropSheet:public CPropertySheet {}
class cdxCDynamicPropPage :public CPropertyPage{}
void cdxCDynamicPropSheet::RemovePage( int nPage )
{
ASSERT_VALID(this);
// remove the page externally
if (m_hWnd != NULL)
SendMessage(PSM_REMOVEPAGE, nPage);
cdxCDynamicPropPage* page = ???
page->m_pSheet = NULL;
}
|
|
|
|
|
Use CPropertySheet::GetPage before sending the message to get a pointer to the CPropertyPage . Then use DYNAMIC_DOWNCAST to cast a pointer to your derived cdxDynamicPropPage class.
cdxCDynamicPropPage* pPage = DYNAMIC_DOWNCAST(cdxCDynamicPropPage, this->GetPage(nPage) );<DIV>
SendMessage(PSM_REMOVEPAGE, nPage); Something like that. Remember, though, that a better way would be to call CPropertySheet::RemovePage instead of sending a message. This way, the property page window will be deleted, but the page object would remain, leaving the pointer returned by GetPage valid.
Here is a different implementation of your RemovePage method, which removes a page from a property sheet, and then fiddles with the page object.
void cdxCDynamicPropSheet::RemovePage(int nPage)
{
ASSERT_VALID(this);<DIV>
this->CPropertySheet::RemovePage(nPage);<DIV>
cdxCDynamicPropPage* pRemovedPage = DYNAMIC_DOWNCAST( cdxCDynamicPropPage, this->GetPage(nPage) );<DIV>
ASSERT( pRemovedPage != NULL );<DIV>
pRemovedPage->SomeMethod( someParams );
} Hope this helps.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
It helped Thanks a lot
|
|
|
|
|
BOOL LookupAccountName(
LPCTSTR lpSystemName, // address of string for system name
LPCTSTR lpAccountName, // address of string for account name
PSID Sid, // address of security identifier
LPDWORD cbSid, // address of size of security identifier
LPTSTR ReferencedDomainName,
// address of string for referenced domain
LPDWORD cbReferencedDomainName,
// address of size of domain string
PSID_NAME_USE peUse // address of SID-type indicator
);
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
|
Thank you Michael
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hi,
I've posted a meesage like this about a month ago on this forum, but I didn't get any satisfacting responses; so I'll try again.
I've created a setup prject, with the "Setup Projects" template, this is for an MFC C++ application. The installer works great, but I want to let the user determine wether he wants a shortcut placedn on his desktop\start menu. So I added a new dialog to my project, containing three checBoxes.
But after having done this, I wanted to a some kind of 'link' between checking a checkbox and the creation of a shortcut. If already inserted the shortcuts in the FileSystem tab, but I don't know how to script the decision correctly (I know C and its derivates, not Basic!). I've already looked at the MSDN, but I can't find a nice answer!
The properties of the checkbox are these: (in the user interface editor!) (I haven't included irrelevant properties (irrelevant to me))
CheckBox1Property : CHECKBOXC1
CheckBox1Value : Unchecked
|
|
|
|
|
Hi
You do not have to script anything to do this.
What You do is, create the shortut in the installation project as normal, and in the "Condition" property of the sourtcut write "CHECKBOXC1 = checked".
That's it.
|
|
|
|
|
Thanks, I'll try it
I didn't know it was that simple!
|
|
|
|
|
I jsut tried your solution, but it isn't working, although I entered the text (without the double quotation amrks in the conditions field). I tried it with a capitalized c in checked, and put transitive on true and false.
No combination of it seemed to worrk --> the shortcut was created every time I tried the installer (it should only be created if the checkbox is checked).
|
|
|
|
|
|
Hi
You want to open a folder with a return of a path?
or
Open a folder to make changes to it's attributes?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
If you're talking about opening Window's folder selection dialog, take a look at the ::SHBrowseForFolder() API.
You'll need to include the <Shlwapi.h> header file.
I Dream of Absolute Zero
|
|
|
|
|
Yeah. I really want this function.
But i found this dialog is not similar with use FileDialog(),When i use FileDialog to open a dialog to open a file.
|
|
|
|
|
Grrrr wrote:
But i found this dialog is not similar with use FileDialog(),
Yeah, I know that using the Windows API folder function is not as easy as using MFC's CFileDialog.
However I did recall something here on CP, so a little searching has uncovered
This:[^]
Its a C++ wrapper for the ::SHBrowseForFolder API.
I havent used it myself, but I probably will try it out in my next project.
I Dream of Absolute Zero
|
|
|
|
|
try this class:
------------------------------
DirDialog.h
class CDirDialog
{
public:
CDirDialog();
virtual ~CDirDialog();
BOOL DoBrowse(CWnd *pwndParent = NULL);
CString m_strWindowTitle;
CString m_strPath;
CString m_strInitDir;
CString m_strSelDir;
CString m_strTitle;
int m_iImageIndex;
BOOL m_bStatus;
private:
virtual BOOL SelChanged(LPCSTR lpcsSelection, CString& csStatusText) { return TRUE; };
static int __stdcall CDirDialog::BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
};
------------------------------
DirDialog.cpp
// Callback function called by SHBrowseForFolder's browse control
// after initialization and when selection changes
int __stdcall CDirDialog::BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) {
CDirDialog* pDirDialogObj = (CDirDialog*)lpData;
if (uMsg == BFFM_INITIALIZED) {
if (!pDirDialogObj->m_strSelDir.IsEmpty() )
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(LPCTSTR)(pDirDialogObj->m_strSelDir));
if (!pDirDialogObj->m_strWindowTitle.IsEmpty() )
::SetWindowText(hwnd, (LPCTSTR) pDirDialogObj->m_strWindowTitle);
}
else
if (uMsg == BFFM_SELCHANGED) {
LPITEMIDLIST pidl = (LPITEMIDLIST)lParam;
char selection[MAX_PATH];
if (!::SHGetPathFromIDList(pidl, selection) )
selection[0] = '\0';
CString csStatusText;
BOOL bOk = pDirDialogObj->SelChanged(selection, csStatusText);
if (pDirDialogObj->m_bStatus )
::SendMessage(hwnd, BFFM_SETSTATUSTEXT , 0, (LPARAM)(LPCSTR)csStatusText);
::SendMessage(hwnd, BFFM_ENABLEOK, 0, bOk);
}
return 0;
}
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDirDialog::CDirDialog() {
m_bStatus = FALSE;
}
CDirDialog::~CDirDialog() {
}
BOOL CDirDialog::DoBrowse(CWnd *pwndParent) {
if (!m_strSelDir.IsEmpty()) {
m_strSelDir.TrimRight();
if( m_strSelDir.Right(1) == "\\" || m_strSelDir.Right(1) == "//" )
m_strSelDir = m_strSelDir.Left(m_strSelDir.GetLength() - 1);
}
LPMALLOC pMalloc;
if (SHGetMalloc(&pMalloc) != NOERROR )
return FALSE;
BROWSEINFO bInfo;
LPITEMIDLIST pidl;
ZeroMemory((PVOID)&bInfo, sizeof(BROWSEINFO) );
BOOL bIsRepository(m_strInitDir.IsEmpty() );
if (!m_strInitDir.IsEmpty() ) {
OLECHAR olePath[MAX_PATH];
ULONG chEaten;
ULONG dwAttributes;
HRESULT hr;
LPSHELLFOLDER pDesktopFolder;
//
// Get a pointer to the Desktop's IShellFolder interface.
//
if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder) ) ) {
//
// IShellFolder::ParseDisplayName requires the file name be in Unicode.
//
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
m_strInitDir.GetBuffer(MAX_PATH),
-1,
olePath,
MAX_PATH);
m_strInitDir.ReleaseBuffer(-1);
//
// Convert the path to an ITEMIDLIST.
//
hr = pDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pidl, &dwAttributes);
if (FAILED(hr) ) {
pMalloc->Free(pidl);
pMalloc->Release();
return FALSE;
}
bInfo.pidlRoot = pidl;
}
} else
bInfo.pidlRoot = NULL;
bInfo.hwndOwner = pwndParent == NULL ? NULL : pwndParent->GetSafeHwnd();
bInfo.pszDisplayName = m_strPath.GetBuffer(MAX_PATH);
bInfo.lpszTitle = (m_strTitle.IsEmpty()) ? "Open" : m_strTitle;
bInfo.ulFlags = BIF_RETURNFSANCESTORS
| BIF_RETURNONLYFSDIRS
| (m_bStatus ? BIF_STATUSTEXT : 0 );
bInfo.lpfn = BrowseCtrlCallback; // address of callback function
//bInfo.lpfn = NULL;
bInfo.lParam = (LPARAM)this; // pass address of object to callback function
if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL)
return FALSE;
CString strTmp(m_strPath);
m_iImageIndex = bInfo.iImage;
if (::SHGetPathFromIDList(pidl, m_strPath.GetBuffer(MAX_PATH)) == FALSE) {
pMalloc->Free(pidl);
pMalloc->Release();
if (!bIsRepository)
return FALSE;
//Chapuza, para que se pase el nombre de la maquina solamente, sin ningun directorio
m_strPath.Format(_T("\\\\%s"), strTmp.GetBuffer(MAX_PATH) );
m_iImageIndex = bInfo.iImage;
return TRUE;
}
m_strPath.ReleaseBuffer();
pMalloc ->Free(pidl);
pMalloc ->Release();
return TRUE;
}
---------------------------------
Use:
CDirDialog dirDialog;
dirDialog.m_strInitDir = _T(""); //the root dir
dirDialog.m_strSelDir = //Initial select dir
dirDialog.m_strTitle.LoadString(IDS_STRING_SELECT_DIR); //title
dirDialog.m_strWindowTitle.LoadString(IDS_STRING_SELECT_REPOSITORIO); //title window
if (dirDialog.DoBrowse( this ) ) {
dirDialog.m_strPath; //Here is the select dir
}
-----------------------------------------------------
|
|
|
|
|
Hi,
I have already asked you yesterday
but I didn't explain my problem clearly
I have dialog based application.
And at any time when I press some keyboard key
over the window it makes sound (Some default window sound)
Is here any way how to turn it off from program?
but I cannot mute the speakers
in my application. It's already playing different audio
and problem is that I am playing audio and whan key
is pressed the key sound is mixed with my audio.
Key sound is not bothering me in time when
is nothing played - it doesn't matter in that time.
Thanx
Viliam
viliam
|
|
|
|
|
Please help us understand!
Do you mean when your application "HAS FOCUS" and you type the os or shell makes a sound?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Yes, my window has focus and I press some key.
It's for example empty dialog box and
key has no effect for it.
But system play some short sound.
Anyway I cannot find where to switch
this in Windows XP options at least.
(for all programs)
viliam
|
|
|
|
|
I just received a copy of a demo fro vs.net2003 and happily installed it to measure its performance for vc++. As a big surprise vc.net 2003 is quite a bit slower! For a simple bench I used a mandelbrot loop (ie not easily optimized away). I also tested simple empty nested for-loops, these are optimized away in vc6 but not in vc.net 2003.
Is there others who have seen this "speed reduction"? Is this a real problem or something that is in the demo version only?
|
|
|
|
|