ࡱ> WYV XbjbjcTcT *Z>>@!xx Pjjj$s9jjjjj;jj-(:Q0/bB//$jjjjjjjjjjjjjj/jjjjjjjjjx : Dynamic Data Exchange and XlTable Format Microsoft Windows provides several methods for transferring data between applications. One way to transfer data is to use Windows dynamic data exchange (DDE). DDE is a message protocol for data exchange between Windows programs. It allows software developers to design applications that share data and thereby provide the user with a more integrated Windows environment. For complete information about DDE, see the documentation for the Microsoft Windows Software Development Kit (SDK). This article describes the DDE formats that Microsoft Excel supports, and it provides detailed information about the high-performance XlTable DDE format. DDE Formats Microsoft Excel supports several DDE formats. The formats are listed in the following table in the order of precedence defined by Microsoft Excel, from highest precedence (XlTable) to lowest precedence (CF_METAFILEPICT). Clipboard formats that begin with CF_ are formats that are already defined in Windows.h. Clipboard formats without CF_ must be registered before use. For more information about registering formats, see Registering Clipboard Formats. Clipboard formatDescriptionXlTableMicrosoft Excel fast table format. For more information, see Fast Table Format.Biff5Binary interchange file format (BIFF) for Microsoft Excel version 5.0. For more information about the file format, see Microsoft Excel File Format.Biff4Binary interchange file format (BIFF) for Microsoft Excel version 4.0.Biff3BIFF for Microsoft Excel version 3.0.BiffBIFF for Microsoft Excel version 2.x.CF_SYLKMicrosoft symbolic link (SYLK) format. Microsoft Excel for the Apple Macintosh was originally designed to use SYLK format, and this format is now supported by Microsoft Excel on both the Windows and Macintosh platforms.Wk1Lotus 1-2-3 Release 2.01 and Release 2.2 format.CsvComma-separated values format, commonly used in BASIC language I/O. This is similar to CF_TEXT format, except that Csv uses commas to separate fields. CF_TEXTThe simplest form of Clipboard data. It is a null-terminated string containing a carriage return and linefeed at the end of each line.Rich Text FormatA method of encoding formatted text and graphics for easy transfer between applications. Rich Text Format (RTF) is commonly used by document-processing programs such as Microsoft Word for Windows and Microsoft Word for the Macintosh.CF_DIFAn ASCII format used by the VisiCalc"! spreadsheet program. The format is under the control of Lotus Development Corporation.CF_BITMAPA Windows version 2.x-compatible bitmap.CF_METAFILEPICTA metafile picture structure. For complete information, see the documentation for the Microsoft Windows Software Development Kit. Registering Clipboard Formats Whenever an application uses a private Clipboard format such as XlTable, Biff5, Biff4, Biff3, Biff, Wk1, Csv, or Rich Text Format it must register the format before using it. Microsoft Excel registers these private Clipboard formats, and your DDE application must also register any of these formats that you want to use to exchange data. For example, to register XlTable, use the following Windows API function call. wCBformat = RegisterClipboardFormat((LPSTR)"XlTable"); If the function call is successful, the return value is equal to the format value for the XlTable format. This format value (type WORD) is between 0xC000 and 0xFFFF, and it's equal to the format value that Windows returned to Microsoft Excel when it registered XlTable. If Windows cannot register XlTable, the function returns 0 (zero). Fast Table Format The fast table format, XlTable, is designed to maximize the DDE transfer speed of Microsoft Excel. XlTable consists of a sequence of data blocks that represent a rectangular selection of cells (a table). Each data block has three parts: WORD tdt /* the table data type */ WORD cb /* the size (count of bytes) of the data */ BYTE data[cb] /* the data */ The first data block is always of type tdtTable, which specifies the number of rows and the number of columns in the table. The data blocks that follow tdtTable represent all the cells in the table. Microsoft Excel renders the reference of the cells in the table (for example, R1C1:R2C4) as the item part of the DDE message. The cells are always rendered row-wise. In other words, all the cells in the first row of the table appear first, then all the cells in the second row, and so on. To minimize overhead, adjacent cells of the same type (tdt) are represented together in one data block, even if the cells are in different rows. In other words, one tdtFloat can contain several numbers, one tdtString can contain several strings, one tdtBool can contain several Boolean values, and so on. For examples, see the following sections, "XlTable Example 1" and "XlTable Example 2." The data block types are described in the following table. Data block type ValueDescriptiontdtTable0x0010The size of the table. The data (4 bytes, cb=4) consists of two words. The first word is the number of rows, and the second word is the number of columns.tdtFloat0x0001IEEE-format floating-point number. The size of the number is 8 bytes per cell.tdtString0x0002String in st (byte-counted) format. The first byte contains the length of the string (cch). The string isn't null-terminated.tdtBool0x0003Boolean value: 1 = TRUE 0 = FALSE The length of the data is 2 bytes per cell.tdtError0x0004Error value: 0 = #NULL! 7 = #DIV/0! 15 = #VALUE! 23 = #REF! 29 = #NAME? 36 = #NUM! 42 = #N/A The length of the data is 2 bytes per cell.tdtBlank0x0005A count of the number of consecutive undefined (blank) cells. The data (2 bytes, cb=2) contains the number of consecutive blank cells.tdtInt0x0006Unsigned integer. The length of the data is 2 bytes per cell. Microsoft Excel can read a number in this format, but it never writes a number in this format. tdtSkip0x0007Number of cells to skip. A skipped cell is a cell that retains its previous value. In other words, a skipped cell isn't changed by a WM_DDE_DATA message. You can use tdtSkip to increase DDE performance if your application changes only one or two cells in the middle of a large table. Microsoft Excel doesn't support tdtSkip when the new cell data is part of a WM_DDE_POKE message. The length of the data is 2 bytes (cb=2). XlTable Example 1 The following selection of three cells . . . A1 East A2 West A3 North . . . produces the XlTable rendering shown in the following table. Data (hexadecimal)Description10 00 04 00 01 00 03 00tdtTable, cb=4, rows=1, columns=302 00 10 00tdtString, cb=1604 45 61 73 74cch=4, East (tdtString continued)04 57 65 73 74cch=4, West (tdtString continued)05 4e 6f 72 74 68cch=5, North (tdtString continued) Notice that the table contains three cells, but the XlTable rendering contains only one tdtString data block. XlTable Example 2 The XlTable format uses the tdtBlank data block to represent blank cells in a table. A sequence of several blank cells may be represented by a single tdtBlank data block. For example, the following table . . . A1: 2 A2: 3 B1: 4 B2: 5 D1: 6 D2: 7 . . . produces the following XlTable rendering. Data (hexadecimal)Description10 00 04 00 02 00 04 00tdtTable, cb=4, rows=4, columns=206 00 08 00 02 00 03 00 04 00 05 00tdtInt, cb=8, int[0]=2, int[1]=3, int[2]=4, int[3]=5 (Excel can read tdtInt as a client, but it would write tdtFloat if it were a server)05 00 02 00 02 00tdtBlank, cb=2, data=2 (two cells are blank)06 00 04 00 06 00 08 00tdtInt, cb=4, int[0]=6, int[1]=8 Biff5, Biff4, Biff3, and Biff Formats The Biff5, Biff4, Biff3, and Biff Clipboard formats contain a variable number of records. The records are identical to the corresponding records in the BIFF file. For more information about the BIFF5 records, see Microsoft Excel File Format. The Biff4, Biff3, and Biff formats are available for backward compatibility with existing applications. The Biff Clipboard format corresponds to the BIFF2 file format. If you implement one of the BIFF Clipboard formats, your code should be prepared to receive all BIFF records except file-specific records such as the following: WRITEPROT FILEPASS TEMPLATE WRITEACCESS FILESHARING ) ] z | p 128:Ge""#:#$$%%&&f''a(|()XEXIXXX޼޼ެު޼ަh8UhZ8aB*CJOJQJhph!h86B*CJOJQJhph!h8>*B*CJOJQJhphh8B*CJOJQJhph!h85B*CJOJQJhph)) | Ekd$$Ifl0 4 &4 lal((dxx$If](^($@ dxx]@ @ dxx]@ d ^Ekd$$Ifl0 4 &4 lal((dxx$If](^(Ekdd$$Ifl0 4 &4 lal  4^Ekd$$Ifl0 4 &4 lal((dxx$If](^(Ekd,$$Ifl0 4 &4 lal45=Q^EkdX$$Ifl0 4 &4 lal((dxx$If](^(Ekd$$Ifl0 4 &4 lalQRV~^Ekd $$Ifl0 4 &4 lal((dxx$If](^(Ekd$$Ifl0 4 &4 lal~z{^Ekd$$Ifl0 4 &4 lal((dxx$If](^(Ekd$$Ifl0 4 &4 lalbdD^Ekd$$Ifl0 4 &4 lal((dxx$If](^(EkdL$$Ifl0 4 &4 lalDEFGe Acyyyy ~= z9!@ d]@ @ dxx]@ $@ dxx]@ d]Ekd$$Ifl0 4 &4 lalcXkdx$$IflFX4J&    4 lal((dxx$If](^( @ dxx]@ 8Xkdl$$IflFX4J&    4 lal((dxx$If](^(Xkd$$IflFX4J&    4 lal Xkd$$IflFX4J&    4 lal((dxx$If](^((3?JT((dxx$If](^(Xkd`$$IflFX4J&    4 lal   8XkdT$$IflFX4J&    4 lal((dxx$If](^(Xkd$$IflFX4J&    4 lal ' |"Xkd$$IflFX4J&    4 lal((dxx$If](^(|"}"~"""""""#-#9#kk((dxx$If](^( @ dxx]@ $@ dxx]@ d]XkdH $$IflFX4J&    4 lal 9#:#R#t#u###^Ekd& $$Ifl04%4 lal((dxx$If](^(Ekd $$Ifl04%4 lal#######^Ekd $$Ifl04%4 lal((dxx$If](^(Ekd $$Ifl04%4 lal## $,$-$.$/$$^\SF @ dxx]@ d]Ekd $$Ifl04%4 lal((dxx$If](^(EkdR $$Ifl04%4 lal$$Z%%%%%%%%%&9&Ekd $$Ifl0 4 )4 lal((dxx$If](^( @ dxx]@ $@ dxx]@ 9&:&^&&&&&)'JEkd $$Ifl0 4 )4 lal(dxx$If](gdZ8a((dxx$If](^(Ekd~ $$Ifl0 4 )4 lal)'*'B'c'd'e'f''^\SE$@ dxx]@ d]Ekd $$Ifl0 4 )4 lal((dxx$If](^(EkdF $$Ifl0 4 )4 lal'&))))))) X XXXXXXXX @ dxx]@ CODEPAGE PUB SUB EDG INDEX The requisite BIFF records that your code must provide when it writes to the Clipboard are as follows: BOF DIMENSIONS Cell record or records (BLANK, BOOLERR, and so on (/ =!"#$% b$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alb$$Ifl!vh5 5&#v #v&:V l5 5&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alx$$Ifl!vh555J&#v#v#vJ&:V l555J&4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh55%#v#v%:V l55%4alb$$Ifl!vh5 5)#v #v):V l5 5)4alb$$Ifl!vh5 5)#v #v):V l5 5)4alb$$Ifl!vh5 5)#v #v):V l5 5)4alb$$Ifl!vh5 5)#v #v):V l5 5)4alb$$Ifl!vh5 5)#v #v):V l5 5)4al^ 666666666vvvvvvvvv666666>6666666666666666666666666666666666666666666666666hH6666666666666666666666666666666666666666666666666666666666666666662 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~_HmH nH sH tH 8`8 Normal_HmH sH tH DA D Default Paragraph FontVi@V 0 Table Normal :V 44 la (k ( 0No List PK![Content_Types].xmlj0Eжr(΢Iw},-j4 wP-t#bΙ{UTU^hd}㨫)*1P' ^W0)T9<l#$yi};~@(Hu* Dנz/0ǰ $ X3aZ,D0j~3߶b~i>3\`?/[G\!-Rk.sԻ..a濭?PK!֧6 _rels/.relsj0 }Q%v/C/}(h"O = C?hv=Ʌ%[xp{۵_Pѣ<1H0ORBdJE4b$q_6LR7`0̞O,En7Lib/SeеPK!kytheme/theme/themeManager.xml M @}w7c(EbˮCAǠҟ7՛K Y, e.|,H,lxɴIsQ}#Ր ֵ+!,^$j=GW)E+& 8PK!Ptheme/theme/theme1.xmlYOo6w toc'vuر-MniP@I}úama[إ4:lЯGRX^6؊>$ !)O^rC$y@/yH*񄴽)޵߻UDb`}"qۋJחX^)I`nEp)liV[]1M<OP6r=zgbIguSebORD۫qu gZo~ٺlAplxpT0+[}`jzAV2Fi@qv֬5\|ʜ̭NleXdsjcs7f W+Ն7`g ȘJj|h(KD- dXiJ؇(x$( :;˹! I_TS 1?E??ZBΪmU/?~xY'y5g&΋/ɋ>GMGeD3Vq%'#q$8K)fw9:ĵ x}rxwr:\TZaG*y8IjbRc|XŻǿI u3KGnD1NIBs RuK>V.EL+M2#'fi ~V vl{u8zH *:(W☕ ~JTe\O*tHGHY}KNP*ݾ˦TѼ9/#A7qZ$*c?qUnwN%Oi4 =3ڗP 1Pm \\9Mؓ2aD];Yt\[x]}Wr|]g- eW )6-rCSj id DЇAΜIqbJ#x꺃 6k#ASh&ʌt(Q%p%m&]caSl=X\P1Mh9MVdDAaVB[݈fJíP|8 քAV^f Hn- "d>znNJ ة>b&2vKyϼD:,AGm\nziÙ.uχYC6OMf3or$5NHT[XF64T,ќM0E)`#5XY`פ;%1U٥m;R>QD DcpU'&LE/pm%]8firS4d 7y\`JnίI R3U~7+׸#m qBiDi*L69mY&iHE=(K&N!V.KeLDĕ{D vEꦚdeNƟe(MN9ߜR6&3(a/DUz<{ˊYȳV)9Z[4^n5!J?Q3eBoCM m<.vpIYfZY_p[=al-Y}Nc͙ŋ4vfavl'SA8|*u{-ߟ0%M07%<ҍPK! ѐ'theme/theme/_rels/themeManager.xml.relsM 0wooӺ&݈Э5 6?$Q ,.aic21h:qm@RN;d`o7gK(M&$R(.1r'JЊT8V"AȻHu}|$b{P8g/]QAsم(#L[PK-![Content_Types].xmlPK-!֧6 +_rels/.relsPK-!kytheme/theme/themeManager.xmlPK-!Ptheme/theme/theme1.xmlPK-! ѐ' theme/theme/_rels/themeManager.xml.relsPK] @! ZX 4Q~Dc |"9###$9&)''X !"#$%&'()*+8@0(  B S  ?!biRU) 0 R U V ]  $ =DFH8@-5W`ow#{ iq dfHOls $'1:VYcl &5<MUNU &,MU~B! ~_g7?B!3333| 5=RV{ 4 D K+{iyHWal~B!8Z8a9)s@!B!@ 44 } @!`@``(@`@UnknownG* Times New Roman5Symbol3. * ArialWTms RmnTimes New RomanA BCambria Math"qhku J<J<A200!0!2KP $P9)s2!xx(Dynamic Data Exchange and XlTable FormatGanesh SivaramanVitaly BezrodnykhOh+'0 $0 P \ ht|,Dynamic Data Exchange and XlTable FormatGanesh SivaramanNormalVitaly Bezrodnykh3Microsoft Office Word@d@Һ#@[J՜.+,0( hp  Micron Electronics, Inc.<0! )Dynamic Data Exchange and XlTable Format Title  !"#$%&'()*+,-/012345789:;<=>?@ABCDEGHIJKLMOPQRSTUXRoot Entry F2ZData .1Table6/WordDocument*ZSummaryInformation(FDocumentSummaryInformation8NCompObjy  F'Microsoft Office Word 97-2003 Document MSWordDocWord.Document.89q