ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   biff 2 clipboard (https://www.excelbanter.com/excel-programming/290845-biff-2-clipboard.html)

Anatoliy Atanasov

biff 2 clipboard
 
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.


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com