Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

Last post 02-04-2009 9:39 AM by jayvardhanpatil. 22 replies.

Sort Posts:

  • Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    01-31-2006, 5:11 AM
    • Member
      5 point Member
    • ebdrup
    • Member since 01-31-2006, 10:07 AM
    • Posts 1

    Now I've tried to create my own class library and reference it, when I drag
    and drop a control (Basket) from the library in VS.Net 2005 I get the error:
    Invalid FORMATETC structure (Exception from HRESULT:
    0x80040064(DV_E_FORMATETC))

    The code in the class library is:
    Basket.cs:
    ----------
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.ComponentModel;
    namespace WebUI.Basket
    {
    [ParseChildren(true)]
    class Basket : Control, INamingContainer
    {
    //public void Basket() { }
    private ITemplate _headerTemplate = null;
    [TemplateContainer(typeof(BasketHeader))]
    public ITemplate Header
    {
    get
    {
    return _headerTemplate;
    }
    set
    {
    _headerTemplate = value;
    }
    }
    // override to prevent literal controls from being added as children
    protected override void AddParsedSubObject(object o)
    {
    }
    protected override void CreateChildControls()
    {
    // if (Header != null)
    // {
    // create header
    BasketHeader header = new BasketHeader();
    // initialize header from template
    Header.InstantiateIn(header);
    // add header to the child controls collection
    Controls.Add(header);
    header = new BasketHeader();
    // initialize header from template
    Header.InstantiateIn(header);
    // add header to the child controls collection
    Controls.Add(header);
    //}
    }
    }
    }
    ----

    BasketHeader.cs:
    ---
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.ComponentModel;

    namespace WebUI.Basket
    {
    class BasketHeader : Control, INamingContainer
    {
    }
    }
    ---

    Can anyone help me with this?

    Kind Regards,
    Allan Ebdrup

     

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    04-29-2006, 4:34 PM

    Experiencing the same problem with all of my controls. I've seen other people with the same problem with no apparent link. Does anybody from Microsoft care to comment on this extremely vague error? Why would this exception be thrown when one tries to drag and drop the control from into code view.

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    05-10-2006, 4:21 PM
    • Contributor
      3,019 point Contributor
    • BoulderBum
    • Member since 09-07-2003, 12:30 AM
    • Posts 608

    Ditto here. What gives?

    My exception was prefaced by:

    "Control cannot be created because Visual Studio cannot find the control's type in the control assembly"

    Oddly enough, it found the type well enough to put it in the Toolbox correctly.

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    05-23-2006, 9:36 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    Ahh... I just got this one, too bad no reply yet from anyone on the Vis team or ASP.NET teams.

    I found that after upping the version of my control llibrary, and making sure it didnt coflict with anything in the GAC i was fine. Making sure the web project could compile with the new web control dll before trying any new controls.

    Bascially i think that error has to do with it finding a conflict in assemblies, and it gets confused. But I could be completly mistaken.

     

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    07-26-2006, 5:20 PM
    • Member
      147 point Member
    • joewoo
    • Member since 07-13-2006, 6:40 PM
    • Posts 48
    I just got this error too. Anyone found a solution for this one yet? Thanks.
  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    07-27-2006, 8:49 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    As I mentioned above,

    "

    I found that after upping the version of my control llibrary, and making sure it didnt coflict with anything in the GAC i was fine. Making sure the web project could compile with the new web control dll before trying any new controls.

    Bascially i think that error has to do with it finding a conflict in assemblies, and it gets confused. But I could be completly mistaken.

    "

    Since that ( a long time ago ) I have not had that issue resurface.

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    08-28-2006, 12:59 AM
    • Member
      40 point Member
    • Mr.Slammer
    • Member since 02-25-2005, 2:43 AM
    • Posts 8

    try adding public modifier in your controls' class

    hope this help :)

     

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    09-18-2006, 2:31 PM
    • Contributor
      3,019 point Contributor
    • BoulderBum
    • Member since 09-07-2003, 12:30 AM
    • Posts 608
    I just wanted to jump in and note that the control class was public in my case. Something else is going on with this error.
  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    12-26-2006, 10:24 PM
    • Member
      259 point Member
    • MNF
    • Member since 07-25-2005, 12:15 AM
    • Posts 72

    I've added my Control Library DLL  into the Toolbox correctly. 
    Then when I tried to add it to my page in both design and source view, Ive got "Control cannot be created because Visual Studio cannot find the control's type in the control assembly" and then Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC)).

    However when I've closed and then re-opened solution, I was able to add my controls successfully.

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    12-28-2006, 3:06 AM
    • Contributor
      2,729 point Contributor
    • guenavan
    • Member since 01-09-2004, 9:25 AM
    • Novossibirsk(S. Iberia)
    • Posts 1,279
    I tried this code,
    I succeded to add Basket to TollBox
    Trying to drag&drop onto Design surface doesn''t have any reaction (neither error or something inserted)
    Drag&dropping into Editor in Source mode gives this error in MessageBox. Nothing is inserted
    -------------------
    Guennadi Vanine - Gennady Vanin - Геннадий Ванин (Novosibirsk)
    Looking for an opportunity job

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    12-28-2006, 6:02 PM
    • Member
      259 point Member
    • MNF
    • Member since 07-25-2005, 12:15 AM
    • Posts 72

    Гена,

    Try to close Visual Studio and re-open it again.

    Может, поможет.
    Миша.

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    05-12-2007, 5:56 AM
    • Member
      37 point Member
    • cruster
    • Member since 02-28-2005, 5:38 AM
    • Posts 14
    You need to declare the control as public.
    That is:
    public class Basket : Control, INamingContainer
    {
    ...
    }
  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    05-28-2007, 10:42 AM

    Declaring the class as being public unfortunately does not "solve" INVALID FORMATETC structure. I think what the prior person really meant to state was make sure there your class is public AND HAS a public default constructor

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    05-29-2007, 10:52 AM
    • Member
      37 point Member
    • cruster
    • Member since 02-28-2005, 5:38 AM
    • Posts 14

    Oh yes, it does. At least for me it did solve the problem. And my control does not have any constructor.

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))

    06-20-2007, 10:36 PM
    • Member
      702 point Member
    • Dil
    • Member since 06-02-2007, 2:12 AM
    • Posts 112

    I found it..!! 

    I have used this attribute in my custom control and it throws the same error.,,!!   When I removed its working fine.!! 

    [ToolboxItem(true)] 

     

    Thanks

    Dil

Page 1 of 2 (23 items) 1 2 Next >