How to insert gif or any other animation into richedit control?

How to insert gif or any other animation into richedit control?
0
anonymous (74722)
3/5/2004 5:11:05 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
851 Views

Similar Articles

[PageSpeed] 33

Knowledge Base
Q220844
HOWTO: Insert a Bitmap Into an RTF Document Using the RichEdit Control

-- 
Command what is yours
Conquer what is not
Microsoft Most Valuable Professional [VC++]
http://www.csdn.net/develop/author/netauthor/jiangsheng/
http://blog.joycode.com/jiangsheng/
http://jiangsheng.blogone.net
"Steven.Xiang" <anonymous@discussions.microsoft.com> д���ʼ�
news:234A657F-AD07-496E-AB9E-6F25086A18FD@microsoft.com...
> How to insert gif or any other animation into richedit control?


0
sheng_jiang (305)
3/5/2004 5:32:02 AM
I had already look into the Q220844, but it's only insert a "Bitmap" not a "Gif" picture.
0
anonymous (74722)
3/5/2004 10:01:08 AM
use IOleCache interface queried from of IOleObject

 ASSERT_VALID(this);
 ASSERT(m_lpObject != NULL);

 // get IOleCache interface
 LPOLECACHE lpOleCache = QUERYINTERFACE(m_lpObject, IOleCache);
 if (lpOleCache == NULL)
 {
  TRACE0("Warning: object does not support IOleCache interface.\n";
  return FALSE;
 }
 ASSERT(lpOleCache != NULL);

 // new cache is for CF_METAFILEPICT, DVASPECT_ICON
 FORMATETC formatEtc;
 formatEtc.cfFormat = CF_METAFILEPICT;
 formatEtc.ptd = NULL;
 formatEtc.dwAspect = DVASPECT_ICON;
 formatEtc.lindex = -1;
 formatEtc.tymed = TYMED_MFPICT;

 // setup the cache so iconic aspect is now included
 DWORD dwConnection;
 SCODE sc = lpOleCache->Cache(&formatEtc,
  ADVF_NODATA|ADVF_PRIMEFIRST|ADVF_ONLYONCE, &dwConnection);
 if (FAILED(sc))
 {
  lpOleCache->Release();
  return FALSE;
 }

 // set data if iconic image provided
 if (hMetaPict != NULL)
 {
  STGMEDIUM stgMedium;
  stgMedium.tymed = TYMED_MFPICT;
  stgMedium.hGlobal = hMetaPict;
  stgMedium.pUnkForRelease = NULL;

  sc = lpOleCache->SetData(&formatEtc, &stgMedium, FALSE);
  if (FAILED(sc))
  {
   lpOleCache->Release();
   return FALSE;
  }
 }
 lpOleCache->Release();

 return TRUE;
}


-- 
Command what is yours
Conquer what is not
Microsoft Most Valuable Professional [VC++]
http://www.csdn.net/develop/author/netauthor/jiangsheng/
http://blog.joycode.com/jiangsheng/
http://jiangsheng.blogone.net
"steven.xiang" <anonymous@discussions.microsoft.com> д���ʼ�
news:F3D49AAB-2F87-4B82-B43E-E62ACCE55C50@microsoft.com...
> I had already look into the Q220844, but it's only insert a "Bitmap" not a
"Gif" picture.


begin 666 wink.gif
M1TE&.#EA#P`/`+,``````+^_O___````````````````````````````````
M`````````````````````"'Y! $```$`+ `````/``\```0T,$@):ITX5,'Y
MQ4 G>E,XC@`EF.MJIJSEQ>PI;C9:YZYGOQK?C12<R8C%7P;7^60TEA0F`@`[
`
end

0
sheng_jiang (305)
3/5/2004 12:06:53 PM
Reply:

Similar Artilces:

How do I insert Roman Numerals?
New to Word 2007 would someone please explain to me how to insert Roman Numerlas in my document? "ckj" <ckj@discussions.microsoft.com> wrote in message news:6CF0C580-BA6E-463D-B4FD-E6A6FDD9E814@microsoft.com... > New to Word 2007 would someone please explain to me how to insert Roman > Numerlas in my document? Just type them... I II III IV V VI VII VIII IX X XI etc etc. Type a number e.g. 21, select it and run the following macro Dim oRng As Range Set oRng = Selection.Range oRng.Fields.Add oRng, 34, oRng.Text & " \*Roman"...

Insert trigger
Looking for some advice on SQL 2005. I have a table that will usually be populated by an SSIS package. I want to set the "loaddate" column to the current time after a record is inserted. Should i do this via trigger or should i just build a step in the SSIS package to update the column after the file loads? If trigger is the way to go, what is the syntax to create the after insert trigger? Thanks in advance. You can create a default constraint on the table set to CURRENT_TIMESTAMP. That will handle the automatic date assignment without any need for coding. -...

how to automatically enable controls' xp theme in a dialog
In the dialog generated with previous version of vc, the controls automatically display as xp theme. But, when i use the newest version of vc and build a dialog,and the controls display as classical windows theme. My question is how to make the controls automatically enable xp theme when the theme is enabled. thanks, best regards, kywoo ...

inserting hrs and minutes
I have a cell in my time card that displays total weekly time -ex- "40:15" is there a way to make it more like this...40hrs,15mins -- Message posted from http://www.ExcelForum.com Use a custom format hh"hrs",mm"mins" -- Regards, Peo Sjoblom "-Brian-H- >" <<Brian-H-.110wgs@excelforum-nospam.com> wrote in message news:Brian-H-.110wgs@excelforum-nospam.com... > I have a cell in my time card that displays total weekly time -ex- > "40:15" is there a way to make it more like this...40hrs,15mins ? > > > ...

Control Name when New workbook opened from a template
How can I control the name of a new workbook opened from template? Such as using MyWorkbook.xlt to open MyWorkBookToday.xls instead of MyWorkbook1.xls. Thanks, Steve -- SC from Lubbock, Texas The name of the file (including the extension) is set when you (or the user) saves the file. I don't think you can control how excel names workbooks that are created based on template files. Well, you could provide a macro that creates the file and then saves the file with the name (and location) you want. SC in Texas wrote: > > How can I control the name of a new work...

Discount Control
can i control the discounts in MS RMS 1.3 ex. cashier 1 should can do discounts but not more that 10 % ? -- Moh''''D Abdel-Hadi Exhortech Business Solutions ...

insert an interactive excel file into word web page
I'm trying to insert a excel file into a word document with text, and then save it was as a web page, but I want to keep the excel part interactive. Any ideas? ...

Insert | File > Attachmnet-Button Drop Down ;What is the difference between Insert and Insert As Attachmnet
re: "Outlook2003, File-Insert-Options" On making new-email with Attachment-File(s), ** File Menu | Insert | File >>> (Brows and select File to insert ) then we can see the button "Insert", and write side Drop Down Arrow lower-right side of Dialog Box; If it clicked, we can see three options as follows: ** Insert Insert as text Insert as Attachment I can not recognize/understand the difference between "Insert" and "Insert as Attachment" *** What is the difference between Insert and Insert As Attachment ? I would appreciate y...

Inserting Hyperlinks in a Protected Sheet
Hi I run Excel 2000 and I have a protected worksheet that I share wit users in my organisation. I want to allow the insertion of a hyperlin to a specific file type within a specified directory on our server. 3 Questions: 1.Protection on disables the insert hyperlink command. Can this b overcome with worksheet activate code? 2.Can I limit the types of files (preferably by requiring the file t meet a mask format eg "z-*.xls")? 3.Can I limit the directory that can be linked, by referring to pathname stored in a cell on the active sheet? Would appreciate your suggestions. Thanks S...

Control Object
I have several control objects on a worksheet linke to cells. When i protect the worksheet i cant use the objects (comobo box, text box). Can this be done? Maybe move the links to another worksheet (and even hide that one). Or just unprotect those cells. (maybe you can dedicate a column for these links and then hide the column. That usually stops most people from selecting them.) Larry wrote: > > I have several control objects on a worksheet linke to > cells. When i protect the worksheet i cant use the objects > (comobo box, text box). Can this be done? -- Dave Peterson ...

Insert with a where condition
Hi, sql 2005 I have an insert statement that is ignoring the where condition. That is, I want to insert records when they do not already exist in the destination table. INSERT INTO dbo.tblmnuGroupPerm ( gId ,mtfID ,... ) SELECT @gID ,mtfID ,... FROM dbo.locmnuTabFunction AS ltf WHERE ltf.mtfID NOT IN ( SELECT gp.mtfID FROM dbo.tblmnuGroupPerm AS gp WHERE gp.gId=@gID AND gp.Deleted=0 ) Any ideas or recommendations appreciated :-) Many thanks, Jonathan It's OK... <oops "redFace">I did not correctly se...

Subclassing List Control
I want to place a list control object in my dialog window; however I have some requirements on how the control is to appear. For example, the control is to appear with a black background, certain columns in the control are to be painted with specific foreground colors and a specific font is to be used. Can someone post an example on how I can alter the control's background color and how to paint specific columns using different foreground colors and fonts? Thanks Chris Take a look at www.codeguru.com for samples. List controls supports NM_CUSTOMDRAW which allows you to control each...

Get/Replace words in HTML control
Hi all, I have an application that has an HTML control (like the CHtmlEditCtrlBase in VC7, but in VC6) to compose email messages. I want now to add spell checking to it. I have the spell checking engine, I have only to provide the words to it, and I'll get the list with suggestions. My question is how can I retrieve the text from that control without all the HTML tags. The second question is, when I have the replacement for a misspelled word, how can I replace the misspelled word in the HTML control with the correct one? I hope somebody has an easy way to do this :) Thanks, Mihaly ...

Insert
I want to overtype in a Publisher text box. I find I can only insert. The "insert" key doesn't do anything. ...

how to insert data in a table
Hi Exprets; I am creating an access database in which I want to insert data in already created table. Kindly help. Regards, Vikky Vikky <love.excel@gmail.com> wrote in news:1194124711.012302.269990 @e34g2000pro.googlegroups.com: > Hi Exprets; > > I am creating an access database in which I want to insert data in > already created table. > > Kindly help. > > Regards, > > Vikky > Data from where? Do you want to import it from excel, from a text file, copy it from another table or type it in manually? -- Bob Quintal PA is y I've altere...

How do you insert page numbers larger than 1000?
I have my purchase orders set up as a Publisher document. When our organization upgraded from Publisher 2000 to Publisher 2002, the new version set parameters on the page numbers. This was one of those things that worked just fine in the previous version... Does anyone know how to turn it off or change it? Hi mregen (mregen@discussions.microsoft.com), in the newsgroups you posted: || I have my purchase orders set up as a Publisher document. When our || organization upgraded from Publisher 2000 to Publisher 2002, the new || version set parameters on the page numbers. This was one of those...

insert downloads into power point
i downloaded an application called "BioDigital Simulator" of an animated cleft lip/palate surgery and need it put into my power point presentation, but can't fiugre out how to do so.... very frustrating... What kind of file is this application? Is it a video? If so, what kind? MPEG? AVI? MOV? Or is it an EXE file? Something else? Which version of PPT are you using? -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover...

Insert dataset to another database
I'm posting this to this group also since it pertains to queries, primarily. Hello, Using VB6/ADO, I'm thinking I can create a recordset and insert it into another table in a different Jet database, all within the execution of a single query. But, I can't seem to get it to work, even in an experiment in Access 2K. My sql in Access 2K: SELECT D.lorder as Ord, A.Lorder FROM [;Database = C:\MyDocuments\Acc2K\Wrk.mdb].OrdersData as A INNER JOIN [;Database = C:\Access\Work\Sales06.mdb].Detl1 as D On D.Lorder = a.lorder WHERE ((D.fg)= 'MXX-NC' Or (D.fg)= 'MXX.NC')...

Insert a blank row
Hi, I need some help to insert a blank row in a range where column A has a series of dates. There will be several of the same dates and I need to both sort the dates and then insert the blank row at the end of each sequence. In the blank row I need to total figures that will be in columns B through to G. Thanks, Jim S Hi Jim maybe an easier solution 1. Sort your data (use 'Data - Sort', e.g., column A ascending) 2. Use 'Data - Subtotals' This will insert a row after each date and calculate subtotals automatically for you HTH Frank anon wrote: > Hi, > I need some...

Link to file in HTML Viewer or IWebBrowser2 control problem
Hi, I am working with an HTML viewer dialog by using Paul DiLascia's CHtmlCtrl class from his article in the January 2000 of Microsoft's Systems Journal. I also added the WebBrowser ActiveX control directly. The html code I am trying to load in each case (CHtmlCtrl and WebBrowser) contains a hyperlink to a JPEG file in the current directory. I load the html code as a resource and also I set it directly as a string. In both cases (and with boths control approaches) the result of clicking the Jpeg hyperlink is a blank page in Internet Explorer with the string "about:blankCOMMAND....

How do I insert a letter into an existing word document?
I am working on a large document that I need to add several letters that are on our letterhead. If I cut and paste the letter, the letterhead header becomes skewed. This is just one issue I'm having with the document! Also need to know how to merge 3 separate documents together once I insert the letters that I need! Help! What do you mean by "skewed"? To preserve the data from the header of the document, you will need to insert it into a Section of its own separated from the rest of the document by Next page Section breaks before and after it with the headers...

How do I insert backround into my picture inserts?
Could you please elaborate on your question, and give us details such as your version of Publisher. -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com This posting is provided "AS IS" with no warranties, and confers no rights. "TAMOS" <TAMOS@discussions.microsoft.com> wrote in message news:A1B3ABEC-F208-4A23-B695-9C0EEFBF649F@microsoft.com... > How to Compose a Good Newsgroup Post http://dts-l.org/goodpost.htm How to Act Smart on Usenet http://www.catb.org/~esr/faqs/smart-questions.html Getting Your Post Noticed - and Answered http:...

Tab order for dynamically placing controls?
Hi Gurus, I'm having a dialog in which TAB control is placed dynamically. Now the tab order for the dialog is happening only for the statically place control . Focus is not happening for dynamically placed controls inside the tab; How can I assign the tab control in the order of controls placed inside the dialog; IE MY tab control is residing somewhat middle in the dialog and have lot of other controls are there at upper and lower side to the TAB control. How can I assign the tab order in this scenario. I looked into SetWindowPos function to control the Z-order of controls; TIA! Anu ...

Controlling multiple TCP connections from Outlook 2003 clients
I've noticed that Outlook 2003 clients can have multiple TCP connections to the mailbox store on Exchange. As the following web link claims: http://www.windowsitpro.com/Article/ArticleID/46319/46319.html "This behavior is by design. Outlook can open multiple connections to parallelize its data communications with the Exchange server. The actual number of connections will vary according to the version of Outlook that you're using and the mode in which you're using it. For Microsoft Office Outlook 2003 in Cached Exchange Mode, you'll see four connections for the mailbox, ...

Inserting images into excel conditionally
I have a large product price list (1200 items) with one column for quantity. I would like excel to import the appropriate image for a product once the condition entered is that quantity is > 0. Is this possible? If so then please help. Thanks Pav One way http://www.mcgimpsey.com/excel/lookuppics.html can be adapted to your situation -- Regards, Peo Sjoblom "Pav" <Pav@discussions.microsoft.com> wrote in message news:37DC7373-14E6-4F11-9136-71DC3AD93CC2@microsoft.com... > I have a large product price list (1200 items) with one column for quantity. > I would l...