biff 2 clipboard

A

Anatoliy Atanasov

Hi all,

I am looking for an example(MFC or C++) of a BIFF format that i can
put in the Clipboard.
I've tried to modify "Saving Excel 2.1 Workbook" by Andrei
Litvin(codeproject.com) without success for now.

here is the code:
///////////////////////////////////////////////

COleDataSource* pSource = new COleDataSource();

CSharedFile sf(GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT);

CString s1 = "string 1";
CString s2 = "string 2";

CMiniExcel miniexcel;

miniexcel(0,0) = s1;
miniexcel(1,0) = s2;

miniexcel.Write(&sf);
int i = sf.GetLength();

HGLOBAL hMem = sf.Detach();
UINT format = ::RegisterClipboardFormat("BIFF");
pSource->CacheGlobalData(format,hMem);
pSource->SetClipboard();

////////////////////////////////////

Any ideas and information about BIFF are welcome.

Thanks.
 
Top