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



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


.



Relevant Pages

  • Re: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC))
    ... > Do you build a custom web control and when you drag and drop this control ... > It seems that something incorrect in your custom web control. ... public ITemplate Header ... BasketHeader basketHeader = new BasketHeader; ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Combobox Display Problem
    ... Header section of the Sub-form, and it was invisible when run as I mentioned. ... ' Find the record that matches the control. ... Header section of the form (subform), ... The Control Source for cboItem on fsubGroup is chrItem, ...
    (microsoft.public.access.forms)
  • Re: ToolTipText and the ListView control in VB6
    ... control setup. ... '* Description: Process MouseMove event. ... If .ToolTipText objListItem.Key Then ... '' the mouse must be in the header area. ...
    (microsoft.public.vb.controls)
  • RE: Filter records based on user input
    ... No, I did not put it in the header, I just uses an unbound text box in the ... I thought that the bookmark line would set the focus to the control in the ... which would filter your form based on the text in the textbox. ... It should filter the records as the user types the number. ...
    (microsoft.public.access.formscoding)
  • Re: Another GridView Bug -> PagerSettings.Visible
    ... GridView control is based on templates ... stage is the only time you can build the control structure. ... set to true and capture the pager row ... note that the header should be enabled when the pager is visible and ...
    (microsoft.public.dotnet.framework.aspnet)