|
toxcct wrote: that's not true anymore under VS2005 AFAIK
It's still true
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Why would it ? Function overloading is possible in C++ and you don't need to have a declaration for your functions. So, in your case you have a declaration of a function but no body for this function. As long as you don't call that function, everything will be fine. But once you call that function, you'll get a linker error.
Okay, I called the function and finally got a linker error, I was expecting an error during compiling...
I developed using Delphi the last 5 years and the ambigious overloading of types/variables/function C++ without any visible effect is driving me crazy...
In Delphi you had to add OVERLOAD or use a typecast..
The main reason for this problem:
- i want to create a dll that can be called from another app, using dynamic linking
- works so far
- I changed the implementation of a function (by accident) and got a very confusing exception after calling the function from the dll but no compiler error, though i linked the header file from the dll.
|
|
|
|
|
sGrabert wrote: - I changed the implementation of a function (by accident) and got a very confusing exception after calling the function from the dll but no compiler error, though i linked the header file from the dll.
What did you change exactly ? Because if the linker doesn't find an implementation for the function, it will show you a link error.
|
|
|
|
|
(i renamed the caption to "minor", seems more appropriate)
workflow:
1. DLL
1a. creating the dll.h file with function prototypes
1b. creating the dll.cpp file with function implementation
(the dll itself does not use the functions, so no linking check here!)
2. app
2a. dynamic loading of dll using dll.h
I wanted to ensure the correct calling of functions in the app using the .h file:
(i have cut all the class stuff etc.)
<br />
[dll.h]<br />
int DLLInit(char* DLLInfo);<br />
<br />
[app.h]<br />
#include "dll.h"<br />
typedef bool (*DLLINIT)(char* DLLInfo);<br />
DLLINIT pDLLInit;<br />
<br />
pDLLInit= (DLLINIT)::GetProcAddress(m_DLL, "DLLInit");<br />
Is this possible (or even useful) in any way?
-- modified at 5:50 Thursday 23rd August, 2007
|
|
|
|
|
Hello,
i like to know is it posible to include one application into other one?
I hava a dialogapplication with tabs, in one tab i like to include a external application,
is that posible, so that this extern app. run in my tab control? :->
thanks in advance
termal
|
|
|
|
|
Only if that external application is expecting to be hosted, and you call it with (eg):
c:\myotherapp.exe /hwndparent:0x0046747
This is pretty much how screen savers work, and how they are shown in the screen saver preview window.
OK, not *completely* true - you could try using hooks, detecting any window creation of the child exe, and try changing the window parameters to WS_CHILD - but that's a lot of work, and still not guaranteed to work.
Iain.
|
|
|
|
|
Hello,
thanks for your idea!
regards
termal
|
|
|
|
|
This was the concept behind COM servers. An ActiveX control is basically a mini application that runs in the context of a host.
"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 am modifying the class CMimeMessage : public CMimeHeader, i need to modify the
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;
}
}
to have an output:
Content-Type: image/jpeg; name="image003.jpg"
Content-Description: image003.jpg
Content-Disposition: inline; filename="image003.jpg"; size=2313;
creation-date="Wed, 01 Aug 2007 09:51:13 GMT";
modification-date="Wed, 01 Aug 2007 09:51:13 GMT"
Content-ID: <image003.jpg@01c7d464.924ce700>
Content-Transfer-Encoding: base64
instead of:
Content-Type: image/jpeg;
charset="Windows-1252"
name="image003.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="image003.jpg"
|
|
|
|
|
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
|
|
|
|
|