|
why don't u make outlook playing sounds when a new email arrvied?
Don't try it, just do it!
|
|
|
|
|
What please repeat?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hi Marty,
glad to see you again.
You can prorammatically switch on Autocheck property, and also easily decrease its interval to e.g. 0.1s (after first retreaval you can switch it off)
1.Get the GUID value of HKCU\Identities\Default User ID
2.Set HKEY_CURRENT_USER\Identities\{GUID}\Software\Microsoft\Outlook Express\{...version...}\Poll For Mail to desired intervall in millisec
3.Set HKEY_CURRENT_USER\Identities\{GUID}\Software\Microsoft\Outlook Express\{...version...}\Dial during Poll to
2 for switching off
1 for connecting when offline
0 for connecting when online
Peter Molnar
|
|
|
|
|
Please Help me!
Every time the Resource is re-compiled (ie i move a button) the resource file will grow & cause the EXE file to double in size. A work mate has had the same problem in the past. The problem is with the MS FLEX GRID control causing the Resource (rc) file to grow. My work mate was able to fix this problem by formating his HDD & re-installing everything then using an old rc file that he then had to update. His code has been happy ever after but what is to say it wont happen again. This is an option for me but we need to understand the problem to stop it happening again.
If I look at my rc file other controls are fine: (example)
IDC_AttenOffset, 0x403, 7, 0
0x2e35, 0x2035, 0x4264, "\000"
But If you look at any of my 3 MS FLEX GRID controls:
IDC_GRID, 0x37a, 302, 64
0x0024, 0x0000, 0x0037, 0x0032, 0x0045, 0x0036, 0x0037, 0x0031, 0x0032,
0x0030, 0x002d, 0x0035, 0x0039, 0x0035, 0x0039, 0x002d, 0x0031, 0x0031,
0x0063, 0x0066, 0x002d, 0x0039, 0x0031, 0x0046, 0x0036, 0x002d, 0x0043,
0x0032, 0x0038, 0x0036, 0x0033, 0x0043, 0x0033, 0x0038, 0x0035, 0x0045,
.............. This goes on & on for 40MB!!
Someone else must have had thid problem. Please help me!
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
delete the flex grid
Don't try it, just do it!
|
|
|
|
|
I had this before and I ended up manually erasing the extra stuff that was full of 0x00 and then it never came back.
The flex grid is for free but it sucks sometimes....I know
|
|
|
|
|
Thanks to both of you. I had tryed that before with no luck as I think my 40MB Resource file was too far shot.
I did solve the problem tho by creating a new dialog on another PC & adding a fresh MS Flex Grid. I then Copyed this section from the Resource file & Pasted it into my Project Resource file in place of the currup ones. Then After re-loading into C++ I re-applyed my previous Grid Settings & Re-compiled.
The EXE & RC have stopped doubleing & My EXE went from 20MB back to 700K!!
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
Okay, i have to run this .exe file from my c++ program with varying arguments, then compare the results.
the .exe printf's a few lines of code run normally from command line.
so how would i run this file from my c++ program, and how'd i load the results back into a char buffer or something
any help with this would be greatly appriciated!
|
|
|
|
|
OK Sure!
HANDLE YourAppName::StartProcessGettingProcessHandle(const TCHAR* pszCommandLine)
{
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = NULL;
sei.lpFile = pszCommandLine;
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = NULL;
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
if (ShellExecuteEx (&sei) )
return sei.hProcess;
else
return NULL;
}
Call it with
m_hSpawnedProcess = pApp->StartProcessGettingProcessHandle(pApp->m_sProgramToRun);
// If the shell resides in the app.
In OnDestroy add
//Free up the process handle we have spawned if valid
if (m_hSpawnedProcess)
{
CloseHandle(m_hSpawnedProcess);
m_hSpawnedProcess = NULL;
}
//Let the base class do its thing
return CWinApp::ExitInstance();
Now monitor the handle
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
excellent, thanks for the code
only thing is, the program i'm writing is a console application.
will the "SHELLEXECUTEIN" work there too?
|
|
|
|
|
Yes, Microsoft show a console app using ShellExecute in WN_DOS.H. 1992
If not you may compile using mfc in console.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
okay, i'll give it a go. i'm not using MFC at the moment though.
i wanna keep this as simple as prossible. just a "void main()" with a few functions.
its for a cryptanalysis project...
anyways, i dont have time to try it out today, so i'll give it a go tomorow and post back either a "thanks it works" message or "oh crap, i can't get it to work"
|
|
|
|
|
Whoooo looks like you know your way around ShellExecute !!
Here is a question.
I have been using it almost the same way but I need to know if the execution ended in an error, is there any way to know that ?
I use ShellExecute to run PKZIP to unzip a big file and then I just wait with:
<br />
SHELLEXECUTEINFO sei;<br />
sei.cbSize =sizeof(sei);<br />
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.hwnd = m_hWnd;
sei.lpFile="x.bat";
sei.nShow=SW_MINIMIZE;
sei.lpVerb=NULL; <br />
sei.lpParameters=""; <br />
sei.lpDirectory="";<br />
<br />
<br />
ShellExecuteEx(&sei);<br />
long factor=0;<br />
while (WaitForSingleObject (sei.hProcess, 0)==WAIT_TIMEOUT)<br />
{<br />
factor++;<br />
if (factor==1000)<br />
progbar.StepIt();<br />
<br />
}<br />
The problem is , how do I know for example if the PKZIP did not find the file I told him to look for, or any kind of error....
Shay
|
|
|
|
|
Hi,... Set a thread and monitor it.
When you call if call it through a callback proceedure as a worker thread.
Set you Shellx in the app of your application.
Create a HANDLE in the header of app.
HANDLE myhandle;
Return sei to the callback Now monitor the thread for running, and the handle for terminitation.
If the HANDLE exits with say 0x03 then you know what?
If the HANDLE exits with say 0x00 then you know what?
The worker thread will only un-freeze your app while all this is going on, and is good practice to get into. (I should talk I have several x 100 apps running without threads). If you need help on threads see Newcomers artice here for a good description of threads.
http://www.codeproject.com/cpp/callbacks.asp?target=
If you need help with shellx see P.J.Naughter class called pop3.
http://www.naughter.com
Let me know, work on it and if you don't have it in 2 days I will send you an example.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
|
sure let me know!
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
How is it going?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hello,
I am trying launching an application telling it to open a document. I build a command line surrounding the program name and each document with quotes and then use ShellExec to process. This works fine with all applications except old Adobe programs (like PhotoDeluxe or Photoshop LE). So I tried CreateProcess instead it does not work either. Tried ShellExecuteEx same error: the program does not find the document. If I take the command line I am builing and paste it in a Command Prompt it works. Other programs are able to run the application passing it a file to open.
So my question is: what other way can I use to run that application telling it to open an application... Should I revert to _exec or is there something else?
Regards,
Nicolas
|
|
|
|
|
What does the code snippet look like that tries to launch Adobe and its command-line arguments?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Something like this:
string fnames;<br />
list<string> sel = GetSelection();<br />
for (list<string>::iterator it = sel.begin(); it != sel.end(); ++it)<br />
fnames += "\"" + *it + "\" ";<br />
<br />
strEditor = "\"" + strEditor + "\"";<br />
strDir= "\"" + strDir+ "\"";<br />
<br />
ShellExecute(NULL, "open", strEditor.c_str(), fnames.c_str(), strDir.c_str());
This works with latest version of Photoshop for instance (6 and later) and Paint Shop Pro but NOT with Photoshop LE 5 and Photoshop Deluxe. CreateProcess and ShellExecuteEx fail the same way: the app is correctly launched but it can't find the files I am passing.
Regards,
Nicolas
|
|
|
|
|
Have you tried calling ShellExecute() with string constants instead of variables? This will tell you if the variables are incorrect.
ShellExecute(NULL, "open", "c:\\program files\\adobe.exe", "file1 c:\\somepath\\file2 file3", "c:\\somedir", ...);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
David,
thanks for suggesting. The problem came from the trailing whitespace at the end of fnames. I removed it and it workls!
Thanks again,
Nicolas
|
|
|
|
|
|
Hi,
I have a COM server, and a private class for the internal use of the COM object, what I want to do is to add a a method that returns a CComObject<> * Object, I have two problems:
If I make this:
<br />
CComObject<Connections> *DBGroup::GetGroupConnections(_bstr_t strGroup)<br />
{<br />
CComObject<CConnections>* pConnections; <br />
HRESULT hr = CComObject<CConnections>::CreateInstance(&pConnections);<br />
<br />
(...)<br />
return pConnections; <br />
}<br />
1. I get a compiler error telling me that he don't knows about the Connections com component that I have created in the same server.
2. If Instead of that I return and IConnection interface, Do I generate there a leakage ? ( I don't call the "delete pConnection"), what is the solution or workaround for this problem ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
1.Initialize your object
CComObject<CYourBaseClass>* pConnection;
...
pConnection->AddRef();
return pConnections;
2.Returning a pointer cuases very much a memory leak UNLESS you destroy it in your caller function
CComObject<CYourBaseClass> *pConnection = GetGroupConnections(...);
pConnection->...
pConnection->Release();
Peter Molnar
|
|
|
|
|