R
Roßert G. Schaffrath
Sorry for the cross-posting. I am having a hard time trying to classify
exactly what group this question would apply to.
I had posted an earlier message to
microsoft.public.dotnet.framework.windowsforms trying to find a way to
access the lindex member of the FORMATETC structure for a
CFSTR_FILECONTENTS callback request under C#. After some experimenting
I was able to come up with the following code snippet that receives the
callback with a filled in FORMATETC and allows me to save the lindex
value. Unfortunately, I am now stumped at how to forward the callback
to the .Net framework copy of IDataObject.GetData so that the request
can be processed by the framework and ultimately forwarded to my
override of DataObject.GetData. The location that I would want to
forward the request is marked as "TODO:". Can this be done or do have I
have fully implement my own IDataObject.GetData routine?
internal class DataObjectEx : DataObject,
System.Runtime.InteropServices.ComTypes.IDataObject
{
private Int32 m_lindex;
void
System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref
System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out
System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)
{
if (formatetc.cfFormat ==
DataFormats.GetFormat(NativeMethods.CFSTR_FILECONTENTS).Id)
m_lindex = formatetc.lindex;
// TODO: Forward request on to .Net framework
IDataObject.GetData
}
public override object GetData(string format, bool autoConvert)
{
// Handle requests for certain formats and then...
return base.GetData(format, autoConvert);
}
}
exactly what group this question would apply to.
I had posted an earlier message to
microsoft.public.dotnet.framework.windowsforms trying to find a way to
access the lindex member of the FORMATETC structure for a
CFSTR_FILECONTENTS callback request under C#. After some experimenting
I was able to come up with the following code snippet that receives the
callback with a filled in FORMATETC and allows me to save the lindex
value. Unfortunately, I am now stumped at how to forward the callback
to the .Net framework copy of IDataObject.GetData so that the request
can be processed by the framework and ultimately forwarded to my
override of DataObject.GetData. The location that I would want to
forward the request is marked as "TODO:". Can this be done or do have I
have fully implement my own IDataObject.GetData routine?
internal class DataObjectEx : DataObject,
System.Runtime.InteropServices.ComTypes.IDataObject
{
private Int32 m_lindex;
void
System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref
System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out
System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)
{
if (formatetc.cfFormat ==
DataFormats.GetFormat(NativeMethods.CFSTR_FILECONTENTS).Id)
m_lindex = formatetc.lindex;
// TODO: Forward request on to .Net framework
IDataObject.GetData
}
public override object GetData(string format, bool autoConvert)
{
// Handle requests for certain formats and then...
return base.GetData(format, autoConvert);
}
}