Click here to Skip to main content
15,899,583 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Add item in the System pop-up menu Pin
Waldermort29-Aug-07 16:48
Waldermort29-Aug-07 16:48 
AnswerRe: How to Add item in the System pop-up menu Pin
Jason Teagle29-Aug-07 22:23
Jason Teagle29-Aug-07 22:23 
Questiondon't know how to aplly CHtmlView to CFrameWnd Pin
Ryu Jin29-Aug-07 15:53
Ryu Jin29-Aug-07 15:53 
AnswerRe: don't know how to aplly CHtmlView to CFrameWnd Pin
Roger Broomfield29-Aug-07 18:42
Roger Broomfield29-Aug-07 18:42 
GeneralRe: don't know how to aplly CHtmlView to CFrameWnd [modified] Pin
Ryu Jin29-Aug-07 19:18
Ryu Jin29-Aug-07 19:18 
GeneralRe: don't know how to aplly CHtmlView to CFrameWnd Pin
Roger Broomfield29-Aug-07 21:24
Roger Broomfield29-Aug-07 21:24 
QuestionNeed for Multipart/mixed content type Pin
monsieur_jj29-Aug-07 14:50
monsieur_jj29-Aug-07 14:50 
AnswerRe: Need for Multipart/mixed content type Pin
monsieur_jj29-Aug-07 17:19
monsieur_jj29-Aug-07 17:19 
I made my own version of writedata

virtual BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary=NULL, DWORD dwFlags = 0) throw()
	{	
		if (pOverlapped == NULL)
		{
			return FALSE;
		}

		// Make the MIME boundary for this message
		char szBoundaryBuf[ATL_MIME_BOUNDARYLEN+1];
		if(MakeBoundary(szBoundaryBuf,ATL_MIME_BOUNDARYLEN+1) == FALSE)
			return FALSE;

		// if the passed boundary is valid, this is an attached message
		if (szBoundary && *szBoundary != '\0')
		{
			_ATLTRY
			{
				// output the MIME header for a message attachment
				CStringA strHeader;
				strHeader.Format("\r\n\r\n--%s\r\nContent-Type: message/rfc822\r\n\tname=\"%s\"\r\nContent-Transfer-Encoding: 8bit\r\n"
					"Content-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n", 
					szBoundary, m_szDisplayName, m_szDisplayName);

				if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)strHeader), strHeader.GetLength(), pOverlapped))
				{
					return FALSE;
				}
			}
			_ATLCATCHALL()
			{
				return FALSE;
			}
		}

		if (!CMimeHeader::WriteData(hFile, pOverlapped, szBoundaryBuf, dwFlags))
			return FALSE;

		// Create and output the header
		CStringA strHeader;
		char szBoundaryBufTwo[ATL_MIME_BOUNDARYLEN+1];
		if (MakeMimeHeader(strHeader, szBoundaryBuf))
		{	
			MakeBoundary(szBoundaryBufTwo,ATL_MIME_BOUNDARYLEN+1);
			MakeMimeHeaderTwo(strHeader, szBoundaryBufTwo);
		}
		else
		{
			return FALSE;
		}

		if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)strHeader), strHeader.GetLength(), pOverlapped))
		{
			return FALSE;
		}

		CMimeBodyPart* pCurrPart;
		POSITION currPos = m_BodyParts.GetHeadPosition();

		//Dump the body parts
		while (currPos != NULL)
		{
			pCurrPart = m_BodyParts.GetAt(currPos);
			if (pCurrPart->GetContentType()== "text/html"){
			if (!pCurrPart->WriteData(hFile, pOverlapped, szBoundaryBuf, dwFlags))
			{
				return FALSE;
			}
			m_BodyParts.GetNext(currPos);
			}
			else
			{
			if (!pCurrPart->WriteData(hFile, pOverlapped, szBoundaryBufTwo, dwFlags))
			{
				return FALSE;
			}
			m_BodyParts.GetNext(currPos);
			}
		}

		char szBuf[ATL_MIME_BOUNDARYLEN+(sizeof("\r\n\r\n--%s--\r\n"))];
		//output a trailing boundary
		if (*szBoundaryBuf)
		{
#if _SECURE_ATL
			int nBufLen = sprintf_s(szBuf, ATL_MIME_BOUNDARYLEN+(sizeof("\r\n\r\n--%s--\r\n")),
				"\r\n\r\n--%s--\r\n", szBoundaryBuf);
#else
			int nBufLen = _snprintf(szBuf, ATL_MIME_BOUNDARYLEN+(sizeof("\r\n\r\n--%s--\r\n")),
				"\r\n\r\n--%s--\r\n", szBoundaryBuf);
#endif
			if ((nBufLen < 0) || (!AtlSmtpSendAndWait(hFile, szBuf, nBufLen, pOverlapped)))
			{
				return FALSE;
			}
		}

		return TRUE;
	}


Now i have a different output i have the working boundary for the whole mime unfortunately I only want them for the embedded attachments, how can I do this? Can anyone make a change to the code above?

Then it is enclosed by another boundary the first I made unfortunately it has no header content-type which i expect to be multipart/mixed, it is being over written by multipart/related eventhough i already changed the function names for them so they will be performed both, How can I write both headers?
QuestionactiveX wrapper files - how to generate? Pin
charlieg29-Aug-07 13:50
charlieg29-Aug-07 13:50 
AnswerRe: activeX wrapper files - how to generate? Pin
Mark Salsbery29-Aug-07 14:08
Mark Salsbery29-Aug-07 14:08 
QuestionCControlBar derived class example? Pin
Jerry Evans29-Aug-07 8:55
Jerry Evans29-Aug-07 8:55 
AnswerRe: CControlBar derived class example? Pin
bob1697229-Aug-07 12:10
bob1697229-Aug-07 12:10 
QuestionUsing CFile or CStdioFile with CEditView - how to copy the entire text Pin
Vaclav_29-Aug-07 8:21
Vaclav_29-Aug-07 8:21 
AnswerRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Russell'29-Aug-07 9:09
Russell'29-Aug-07 9:09 
GeneralRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Vaclav_29-Aug-07 10:28
Vaclav_29-Aug-07 10:28 
AnswerRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Dennis Gourjii29-Aug-07 9:42
Dennis Gourjii29-Aug-07 9:42 
GeneralRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Vaclav_29-Aug-07 10:26
Vaclav_29-Aug-07 10:26 
QuestionRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Mark Salsbery29-Aug-07 9:45
Mark Salsbery29-Aug-07 9:45 
AnswerRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Vaclav_29-Aug-07 10:20
Vaclav_29-Aug-07 10:20 
GeneralRe: Using CFile or CStdioFile with CEditView - how to copy the entire text Pin
Mark Salsbery29-Aug-07 12:11
Mark Salsbery29-Aug-07 12:11 
QuestionData Sychronization Pin
Anthony988729-Aug-07 7:53
Anthony988729-Aug-07 7:53 
QuestionCallback functions???? Pin
pblais29-Aug-07 5:35
pblais29-Aug-07 5:35 
AnswerRe: Callback functions???? Pin
Russell'29-Aug-07 5:42
Russell'29-Aug-07 5:42 
GeneralRe: Callback functions???? Pin
pblais29-Aug-07 12:16
pblais29-Aug-07 12:16 
QuestionAccess violation when using STL map in DLL (VS7) Pin
Danny77uk29-Aug-07 5:10
Danny77uk29-Aug-07 5:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.