|
pardon me but this is the one i need to modify:
virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary, LPCTSTR szFileName)
{
ATLENSURE(szBoundary != NULL);
ATLASSERT(szFileName != NULL);
ATLASSUME(m_pszEncodeString != NULL);
char szBegin[256];
if (*szBoundary)
{
// this is not the only body part
Checked::memcpy_s(szBegin, 256, ATLMIME_SEPARATOR, sizeof(ATLMIME_SEPARATOR));
Checked::memcpy_s(szBegin+6, 250, szBoundary, ATL_MIME_BOUNDARYLEN);
*(szBegin+(ATL_MIME_BOUNDARYLEN+6)) = '\0';
}
else
{
// this is the only body part, so output the MIME header
Checked::memcpy_s(szBegin, 256, ATLMIME_VERSION, sizeof(ATLMIME_VERSION));
}
// Get file name with the path stripped out
TCHAR szFile[MAX_PATH+1];
TCHAR szExt[_MAX_EXT+1];
Checked::tsplitpath_s(szFileName, NULL, 0, NULL, 0, szFile, _countof(szFile), szExt, _countof(szExt));
Checked::tcscat_s(szFile, _countof(szFile), szExt);
_ATLTRY
{
CT2CAEX<max_path+1> szFileNameA(szFile);
CStringA szDisplayName(szFile);
if (m_szDisplayName[0] != '\0')
{
szDisplayName = CT2CAEX<_MAX_FNAME+1>(m_szDisplayName);
}
header.Format("%s\r\nContent-Type: %s;\r\n\tcharset=\"%s\"\r\n\tname=\"%s\"\r\n"
"Content-Transfer-Encoding: %s\r\nContent-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n",
szBegin, (LPCSTR) m_ContentType, m_szCharset, (LPCSTR) szDisplayName, m_pszEncodeString, (LPCSTR) szFileNameA);
return TRUE;
}
_ATLCATCHALL()
{
return FALSE;
}
}
|
|
|
|
|
1/
Please use the <pre> tags so we can see what's code and what's question/
2/
I still don't see a question. You say "I need to do X". While I am very happy for you, and have every confidence that you will succeed, I'm still looking for a question.
The nearest I can see is that you need to rearrange the strHeader.Format line to put the data out in a different order.
Iain.
|
|
|
|
|
Ok my problem is when i am extracting and converting a .eml file to a new .eml file to convert the tnef i am having an issue getting the embedded attachments. When i get them instead of having them as embedded i just have them as a regular attachment due to the code by atlmime.h
Now my question is how can i get them back as embedded attachments, get their content-disposition and content ID? Thanks
|
|
|
|
|
I'm sorry, but I haven't worked with MIME, so I'm not going to be much use to you.
But now you've improved your message, someone who has worked with them may be able to assist you.
I wish you luck,
Iain.
|
|
|
|
|
Thank you very much.
Just an update I made my version of what MBrooker made (AddHtml). Now I am just looking how altmime will fetch my function and how I will get the content-ID
|
|
|
|
|
Also if there is a way to get the Content-disposition it will be a great help as well.
|
|
|
|
|
virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary, LPCTSTR szFileName)
{
ATLENSURE(szBoundary != NULL);
ATLASSERT(szFileName != NULL);
ATLASSUME(m_pszEncodeString != NULL);
char szBegin[256];
if (*szBoundary)
{
Checked::memcpy_s(szBegin, 256, ATLMIME_SEPARATOR, sizeof(ATLMIME_SEPARATOR));
Checked::memcpy_s(szBegin+6, 250, szBoundary, ATL_MIME_BOUNDARYLEN);
*(szBegin+(ATL_MIME_BOUNDARYLEN+6)) = '\0';
}
else
{
Checked::memcpy_s(szBegin, 256, ATLMIME_VERSION, sizeof(ATLMIME_VERSION));
}
TCHAR szFile[MAX_PATH+1];
TCHAR szExt[_MAX_EXT+1];
Checked::tsplitpath_s(szFileName, NULL, 0, NULL, 0, szFile, _countof(szFile), szExt, _countof(szExt));
Checked::tcscat_s(szFile, _countof(szFile), szExt);
_ATLTRY
{
CT2CAEX szFileNameA(szFile);
CStringA szDisplayName(szFile);
if (m_szDisplayName[0] != '\0')
{
szDisplayName = CT2CAEX<_MAX_FNAME+1>(m_szDisplayName);
}
header.Format("%s\r\nContent-Type: %s;\r\n\tcharset=\"%s\"\r\n\tname=\"%s\"\r\n"
"Content-Transfer-Encoding: %s\r\nContent-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n",
szBegin, (LPCSTR) m_ContentType, m_szCharset, (LPCSTR) szDisplayName, m_pszEncodeString, (LPCSTR) szFileNameA);
return TRUE;
}
_ATLCATCHALL()
{
return FALSE;
}
}
|
|
|
|
|
How can I get the content ID of the embedded attachment?
|
|
|
|
|
I got the content-ID now yes hehehe now just the content-disposition i think
|
|
|
|
|
Hello,
I have class derived from CRichEditCtrl and a class derived from CListBox. Both the windows are displayed on a child frame.
I want to display a list box on top of a CRichEditCtrl.
But the lower border of CListBox is not seen.It looks as if the editbox cuts the border of the listbox.But actually the list box should appear on top of the edit box.
What should IO do?
Is there any style which will allow the list box to appear on top?
Prithaa
|
|
|
|
|
Yes,
you can set the windows order from top to bottom, like parent-child.
I can't tell you which command to use, but if you look for that in forum with "search comments" (just above the "first", "prev", "next"), you will surely find related messages.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
|
LBS_NOINTEGRALHEIGHT[^]
The LBS_NOINTEGRALHEIGHT style causes the list box to be exactly the size specified by the application. By default, list boxes resize themselves when created or sized so that partial items are not displayed.
For list boxes with the LBS_OWNERDRAWVARIABLE style, the LBS_NOINTEGRALHEIGHT style is always enforced.
|
|
|
|
|
Thanks for all your answers,
I tried the LBS_INTEGRALHEIGHT but it did not work infact the list box was hidden all the more.Border and some part of list box was not seen because of edit box.
Also can you tell me how can I make list box to be on top of edit box since when the mouse cursor is over list box it appears as if the mouse cursor is on edit box instead of list box.
Thanks for the help.
Pritha
|
|
|
|
|
prithaa wrote: What should IO do?
Explain a bit further what it is you are trying to accomplish (by placing controls on top of others in this fashion). You may have a legitimate need, or simply a misunderstanding of how things work.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks for your replies.
I have an edit box on a child window whose OnKeyUp() function calls a list box to be seen on the window.Sometimes this listbox has to appear on another editbox where the edit box is half seen.
But when the listbox appears on the editbox where the editbox is in the background and the listbox is in the foreground ,the listbox's border(lower) gets cuts and is
not visible.The area where the list box meets edit box.
My problem is that the listbox should appear on the editbox (wholelly or partly) and the mouse cursor when placed on the list box should appear on the list box not on the edit box (if edit box is below the list box)
In my case the mouse cursor when placed on the list box doesn't have the normal arrow sign but has a cursor as if placed on the edit box.
Regards,
Prithaa
|
|
|
|
|
Hi all,
I need some help regarding MSMQ using VC++. i am new to this concept.
let say i am running a application on LOcal Pc and i want to save some information from this application into a database which is running on a remote machine.
can you please tell how MSMQ can be used in this scenerio.if you can provide a example for this that will be a great help to me.
Thanks
abhi
|
|
|
|
|
Can anyone help me?
I tried to open the web page using shell execute in maximized mode. the command as given below:
CString webURL = "www.yahoo.com"
HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_MAXIMIZE);
or
HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_SHOWMAXIMIZED);
it opens the page. but it display as normal not in maximized state. first time it opens maximized. in the internet explorer, if restored and call the same command in the exe, it brings the window in the front. It displays in the normal
|
|
|
|
|
sujtha wrote: HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_SHOWMAXIMIZED);
sound absurbd but try NULL instead of this->m_hWnd.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
i tried null also. same problem....
|
|
|
|
|
may be you should try like this
CString webURL = _T("www.yahoo.com");
HINSTANCE hInstance = (HINSTANCE)ShellExecute(0, _T("open"), _T("C:\\Program Files\\Internet Explorer\\iexplore.exe "), webURL, NULL, SW_SHOWMAXIMIZED);
|
|
|
|
|
From past experience, IE seems to want to do its own thing (e.g., use size/position from last use), rather than what you instruct it to do. I've not researched into this hardly at all, but it just seems to be this way more often than not.
You might try calling ShowWindow(hWnd, SW_SHOWMAXIMIZED) once IE is fully opened.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm just a beginner in visual C++/MFC. Can somebody give me an idea on how can I possibly stitch/join image files to view the whole picture while moving the scrollbar. These images are pre-stitch using photoshop and guided by the *.pmg file created. An idea is to add image file to the side and remove from the other side while scrolling. I'm experiencing problems on loading the next image because this is subject to repaint and causes a noticeable delay on scrolling. Example of this is a 9x9 image files picture.
Is it possible to do this without any delay on repaint?
I hope to hear from you guys.
This would be a big help for me.
|
|
|
|
|
Hi,
to make it without repainting will be impossible, but the delay is directly dependant on how your programm works.
I had a lot of delayment in my last project because I was creating/copying objects allover I needed something from the document. That mades have a delay of some 2 or 3 secs between doubleclicking to open a new window and having the window on the screen.
Solution? Working with pointers and accessing just the parameters I need in each concrete moment, but leaving the object in the doc.
In your project there can be different possibilities. Or you are charging images that are bigger than your container, then the computer has to edit the image to fit to size... or you are bringing the objects as me insteads of reading from a fixed place... or any other possibility.
If you post a bit of your code, relating your problem will be easier to look into.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Just wondering, how do you check if a USB Stick is inserted? Can you recommend some reading or maybe you can post the code. Thanks!
|
|
|
|
|