|
ah yes now thats what im taking bout, fast accurate reply's... thanks a lot
|
|
|
|
|
I have the following code that reads all the messages currently in the user's inbox and inserts them into a listview. I'm using automation and everything seems to be working fine except for getting the sender's email address. There's a property for getting the sender's name, but not the email address. here's the code I have so far. Hope anyone can help!! Thanks!!
void COtestDlg::OnRun()
{
MapiMessage mm;
MAPIFolder folderInbox;
_NameSpace ns;
_Items itemsMessages;
_MailItem mi;
_Application app;
if(!app.CreateDispatch("Outlook.Application"))
{
AfxMessageBox("Couldn't start Outlook.");
}
else
{
ns = app.GetNamespace("MAPI");
COleVariant vt;
COleVariant vtOptional("");
COleVariant vtTrue;
vt.ChangeType(VT_BOOL);
vt.boolVal = true;
vt.ChangeType(VT_I2,NULL);
ns.Logon(vtOptional, vtOptional, vtTrue, vtTrue);
folderInbox = ns.GetDefaultFolder(6);
itemsMessages = folderInbox.GetItems();
for (int x = 0; x < itemsMessages.GetCount(); x++)
{
mi = itemsMessages.Item(COleVariant((long) x + 1L));
m_lvwResults.InsertItem(x,mi.GetSenderName());
m_lvwResults.SetItemText(x,1,mi.GetSubject());
m_lvwResults.SetItemText(x,2,mi.GetBody());
}
ns.Logoff();
}
}
If it's broken, I probably did it
bdiamond
|
|
|
|
|
|
Yes, that worked perfectly, thanks!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Topic says it all, how can I transform a jpg to a bmp in C++?
|
|
|
|
|
|
Hello,
I have two programs that I have to use one after another. The first one's goal is to configure data you use with the second. So I have to leave the first to use the second. And if I want to change the configuration, I have to quit the second to return in the first one, change the configuration. Then I can quit the configuration program and come back in the second program.
So this is very fastidious because I always have to do the same thing twice (I always have to change the configuration once, and this is always the same thing)
I don't have the source code so I cannot modify it
So my question is (finally...) is there a way to do a program that runs other programs and that modifies comboboxes and stuff the way a REAL user could do it?...
Thank you in advance
If someone did not understand what I meant please tell me too
an allarc'h zo bet
|
|
|
|
|
Hint:
FindWindow
SendMessage
Spy++
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks but: findwindow and sendmessage can't work (I think) as I can't access the source code of the program I want to run(I want to run it with a program but the way a user could run it, and modify comboboxes choices, click on button...).
I'm not familiar with Spy++: I just made a few search on google as you recommended it, but it seems to show the threads that are running on the PC, the UC occupation and all this stuff so I don't understand the link with my question, could you precise your hint?
Thanks
|
|
|
|
|
You dont need source code.
Using Spy++ you can get the class of the window u want to send message to and the messages to send,
using FindWindow you cant get a handle to the window, and using SendMessage you just send the message you saw in Spy ++ to the window, thus making it behave just like if a user is testing it
Consider also using CWnd::Attach and CWnd::Detach
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hello.. All
I have my application and the application 2. app2 sends the window messages and I don't know how to capture those messages. I'm using .Net c++ and the following example was provided by app2.
My application is Dialog-based application.. and I don't know how to convert the following code or capture the messages from other application at all.
The app2 said register a message ( could be anything) and my application also has to register the same message as app2. (that's I don't know how)
then app2 will start sending messages and my app has to capture and process those messages. ( I have no idea how to capture the messages either)
I kind of have the idea of GetMessage() as it is shown in the example. but how?
<br />
HINSTANCE hInst;<br />
LRESULT CALLBACK TestWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);<br />
<br />
int PASCAL WinMain(HINSTANCE hinstCurrent, HINSTANCE hinstPrevious, LPSTR lpszCmdLine, int nCmdShow)<br />
{<br />
<br />
WNDCLASS wc;<br />
<br />
<br />
wc.style = 0;<br />
wc.lpfnWndProc = TestWndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hInst;<br />
wc.hIcon = LoadIcon(hInst, TEXT("TestIcon"));<br />
wc.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);<br />
wc.lpszMenuName = TEXT("TESTMENU");<br />
wc.lpszClassName = szMyClass;<br />
<br />
if (!RegisterClass(&wc))<br />
return FALSE;<br />
<br />
HWND hwndMyWindow = CreateWindow(szMyClass, TEXT("Black Ice printer Driver Message Capture Sample"),<br />
WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, 0,<br />
CW_USEDEFAULT, 0, NULL, NULL,<br />
hInst, NULL );<br />
<br />
if ( !hwndMyWindow )<br />
return FALSE;<br />
<br />
ShowWindow (hwndMyWindow, SW_SHOW);<br />
<br />
while ( GetMessage(&msg, NULL, 0, 0 ) )<br />
{<br />
TranslateMessage(&msg);
DispatchMessage(&msg);
}<br />
return (int) msg.wParam;
}<br />
Thank you very much
you can save my life.
|
|
|
|
|
|
I would like to thank CodeProject for announcing me as the winner of the "Favorite MFC/C++ Article of March 2004[^]" competition. I would like to thank my best friend Kamal Sekhon for her continuous support. I would also like to thank Nishant (the editor of my article), Chris Maunder and the whole CodeProject team, AND last, but not the least, I would like to thank all those people who posted their prestigious comments, encouraged me a lot, gave their ideas/suggestions, and of course, rated my article to make all this possible.
Thank you all,
Gurmeet BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
Congrat
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
how i can write Ackermann Function not use recursion
Nothing
|
|
|
|
|
|
To make a long story short, there's an external program that I have no control over that is consistantly leaking memory. This product is required by our customer, so we must use it.
Obviously, this program will cause Windows to run out of free memory if it is run long enough. Is there a way I can see the current Memory Usage of this other program -- like what Task Manager is displaying? I'd like my program to either warn the user or destroy that task if the size gets too large.
Any ideas?
|
|
|
|
|
|
|
Hi,
I have an executable being invoked from a VC++ code through ShellExecute. After the completing of this executable, I have got a list of jobs to be performed in a sequence.
But when I run this application, ShellExecute will create a different shell and execute the exe (which is as expected) and the list of jobs will also be executed before the completion of the execution of my exe.
eg.
ShellExecute(GetSafeHwnd(), "open", print.exe, params, NULL, SW_HIDE);
task1
task2
task3
I want print.exe to execute first and then go execute task1, task2, task3 in a sequence.
I want to know whether we have any synchronization method which can be invoked just before task1 so that the control will flow in a sequence.
print.exe is executed only thro' ShellExecute().
Either a system() call, WinExec() etc will not work.
Please help me out.
Thanks,
Prashant
|
|
|
|
|
Use ShellExecuteEx, set the flag member to SEE_MASK_NOCLOSEPROCESS to get the process handle and use WaitForSingleObject on that handle.
Jens
|
|
|
|
|
Thanks for the reply, that worked!!!
|
|
|
|
|
#include<iostream>
#include<complex>
using namespace std;
inline complex<double>&operator+=(complex<double>&cval,double dval)
{return cval==complex<double>(dval);
}
int main()
{
complex<double> cval(4.0,9.8);l
cval+=1;
cout<
|
|
|
|
|
main isn't returning a value; there is no return statement!
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
but compile will extend the inline that has the retun value
|
|
|
|