|
Hi David,
Here is what I tried:
//Shell execute test
//from David mailto:joe@something.com?subject=Test&attachment="c:\boot.ini"
sprintf(buf, "mailto:rpalma@mrtel.com?subject=test&attachment=\"c:\misc\a.txt\"");
ShellExecute(NULL,"open", buf,"","",SW_SHOWNORMAL);
I tried this on NT and Win2K.
I tried this on Eudora and Outlook 2003.
In all cases, the email client loads the 'to' address and the 'subject', but does not seem to know about the attachment.
I have been working on this since May.
Back in May Jim Twine kindly told me (in this forum) that he did not think I could do this with ShellExecute and that I would have to use MAPI.
I have not had success with MAPI so I have been looking at running the mail client from the command line. Outlook and Eudora seem to do this quite well. I just have to find out 'who' is the client and 'where' (directory) he is.
Actually I REALLY don't even want to specify the 'to' address or the 'subject'. I'd like the User to pick the 'to' address from his email-client-addressbook.
I would love to hear anymore thoughts on getting ShellExecute to work. It's seems quite simple and elegant and I use it all the time for other executables.
All the best,
Robert
|
|
|
|
|
Robert Palma Jr. wrote:
sprintf(buf, "mailto:rpalma@mrtel.com?subject=test&attachment=\"c:\misc\a.txt\"");
Should be:
sprintf(buf, "mailto:rpalma@mrtel.com?subject=test&attachment=\"c:\\misc\\a.txt\"");
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi David,
Thankyou for your very quick replys
I fixed my dumb error in formating per your correction - thanks.
Eudora still ignores the attachement.
Outlook (this is different) says the command line switch is
in error.
I have had no luck with a command line reference from Eudora
(Qualcomm) even though I am a re-registered user with the last 4 months.
I will look for a reference on Outlook command line switches, but
previous research efforts in this regard were not fruitful.
Any other ideas?
All the best,
Robert
|
|
|
|
|
Robert Palma Jr. wrote:
Eudora still ignores the attachement.
Admittingly, the attachment part may not be standard. You'll have to read the RFC for mailto: to find out.
Robert Palma Jr. wrote:
Outlook (this is different) says the command line switch is
in error.
I use Outlook 2000 and it worked for me.
Robert Palma Jr. wrote:
I will look for a reference on Outlook command line switches, but
previous research efforts in this regard were not fruitful.
Outlook's command line parameters, if it even has any, has nothing to do with the mailto: protocol.
Check out the SMTP and MAPI links I provided earlier.
Something else you might try is:
char szApp[MAX_PATH];
AssocQueryString(..., ".eml", "open", szApp, sizeof(szApp));
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
In part of my program, I made it give a "yes, no, cancel" MessageBox to the user, and it does that. But the text in it make it span all the way from one end of the screen to the other, making it look ugly. How do I tell it to go to the next line after the first line exceeds a certain length?
|
|
|
|
|
Just insert line breaks ("\n"), in your display string.
If the length of your string varies, then you might want to write a simple funtion that breaks up your input string for you before passing it on to the messagebox
I Dream of Absolute Zero
|
|
|
|
|
Yeah, my text varies. Guess I will have to write a splitting function then, was wondering if there was already one included in MFC. Thanks.
|
|
|
|
|
Here you go.
<code>
void wrapString
(CString strString,
int nWrap,
CStringArray& lines)
{
int nStart = 0;
int nEnd = 0;
do {
<code>
nEnd = nStart + nWrap;
if (nEnd >= strString.GetLength())
nEnd = strString.GetLength() - 1;
<code>
if (nEnd != strString.GetLength() - 1)
while ((nEnd >= 0) && (strString.GetAt (nEnd) != _T(' ')))
nEnd--;
<code>
CString strNextLine;
if ((nEnd - nStart) > 0) {
strNextLine = strString.Mid (nStart, (nEnd - nStart) + 1);
strNextLine.TrimLeft();
strNextLine.TrimRight();
lines.Add (strNextLine);
}
<code>
nStart = nEnd + 1;
} while (nStart < strString.GetLength());
return; /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You could create a dialog in the ressource dialog editor, with 2 buttons and 1 Editbox. Press Strg+W and the Classwizzard will come up, here you can add variables linked to the Editfield or functions that operate when buttons are pressed and more. If you set up all fine you can include the dialogclass in your app, write the sentense you want to the variable in your dialogclass,say mydialog.DoModal();, react on buttons, and have a good time. No more than 10 minutes on it all.
|
|
|
|
|
ryuki wrote:
You could create a dialog in the ressource dialog editor, ... No more than 10 minutes on it all.
True.
But I think my solution is "better" for at least these reasons:
- It can be generically applied to any kind of message box.
- Less internationalization required.
- Takes less than 10 minutes to implement.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Might want to add some handling for strings that do not use correct spacing (i.e. do not have a single space after a comma, colon, etc.). Wrapping can also be done right after a hyphen.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Good point. I'll genericize it and will post an article soon. Thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am using CHTMLView in my application, but am not overriding any methods related to redrawing or resizing.
Yet, there is significant flashing on resize that is not present in IE with the same content. It's a bit better, when building with .net 2003 instead of VC 6, but still visible.
Has anybody got a fix for this?
Thanks,
-- Harald
|
|
|
|
|
Make sure the windows behind it are not set to draw over it. You might have parent windows (views, frame windows, etc.) that are not set to clip children, and will happily redraw themselves whenever resized - only to be drawn over again by the child CHTMLView.
|
|
|
|
|
Hi,
Right now I'm working on an ActiveX control. We have a very large message map defined with BEGIN_MSG_MAP, a number of MESSAGE_HANDLERs, ended with END_MSG_MAP. For each of the handler functions specified in the MESSAGE_HANDLERs, we return a value. Looking into the macros, it seems that the return value of our handler becomes the value of the lResult reference argument of ProcessWindowMessage function defined by BEGIN_MSG_MAP, and ProcessWindowMessage returns this lResult, to the window procedure.
So now you guys understand the scenario. What I don't understand is what exactly the point of handler return value/lresult is! What does it mean? In our handlers (mostly written by other people) sometimes every path of execution returns 0, sometimes some return 1 and the other/s 0. There is no correlation between whether the handler succeeded or failed. Could someone please explain what these values mean? Thanks.
|
|
|
|
|
In many cases, the windows message handlers originally had the notion that 'return 1 if you processed the message, return 0 if you did NOT process the message'. Then, the idea was that as messages were passed down to child windows or passed through a message handler chain, it could be determined if the function handler 'you' just called processed the message or not. This has changed over time, and now you basically have to read documentation for every message handler to see what the return value might mean and if you are suposed to return one thing or another if you process it.
For example, you can read about WM_INITIDIALOG and it will say something like 'return 0 if you set focus to a control, otherwise return 1', and what that means to the default window procedure is that it will set the focus to first valid control it can find 'unless you already set the focus'.
|
|
|
|
|
|
Hi, every one
There is a message in MSDN about EngModifySurface and EngAssociateSurface:"driver must implement the corresponding function for every bit that it sets in flHooks".
But how to do? I have no idea after searching in MSDN and Internet.
Someone CAN help me?
My E-Mail is :XHZXLQT@163.COM
Thanks Very Much!
__________
\\ //
\\ //
\\ //
\\//
\/
|
|
|
|
|
Are you trying to create a GDI device driver? If so, then you will need to implement the DrvXxx() functions as described in the documentation for EngAssociateSurface() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks,DavidCrow.
I'll try to create not a GDI driver,but a Video FILTER driver(In my driver ,I'll hook the functions DrvXXX)
The message for EngAssociateSurface and EngModifySurface means that Coder must implement the corresponding function for each DrvXXX function that be hooked.
The problem is: how to implement the CORRESPONDING FUNCTION? How to name the corresponding function ,use the same name DrvXXX or other? And the system how to known which corresponding function maps the GDI function DrvXXX?
|
|
|
|
|
xhzxlqt wrote:
The problem is: how to implement the CORRESPONDING FUNCTION? How to name the corresponding function...
See here. Click on each of the functions in the second column to see what their signature looks like.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi all,
I have 3 dockable views in my application.
In my Overrided "OnEraseBkgnd" message handler,Depending on some useractions
sometimes,I have to redraw the background,some times not.
BOOL C_View::OnEraseBkgnd(CDC* pDC)
{
if//something;;can be many useractions reqiring no redraw
return FALSE;
else// ;can be many useractions reqiring a redraw
return CScrollView::OnEraseBkgnd(pDC);
}
what would be the best way,I could do that...
Thanks...
|
|
|
|
|
Make the background a view too. That helps allot, since windows keeps your backround image clean. If you realy need to redraw it you only need to call backview.invalidate();. You have to create a OnSize() Function that redraws the whole background in the view.
|
|
|
|
|
|
Hello
I want to use image scanner in my program. how can I start?
please some one tell me where can I start !
Thank you,
Iman Ghasrfakhri
|
|
|
|