We help IT Professionals succeed at work.

IMimeBodyW interface

sparkythedog
sparkythedog asked
on
Medium Priority
335 Views
Last Modified: 2013-11-20
I want to use the unicode versions for IMimeMessage, IMimeBody etc.. (IMimeMessageW, IMimeBodyW)..but I wasn't able to find them in mimeole.h header. I'm wondering if I have to update this header and the corresponding idl file and if is so from where should I update them?

Thanks
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
According to the docs (see e.g. http://msdn.microsoft.com/library/en-us/OutlookExpress/oe/reference/ifaces/imimemessage/settextbody.asp), these interface already work with UNICODE:

      #define SZ_TEXT_BODY L" Hi!!!\n\n\n -BryanSt"
      pStreamTemp = SHCreateMemStream((BYTE *)SZ_TEXT_BODY,
                                              sizeof(SZ_TEXT_BODY));
      if (pStreamTemp)
      {
         hr = pMessage->SetTextBody(TXT_PLAIN, IET_UNICODE, hBody,
                                               pStreamTemp, NULL);
         pStreamTemp->Release();
      }
      hr = pMessage->Commit(0);

All you need to do is setting 'ietEncoding' to 'IET_UNICODE'.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
The thing is I have to get the name of the attached file and I'm using the following method:

LPSTR pstrAttachName;
pMimeBody->GetDisplayName( &pstrAttachName )

if the attached filename contains unicode characters, the pstrAttachName will contain this: ??????.jpg and not the unicode characters.

The project is compiled for UNICODE.

thanks
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
That probably is related to you locale.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.