|
Tak wrote:
I don't know much about MAPI, but from what I've seen it does not support launching the mail client.
While it may not "launch" the default mail client in the true sense of the word, it is still the mail API, and, unless you know otherwise, is used by the default mail client. I am only familiar with a few mail clients, and they use MAPI. Outlook uses CDO, which is simply a COM wrapper around MAPI.
Tak wrote:
...I can't invest that much time...digging through all the MSDN articles uses way too much time.
It is, however, time well spent.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
First, even if the time might be well spent, I don't _have_ the time. Second, the mail client has to pop up, I don't want to just send a mail. It's not in my hands, it's the customer who wants it like this
Though I looked a bit deeper into the MAPI and saw that you can launch the GUI; I just hope that it works with their strange mail client...
|
|
|
|
|
I wrote a test app for work that uses MAPI and it only took me an hour using the MSDN docs, so it's not like there's no info at all. If the machine has a MAPI-compliant email app (Outlook, Eudora, etc.), you can use MAPISendMail()
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
Take alook at the MFC code in void CDocument::OnFileSendMail() for sending the current document as an attachment. It shoudl hopefully show you what you need to do. I did a modification of this that added many attachments.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
A user of my program contacted me recently saying that her data was completely screwed up. The program saves info into a text file and is dependent on a very particular sequence to function correctly. I had her send me over that text file and when I opened it in Notepad it was word-wrapped. There is nothing in my code (to the best of my knowledge) that would word-wrap the data and I don't have that option checked in my Notepad. She claims that she didn't tamper with the file or word-wrap it herself. Is this possible that Windows or something else forced a word wrap into the file?
My saving techniques are very specific...whenever I need a line break I use << endl;
Any thoughts?
|
|
|
|
|
georgiek50 wrote:
Is this possible that Windows or something else forced a word wrap into the file?
No. This would be totally up to the individual application.
georgiek50 wrote:
Any thoughts?
Have you looked at the file in binary mode to see if there are embedded CR/LF characters?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I don't know how to check a txt file in binary mode...but from my description do you think she's lying and really did tamper with the file? Here is the code that saves the data:
void cList::Save(void)
{
cListElement *pSave;
pSave = pFirst;
ofstream File;
File.open("Data.dat", ios::trunc);
while (pSave != NULL)
{
File << pSave->szData1 << endl;
File << pSave->szData2 << endl;
File << pSave->szData3 << endl;
File << pSave->szData4 << endl;
File << pSave->szData5 << endl;
File << pSave->szData6 << endl;
File << pSave->szData7 << endl;
File << pSave->szData8 << endl;
File << pSave->szData9 << endl;
File << pSave->szData10 << endl;
File << pSave->szData11 << endl;
pSave = pSave->pNext;
}
File.close();
}
|
|
|
|
|
georgiek50 wrote:
I don't know how to check a txt file in binary mode
Use Visual Studio.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks...it does indeed seem to be filled w/ line breaks corresponding to how the file looks in Notepad (I'm assuming .. is a line break) I think she tampered with it and feels too stupid to admit it.
|
|
|
|
|
Hi!
I have a hook to some application that has a tree view. The problem is that I do not receive the TVN_SELCHANGED notification... Perhaps I don't do it right, but anyways, here's my code:
SOMEAPP_API LRESULT CALLBACK SomeAppProc( HWND hwnd, UINT unMsg, WPARAM wParam, LPARAM lParam )
{
case WM_NOTIFY:
{
switch( ((LPNMHDR)lParam)->code)
{
case TVN_SELCHANGED:
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam ;
}
break;
}
break;
}
}
Can anyone help me out? Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
LukeV wrote:
The problem is that I do not receive the TVN_SELCHANGED notification
Do you get any notifications at all?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Yeah I do, but nothing TVN_*
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
Are the TVN_xxx handlers setup properly in the message map of the treeview's parent class?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Could you provide an example? As I said, I'm using a window hook so I don't have a message map declared...
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
My bad. I'm curious what messages are received when interacting with the treeview control.
SOMEAPP_API LRESULT CALLBACK SomeAppProc( HWND hwnd, UINT unMsg, WPARAM wParam, LPARAM lParam )
{
case WM_NOTIFY:
{
switch(((LPNMHDR) lParam)->code)
{
case TVN_SELCHANGED:
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam ;
break;
<code>default:
char szBuffer[128];
sprintf(szBuffer, "Received notification %#x\n", ((LPNMHDR) lParam)->code);
OutputDebugString(szBuffer);
break;</code>
}
break;
}
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
As a possible spanner in the works, if the base control is using message reflection, the message may not be propergating out of the control for him to hook it. Thats if the control he's hooking is using ON_MESSAGE_REFLECT(). Not sure if it has any bearing on this.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Yeah, that's what I'm thinking... the tree view isn't sending any notification to it's parent... But I'm able to create a hook directly to the tree view window, so do you think that I could get the TVN_SELCHANGED notification in WM_PARENTNOTIFY?
What I need to do is to know that the selection has changed in the tree view. If there's a way to do this with WM_xxx messages directly in the tree view, I'd like to know it!
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
I don't seem to be getting any notification from the tree view So, is there some way (read: hack or trick) that I can know that an item has been selected? I'm able to create a hook directly to the tree view window so I guess I could play around with the WM_xxx messages
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
What if you established a hook to the treeview's parent instead?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hello all! I'm an intermediate programmer, and need help on this particular issue: I have a program that runs with plugins that are loaded at run-time. Plug-ins can be installed and deleted and the program runs without a hitch. But I've been having a problem trying to come with some method of allowing the addition of menu items to a tray icon's menu at run-time and handling when the user clicks on these menu items. I've seen something similar done, where a basic menu is created then the program adds items at run-time and handles them as well, but the ID Routing is something that I'm having trouble with. Does anybody have any suggestions, or even source code with this type of feature? Thanks for all your help!
Sean Payne (Zero_Divide_1)
|
|
|
|
|
If you use TrackPopupMenu to display it, use the TPM_RETURNCMD flag so that the selected option code is returned locally to the procedure that calls TrackPopupMenu() (i.e. not a WM_COMMAND message sent to you). If its one you recognise, you porcess it locally, else you have to check each of your plug-ins to see if they are the one to handle it.
Similary, your plug-ins will have a procedure to setup the dynamic menu, something like this:
CMenu menu;
menu.CreatePopupMenu(); // or use LoadMenu and GetSubMenu(0)
menu.AppendMenu(...) ; // add local commands
for each plug-in
{
plugin.AddMenuItems(menu);
}
int sel = TrackPopupMenu(menu, TPM_RETURNCMD, ...)
switch (sel)
{
case 0:
// aborted
break;
case MY_COMMAND1:
...
case MY_COMMANDX:
break;
default:
// command added by plug-in, check the plugins to see who needs to handle it
}
A quick pseudo code hack above, but should give you the idea.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hey, thanks a lot! That idea is so much better than the one I came up with. In fact, 2 hours ago I finished a class to handle the requests using ON_COMMAND_RANGE and having the class lookup the correct callback function in the plug-in to call, but your idea is so much better. Maybe I should write an article and post it on CodeProject to help all those other coders out there who need help with this type of problem as well (don't worry, I'll mention that you told me about this possibility - I don't like taking credit for things that I didn't come up with). Thanks so much!
Sean Payne (Zero_Divide_1)
|
|
|
|
|
im trying to do some excel automation but im getting that _com_dispatch_method is undefined, im using MFC, any idea why?
|
|
|
|
|
Did you call AfxOleInit or CoInitialize before any automation code?
Bunburry
|
|
|
|