I am facing a strange issue.It is working well with outlook 2K3 but not anymore on outlook 2K7 and 2K10.
Problem - If I drag a file from my application and drop onto the message body in a new message in outlook 2007 nothing happens. Instead the expected behavior is - file should attach to the message. It work well in outlook 2003 and I haven't made any change in my code.
If I drag file from my application and drop on to windows desktop, it works without any problem. Now if I drag the same file from Windows desktop and drop onto the new message in outlook 2007, file gets attached. This leaves me guessing that there is something need to change in my code but I unable to figure out.
We have implemented the CFSTR_FILEDESCRIPTOR, CFSTR_FILECONTENTS and CF_TXT in the CDataObject::Getdata() method. I have noticed is that in case of outlook 2007, when I drop file(from my application) to message body in new message, only CFSTR_FILEDESCRIPTOR clipboard format is called. While in case of outlook 2003, if I drop file(from my application) to message body in new message CDataObject::GetData() is called two times, CFSTR_FILEDESCRIPTOR followed by CFSTR_FILECONTENTS clipboard formats.
In the second file contents are extracted since GetData is not called second time hence file is not attached to email. Following is the sample code.
Does anyone know what could be the reason ? Or what else i can try to narrow down the issue.
I think I have found a bug in the CString assignement operator of the ATL/MFC 8.
CStringT& operator=( __in_z_opt PCYSTR pszSrc )
The method calculates the length of the required buffer and allocates the buffer. The calculation does not include the terminating null character. Thereafter it calls MultiByteToWideChar, passing the length as the cchWideChar parameter.
The function MultiByteToWideChar returns 0 as failure indication, but this is ignored by the MFC. As a side effect, MultiByteToWideChar fills the output buffer on some platforms like Win32 and Windows CE 5.0 (SH4).
But the Windows CE 5.0 (x86) implementation of MultiByteToWideChar does not fill the buffer. Although the allocated buffer is too small, the bug is not visible on most platforms but on Windows CE 5.0 (x86). Here you get an empty CString after the assignment.
PCWSTR p = (PCWSTR)s;
assert(0 != p); The assert in the code above fails.
I have a multi threaded MFC exe built with all its basic classes including CSocket, with TCP connection through mainframe etc. , I want to split it to two different components. ATL service and MFC GUI. Can I do it and can I use the MFC classes in the ATL service.
Thanks in advance,
I have an almost opinion question. I am writing an instant messenger software, and I am trying to decide on the internal API parsing method. I cannot decide if I want to have a one-size-fits-all method that parses the entire command then returns the specific section I need, or less simple-to-use library of functions that read individual functions.
Basically, the command structure is like this: (Let's say you are registering a new connection)
Your first option would have a problem in that you would have a single function that returns either a stirng (or maybe pointer to string) or an integer. But this is not legal in C++, as the compiler cannot distinguish (from return type alone) which one you mean. A better option would be to create a class (or structure) that holds the user information and has methods (getters) that return the relevant properties.
first sorry for my poor english..
i have an "ATL simple object" interface like "IErrSupport" , and i want to use it as a parameter like:
(ISomething) DoSomething(...,IErrSupport *pErr);
(IOtherthing) DoOtherthing(...,IErrSupport *pErr);
i assumed like that ,but i don't know what to do .
1. crete a new atl project, maybe it named TestA.
2. Add a class "A";
3. IA Add methods like TestErr(IErrSupport *pErr);
.\TestA.idl(19) : error MIDL2025 : syntax error : expecting a type specification near "IErrSupport"
.\TestA.idl(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
5. add import "../ErrSupport/ErrSupport.idl"; to TestA.idl ,compiling...
d:\errsupport\testa\testa_i.h(69) : fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
Hello, I have a recordset which contains a lot of data , I need to save it into map or any kind of dictionnary (which have a key and other data)
I have for example :
strIdTrans = CUtils::GetVariantAsCString(vIdTrans);
strCaption = CUtils::GetVariantAsCString(vCaption);
strLang = CUtils::GetVariantAsCString(vLang);
strTranslation = CUtils::GetVariantAsCString(vTranslation);
// What I have here is :
- id_translation : key of table
- id_caption and id_language are REFERENCES from other tables.
- translation_text : data
So , what I need after is getting data by (id_caption and id_language) and it will be more better if (id_caption, id_language and id_translation)
how do that ?