|
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?
|
|
|
|
|
The optimization level of VS .NET 2003 is much higher than in VC++ 6. It takes more time to do that. You can take off the optimizations altogether, and the code will compile & link quickly, but will run more slowly.
Compilation/linking speed, however, shouldn't become a big issue until you move to BIG applications (Millions and millions of lines of code). At that point, you'd consider modularizing the application to make it's development easier, and this step would again reduce the time required to build your app.
So even though it complies/links a bit slower, it should't pose a big problem. If you run on a tight time schedule and can't spare time for the compilations, then write bug-free code in the first place so you don't need to do test builds for your app.
As a comparison, compiling the Quake Engine took about 3 minutes with my VC++ .NET 2003. Not much considering how big the engine is...
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Sorry I was unclear! The actual compilation went ok, pretty fast and actually produced smaller exe. What is the problem is the actual execution! Executing the release build of my mandelbrot test took ~3 times longer for the vc.net 2003 version. Also when running empty for-loops it didn't seem to optimize away those.
Any clues?
|
|
|
|
|
The first-time execution of any built program in VS .NET 2003 is always slow. If you open a project, build it, then execute/debug it, it will take ages. The next run is already a whole lot faster.
To test the actual execution speeds, build a EXE with VC++ 6, then with VC++ .NET, and then run both applications from the system shell/Explorer instead of inside the Visual Studio.
This will give you a clear picture of how fast the applications are actually executing. I bet that the VC++ .NET version will run faster from the shell than VC++ 6 version does.
I don't know about the empty for-loops, or the reason why it doesn't optimize those. Perhaps the optimization assumes that nobody is stupid enough to write empty loops ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I really need to learn telling people all facts! Yes, I ran the apps from the shell! The mandelbrot test produced the timing: vc.net 4.196s and vc6.0 1.482s
Still I don't know if this is a real problem or just a demo "feature"!? If it's real it's no good!
The code:
// test1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#define WIDTH 100
#define HEIGHT 100
#define ITER 10000
void mandel()
{
double x,y;
double xstart,xstep,ystart,ystep;
double xend,yend;
double z,zi,newz,newzi;
int i,j,k;
xstart = -2;
xend = 2;
ystart = -2;
yend = 2;
/* these are used for calculating the points corresponding to the pixels */
xstep = (xend-xstart)/WIDTH;
ystep = (yend-ystart)/HEIGHT;
/*the main loop */
x = xstart;
y = ystart;
for (i=0; i<height; i++)
="" {
="" for="" (j="0;" j<width;="" j++)
="" z="0;
" zi="0;
" (k="0;" k<iter;="" k++)
="" *="" z^2="(a+bi)(a+bi)" =="" a^2="" +="" 2abi="" -="" b^2=""
="" newz="(z*z)-(zi*zi)" x;
="" newzi="2*z*zi" y;
="" break
="" if(((z*z)+(zi*zi))=""> 4)
{
// no break here always calculate everything!!!
}
#endif
}
x += xstep;
}
y += ystep;
x = xstart;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
unsigned long t;
t = ::GetTickCount();
mandel();
t = GetTickCount() - t;
printf("%u", t);
return 0;
}
|
|
|
|
|