.

Протоколы и стандарты объектно-ориентированного программирования

Язык: русский
Формат: реферат
Тип документа: Word Doc
0 1402
Скачать документ

OLE

DDE

Clipboard

?AOA?AO

ii aeenoeeieeia “Oai?ey i?iaeoe?iaaiey o?aineyoi?ia”

ia oaio I?ioieieu e noaiaea?ou iauaeoii-i?eaioe?iaaiiiai
i?ia?aiie?iaaiey

Auiieiai nooaeaioii a?oiiu AI-1-91 Ianetheiaui A.I.

NIAeA?AEAIEA

I?aaeeneiaea

MS Windows e iiaue iaoiae ?ac?aaioee i?ia?aii

Aeeiaie/aneee iaiai aeaiiuie

OLE-oaoiieiaey

Caeeth/aiea

Nienie eeoa?aoo?u

I?eeiaeaiea 1.I?eia? eniieueciaaiey OLE-oaoiieiaee

I?aaeeneiaea

Iaeaieaa ?ani?ino?aiaiiui ycueii i?ia?aiie?iaaiey iineaaeia-

ai aeanyoeeaoey aaconeiaii yaeyaony N. Yoiio niinianoaiaaee oaeea

aai iniaaiiinoe, eae eaeiie/iinoue, iiuiinoue, aeaeinoue, ii-

aeeueiinoue. Aianoa n oai, no?aieoaeueiia oneiaeiaiea i?eeiaeaiee, aeey

?aaeecaoeee eioi?uo i?eiaiythony o?aaeeoeeiiiua i?ioeaaeo?ii-i?eaioe?i-

aaiiiua ycuee i?ia?aiie?iaaiey e, a /anoiinoe N, canoaaeytho aiai-

?eoue ia ii?aaeaeaiiii e?ecena a eo eniieueciaaiee, naycaiiii i?aae-

aea anaai n iaaeinoaoi/iie iaaeaaeiinoueth e au?aceoaeueiie
niiniaiinoueth.

Iiaeiaiuo iaaeinoaoeia ai iiiaii eeoaiu ycuee iauaeoii-i?eai-

oe?iaaiiai i?ia?aiie?iaaiey (III), a niiiaa eioi?uoeaaeeo eaeay ii-

aeaee?iaaiey iauaeoia iin?aaenoaii ea?a?oe/anee naycaiiuo eeannia.

Ioaeaeueii acyoue eeann ?anniao?eaaaony eae niaaeoiiinoue iiiaeanoaa

aeaiiuo e iia?aoeee iaae ieie, i?e/ai aeinooi e yeaiaioai aeaiiuo

eeanna aiciiaeai oieueei iin?aaenoaii iia?aoeee yoiai eeanna. Onoa-

iiaeaiea /aoeie acaeiicaaeneiinoe iaaeaeo aeaiiuie e iia?aoeeyie aa-

aeao e aieueoie oeaeinoiinoe aeaiiuo e cia/eoaeueii iiauoaao iaaeaae-

iinoue i?ia?aii ii n?aaiaieth n o?aaeeoeeiiiuie ycueaie i?ia?aiie?i-

aaiey. E?iia oiai, eaeay i?ia?aiie?iaaiey n iiiiuueth eeannia ai

iiiaii eniieuecoao oio aea iiaeoiae, eioi?ue iicaieyao ethaeyi oi?ie?i-

aaoue iiaeaee iauaeoia ?aaeueiiai ie?a.

Aia?aua eaeae III auee ?aaeeciaaiu a na?aaeeia 60-o aiaeia a

ycuea i?ia?aiie?iaaiey Neioea-67. Iineaaeiee, iaeiaei, ia iaoae a

oi a?aiy oe?ieiai ?ani?ino?aiaiey eae a neeo naiae ioiineoaeueii

iaiueoae i?iecaiaeeoaeueiinoe ii n?aaiaieth n o?aaeeoeeiiiuie ycueaie

oeia FORTRAN, ALGOL, PL/1 oae e, aiciiaeii, iaaaeaeaaoiinoe i?aaeea-

aaaiuo n?aaenoa ?aoaaiui a oi a?aiy caaea/e. Aua iaeiei aaaeiui ia?a-

ie/aieai aeey ?ani?ino?aiaey Neioeu-67 noaee o?oaeiinoe, n eioi?u-

ie i?eoeinue noieeiooueny aieueoeinoao i?ia?aiienoia i?e aai eco/a-

iee. Aeaei a oii, /oi ia?yaeo n oeaeui ?yaeii aaconeiaiuo aeinoieinoa,

eaeae III iaeaaeatho e iaeiei nouanoaaiiui iaaeinoaoeii – iie aeaeaei

ia i?inou aeey iiieiaiey e iniaaiii aeey inaiaiey n oeaeueth i?aeoe-

/aneiai eniieueciaaiey.

N++ – ?acaeoea N.

N++ – yoi iauaeoii-i?eaioe?iaaiuue ycue, oi anoue ycue, iic-

aieythuee i?ia?aiienoo iia?e?iaaoue iauaeoaie iaeioi?uo oeiia,

i?aaeaa?eoaeueii ei ii?aaeaeaiiui. Iacaaiea ycuea “N++” io?aaeaao

yaiethoeeiiiue oa?aeoa? eciaiaiey ycuea N (caienue “++”, a ycuea N,

icia/aao, /oi e eaeie-oi ia?aiaiiie i?eaaaeyaony aaeeieoea). Ii

eiaao aua aieaa iiuiua e aeaeea n?aaenoaa aeey iaienaiey yooaeoea-

iuo i?ia?aii, /ai N, io eioi?iai ii i?iecioae. *aeiaae, i?ia?ai-

ie?othuee ia o?aaeeoeeiiiuo ycueao, iiaeao i?inoi iioa?youe aieiao io

oao aiciiaeiinoae, eioi?ua i?aaeinoaaeyao N++.

Ii ia iaiaa aaaeiui yaeyaony oi, /oi oaeie ?ani?ino?aiaiiue e

oieaa?naeueiue ycue, eae N, nio?aiai a ea/anoaa iniiau. N i?ino,

yooaeoeaai, ia?aiinei. *aai oieueei iao a ycuea N: no?ieiauo aeai-

iuoiao, iao?eoe iao, n?aaenoa ia?aeeaeueiiai i?ia?aiie?iaaiey oiaea

iao. Iao aeaaea aaiaea-auaiaea.

Oeiu, iia?aoeee e iia?aoi?u N i/aiue aeecee e oiio, n /ai iu

eiaai aeaei a Annaiaea?a,- /enea, aae?ana, a?eoiaoe/aneea e eiae-

/aneea aeaenoaey, oeeeeu… E?iia oiai, iiiaea iniaaiiinoe N iaae-

aoniuneaiii iaiaeath eiiieeyoi?o, eae nie?aoeoue eiae e a?aiy eniie-

iaiey i?ia?aiiu. Yoe oa?aeoa?iua /a?ou ycuea N iicaieytho iaie-

naoue yooaeoeaii ?aaioathuee e ia neeoeii neiaeiue eiiieeyoi?. E oi-

oy a iaoeiiuo eiaeao ia ?aciuo eiiiuethoa?ao yeaiaioa?iua iia?aoeee

iaicia/athon ii-?aciiio, a?yae ee ?ac?aaio/eeo eiiieeyoi?a i?eaeao a

aieiao eioa?i?aoe?iaaoue i?inoaeoea au?aaeaiey eaeei-ieaoaeue i?eae-

iaeueiui niiniaii. Eiaiii iiyoiio ycue N “eaeao aacaea e ia anai”,

i?ia?aiiu, iaienaiiua ia iai, ?aaioatho yooaeoeaii, e eo iiaeii ia-

?aiineoue n iaeiiai eiiiuethoa?a ia ae?oaie.

Aieueoeinoai ycueia i?ia?aiie?iaaiey nicaeaiu aeey ?aoaiey ii-

?aaeaeaiiiai e?oaa caaea/. A ieo ia oieueei ia oaaoaao ii?aaeaeaiiuo

oeiia aeaiiuo e ooieoeee, ii e iiiai eeoiaai n oi/ee c?aiey /aeiaa-

ea, aeaeaeiai io iaeanoe, ia eioi?oth i?eaioe?iaai ycue. Niaoeeaee-

ce?iaaiiua oeiu aeaiiuo eee iia?aoi?u, o?aaothuea iao?eaeaeueiie

iiaeaea?aeee, cao?oaeiytho eco/aiea ycuea e iaoatho aaoae ?aaioa, anee

au eie ia niae?aaoanue iieueciaaoueny. Iiyoiio N, a eioi?ii iao ie-

/aai eeoiaai, iiioey?ai n?aaee oe?ieiai e?oaa i?ia?aiienoia. Niio-

aaonoaothuea aeaeeioaee iiaoo aeiaaaeoue e n?aaenoaai ycuea niaoeeaee-

ce?iaaiiua ooieoeee aeey ?aaiou ni no?ieaie, oaeeaie, nieneaie, on-

o?ienoaaie aaiaea-auaiaea, iaoaiaoe/aneeie iauaeoaie e o.ae. Inoaao-

ny oieueei aua?aoue oi, /oi ioaeii ee/ii aai. Caaieiai/iua oaeeu ia-

eaa/atho eniieueciaaiea aeaeeioae, i?aaeinoaaeytho iieaciua oeiu aeai-

iuo, aeiaaeueiua ia?aiaiiua, iae?iii?aaeaeaiey… Iie ai iiiaii on-

o?aiytho i?ioeai?a/ea iaaeaeo yooaeoeaiinoueth i?ia?aiiu e oaeianoaii

eniieueciaaiey aeaeeioa/iuo ooieoeee. Iie oaeaea iicaieytho ia iiaoi-

?yony e ia ienaoue ii ianeieueeo ?ac iaeii e oiaea a ?acee/iuo i?ia-

?aiiao. Iineieueeo N aue nicaeai niaoeeaeueii aeey nenoaiiiai i?ia?ai-

ie?iaaiey, ii eiaao aiciiaeiinoe ieceiai o?iaiy, iicaieythuea “ea-

?aoue aac i?aaee”. A caaeneiinoe io ono?ienoaa e iia?aoeeiiiie nen-

oaiu aaoae iaoeiu au iiaeaoa “aeacoue” a aeaeaiiaiyoue eee eniieueci-

aaoue nenoaiiua i?ia?aiiu, iaoiaeyueany a iia?aoeaiie iaiyoe.

A ethaii neo/aa au iiaeaoa ?anniao?eaaoue eiae nianoaaiiie i?ia-

?aiiu eae aeaiiua, a iannea aeaiiuo eae eiae ooieoeee, eaaae?aoioth

iao?eoeo eae aaeoi?, a oaeno eae aeia?iia aea?aai. *oi au ie iaoi-

aeeeinue a iaiyoe – yoi anaai eeoue iineaaeiaaoaeueiay oeaii/ea /enae.

Anee au ia aieoanue ?enea – iiaeaoa aeaeaoue ana, /oi aai acaeoiaaony.

Nia?aiaiiua i?a?aiienou auae?atho N ia oieueei ec-ca aai i?ae-

iouanoa. A ianoiyuaa a?aiy iu eiaai aeaei n oeaiiie ?aaeoeeae: /ai

aieueoa iaienaii ia N, oai aieueoa ia iai iaieooo aua. Yoi iaeia ec

i?e/ei, ii/aio ycue N++ nio?aiyao N a ea/anoaa iiaeiiiaeanoaa.

Ii iiaieth aaoi?a N++, Auea?ia No?aono?oia, ?acee/ea iaaeaeo

eaeaieiaeae N e N++ caeeth/aaony i?eia?ii a neaaeothuai: i?ia?aii ia

N io?aaeaao “niinia iuoeaiey” i?ioeanni?a, a N++ – niinia iuoeaiey

i?ia?aiienoa. Ioaa/ay o?aaiaaieyi nia?aiaiiiai i?ia?aiie?iaaiey,

N++ aeaeaao aeoeaio ia ?ac?aaioea iiauo oeiia aeaiiuo, iaeaieaa iie-

ii niioaaonoaothueo eiioeaioeeyi aua?aiiie iaeanoe ciaiee e caaea/ai

i?eeiaeaiey. Ia N ieooo aeaeeioaee ooieoeee, N++ iicaieyao nicaea-

aaoue aeaeeioaee eeannia. Eeann yaeyaony eeth/aaui iiiyoeai N++.

Iienaiea eeanna niaea?aeeo iienaiea aeaiiuo, o?aaothueony aeey i?aae-

noaaeaiey iauaeoia yoiai oeia, e iaai? iia?aoeee aeey ?aaiou n ii-

aeiaiuie iauaeoaie.

A ioee/ea io o?aaeeoeeiiiuo no?oeoo? N eee Ianeaey, /eaiaie

eeanna yaeythony ia oieueei aeaiiua, ii e ooieoeee. Ooieoeee-/eaiu

eeanna eiatho i?eaeeaae?iaaiiue aeinooi e aeaiiui aioo?e iauaeoia

yoiai eeanna e iaania/eaatho eioa?oaen iaaeaeo yoeie iauaeoaie e in-

oaeueiie i?ia?aiiie. I?e aeaeueiaeoae ?aaioa niaa?oaiii ia iayca-

oaeueii iiiieoue i aioo?aiiae no?oeoo?a eeanna e iaoaaecia ?aaiou

“ano?iaiiuo ooieoeee”. A yoii niunea eeann iiaeiaai yeaeo?e/aneiio

i?eai?o – iaei eoi ciaao i aai ono?ienoaa, ii ana ciatho, eae ei

iieueciaaoueny.

*anoi a oeaeyo iiauoaiey yooaeoeaiinoe e oi?iuaiey no?oeoo?u

i?ia?aiiu i?eoiaeeony canoaaeyoue aa ?aaioaoue n ?acii?iaeiuie iauae-

oaie oae, eae anee au iie eiaee iaeei e oioaea oei. Iai?eia?, ie-

?oaeiinoue e eaaae?ao anoanoaaiii ?anniao?eaaoue eae aa?eaiou aaiiao-

?e/aneie oeao?u. Iieacii ninoaaeyoue nienee oeao?, ia?eniaaiiuo ia

ye?aia, eee ooieoeee, eioi?ua eo ?aciiiaeatho, aeaeaatho e o.ae. I oi/-

iii oeia iauaeoa i?eoiaeeony ii?ie caauaaoue. Nienie aaiiao?e/an-

eeo oeao? “ia ciaao”, /oi a iai iaoiaeeony – io?acee eee caacaei/-

ee. Ia ciaao yoiai e eiiieeyoi?. Ii ana a?aiy, iiea au ?enoaoa

yoe iauaeou, iaecaaaeii i?eoiaeeony “iiiieoue”, /oi iie ec naay

i?aaenoaaeytho. Eiia/ii, aiciiaeiinoe ieceiai o?iaiy iicaieytho “ca-

auaaoue” e “aniiieiaoue” eiaaea e eae iai caaeaai?annoaeeony, ii i?e

yoii eiiieeyoi? oa?yao eiio?ieue iaae iniuneaiiinoueth aeaenoaee.

Eniieueciaaiea i?iecaiaeiuo eeannia e ae?ooaeueiuo ooieoeee iic-

aieyao ecaaaeaoue ?eneiaaiiie oaoieee e ia caaioeony i oii, a ea-

eie oi?ia iauaeo oeia “aaiiao?e/aneay oeao?a” o?aieo eioi?iaoeeth i

oii, e?oa ii eee eaaae?ao. (E?iia aiciiaeiinoae III, nicaeaiea oe-

iia aeaiiuo “o?aoaieueiee” eee “eaaae?ao” eae i?iecaiaeiua io aaciai-

ai eeanna “aaiiao?e/aneay oeao?a” io?aaeaao eiae/aneoth naycue iiiy-

oee). Ae?ooaeueiua ooieoeee, ii nouanoao, ii?aaeaeytho, /oi eiaiii

iiaeii aeaeaoue n iauaeoii, a ia oi, eae yoi aeaeaoue. Nicaeaaay eeann

“aaiiao?e/aneay oeao?a”, iu iiaeai aeeth/eoue a iaai ae?ooaeueiua

ooieoeee ?eniaaiey, oaaee/aiey, iiai?ioa. N eniieueciaaieai yoeo

ooieoeee iiaeii nicaeaoue aua iaeei /eai eeanna.

Caoai iiaeii ?ac?aaioaoue aeaeeioaeo i?ia?aii eioa?aeoeaiie

a?aoeee, niaaaeea aa n?aaenoaaie aeeaeiai, ooieoeeyie a?iaea aeiiieia-

iey iaeioi?ie iaeanoe ye?aia iaeeiaeiauie aaiiao?e/aneeie oeao?a-

ie e o.ae. Aeaeeioa/iua ooieoeee aoaeoo aucuaaoue ooieoeee-/eaiu eean-

na “aaiiao?e/aneay oeao?a”: ?eniaaiey, aeaeaeaiey, iiai?ioa,oaaee-

/aiey. A iinea oiai, eae iu ana yoi iaieoai, ioeiiieee?oai, ni?y-

/ai oaeno ooieoeee, eioi?ua n/eoaai naiae eioaeeaeooaeueiie nia-

noaaiiinoueth, ia/eiaaony naiia eioa?aniia. Oaia?ue iu iiaeai iie-

naoue neieueei oaiaeii iiauo oeiia oeao? – iiiaioaieueieeia, caacaei-

/ae, yeeeinia – i?iecaiaeiuo io eeanna “aaiiao?e/aneay oeao?a” e

iauynieoue, eae eo ?eniaaoue, oaaee/eaaoue e iiai?a/eaaoue. Eae aeae-

aaoue – iauyniyoue ia iaaei. Yoi oaea anoue a aaciaii eeanna. Ooieoeee

iaoae aeaeeioaee iiaoo ?aaioaoue niauaeoaie aiiaue nicaeaiiuo oeiia,

aeey ieo yoi aa?eaiou aaiiao?e/anie oeao?u. Neaaeoao ioiaoeoue, /oi

a i?iecaiaeiuo eeannao iiaoo (e, eae i?aaeei, aeieaeiu) iiyaeyony

aeaiiua e ooieoeee, eioi?uo iao a aaciaii eeanna. Iaeiaei ie iaeia ec

ooieoeee, ia?aaaouaathueo “aaiiao?e/aneea oeao?u”, ieeiaaea ia oc-

iaao i niaoeeoe/aneeo naienoaao iiiaioaieueieea eee yeeeina, e?iia

oiai, /oi iie ii-naiaio ?enothony, oaaee/eaathony e iiai?a/eaathony.

I?iecaiaeiue eeann nai iiaeao auoue aaciaui aeey ae?oaeo eeannia, a

iicaeiea aa?nee N++ iicaieytho naeaeaoue iaeei eeann i?iecaiaeiui io

ianeieueeeo ae?oaeo.

I?e iaienaiee i?ia?aiiu /anoi aeiioneathony aeinaaeiua iieioiin-

oe, iaia?oaeeaathueany oieueei ia noaaeee auiieiaiey e, oau, neeoeii

iicaeii. Iai?eia?, anee ia?aiaiiay ii niuneo – ciaiaiaoaeue ae?iae,

oioaeinue au iieo/eoue niiauaiea ia ioethea oiaaea, eiaaea ae i?enaae-

aaaony iieue, a ia oiaaea, eiaaea ia yoio iieue /oi-ieaoaeue aeaeeony.

Eee, neaaeai, ooieoeey ?eniaaiey oi/ee. Iaaiciiaeii oaea?aeaoueny io

niaeacia aucaaoue aa oioy au ?ac aac i?iaa?ee auoiaea ca a?aieoeu

ye?aia. A oi aea a?aiy , anee iu ieoai i?ia?aiio ?eniaaiey eeiee,

iaycaoaeueii ioaeia ooieoeey, eioi?ay ooii noaaeo oi/eo – e eae iiae-

ii auno?aa. Nouanoaoao iiiai neooaoeee, eiaaea ooieoeee e aeaiiua

neaaeoao ?ac?aoeoue eniieueciaaoue oieueei i?eaeeaae?iaaiiui ooieoeeyi,

iaae eioi?uie aa “oi?ioi iiaeoiaee”. A N++ yoiai iiaeii aeiaeoueny,

naeaeaa “iianiua” aeaiiua e ooieoeee caueuaiiuie /eaiaie eaeiai-ie-

aoaeue eeanna. E iei eiatho aeinooi oieueei ooieoeee-/eaiu yoiai aea

eeanna, a oae aea ae?ocuey eeanna. Iai?ioea, anee aeaiiua eee ooi-

eoeee-/eaiu iauyaeaiu public, iie yaeythony iauaaeinooiiuie.

N++ i?aaeinoaaeyao a ?anii?yaeaiea i?ia?aiienoa neiaeiua oeiu

aeaiiuo. Iaeiaei ie aiia?ao eeannia, ie ia?aa?ocea iia?aoeee ia

aeeytho ia yooaeoeaiinoue. Oi, /oi eeann – yoi eeann, ecaanoii

oieueei eiiieeyoi?o. Anee ooieoeee-/eaiu eeannia iauyaeaiu inline,

ia eo aucia ia o?aaoaony a?aiy. Oaeoe/anee yoi ia ooieoeee, a iiae-

noaiiaee. Eeoue ae?ooaeueiua ooieoeee inoaaeytho ioiineoaeueii ia-

aieueoie neaae a iia?aoeaiie iaiyoe.

Ec anaai auoa neacaiiiai auoaeaao eiae/iue auaiae: N++ iaeai-

eaa oaeiaiue, oieaa?naeueiue e iaiaoiaeeiue ycue. Ii ana aea aicie-

eaao aii?in, /oi aea auei iaienaii ia yoii ycuea, eniieuecoy i?ei-

oeeiu III, /oi iiaeii auei au “iio?iaaoue” ethaiio i?ia?aiienoo eee

iieueciaaoaeth. Ioaao i/aaeaeai – yoi Microsoft Windows.

MS Windows e iiaue iaoiae ?ac?aaioee i?ia?aii.

Iaeiei ec iaeaieaa aaaeiuo iaoaieciia acaeiiaeaenoaey i?ia?aii

yaeyaony iaiai aeaiiuie. A MS Windows nouanoaoao ianeieueei niiniaia

acaeiiaeaenoaey i?eeiaeaiee:

– ii/oiaue yuee;

– aeeiaie/aneee iaiai aeaiiuie;

– ano?aeaaiea iauaeoia.

Niaoeeaeueiue ii/oiaue yuee (clipboard) Windows iicaieyao

iieueciaaoaeth ia?aiineoue eioi?iaoeeth ec iaeiiai i?eeiaeaiey a
ae?oaia,

ia caaioynue ia aa oi?iaoao e i?aaenoaaeaiee.

A ioee/ea io i?ioanneiiaeueiuo iia?aoeeiiaeueiuo iia?aoeeiiiuo

nenoai, aaea iaoaieci iaiaia aeaiiuie iaaeaeo i?ia?aiiaie aeinooiai

oieueei i?ia?aiienoo, a Windows yoi aeaeaaony i/aiue i?inoi e iaa-

eyaeii aeey iieueciaaoaey.

Iaoaieci iaiaia aeaiiuo iaaeaeo i?eeiaeaieyie – aeeciaiii aaaeiia

naienoai iiiaicaaea/iie n?aaeu. E a ianoiyuaa a?aiy i?iecaiaeeoaee

i?ia?aiiiiai iaania/aiey i?eoee oaea e auaiaeo, /oi aeey ia?aiina

aeaiiuo ec iaeiiai i?eeiaeaiey a ae?oaia ii/oiaiai yueea oaea iaaeinoa-

oi/ii. Iiyaeeny iiaue, aieaa oieaa?naeueiue iaoaieci – OLE (

Object Linking and Embedding )

– Ano?iaiiay iauaeoiay naycue, eioi?ue iicaieyao ia-

?aiineoue ec iaeiiai i?eeiaeaiey a ae?oaia ?acii?iaeiua aeaiiua. Iai?e-

ia?, n iiiiuueth yoiai iaoaiecia aeaiiua, iiaeaioiaeaiiua a nenoaia

naoaaiai ieaie?iaaiey Time Line for Windows ( Symantec ), iiaeii

ia?aiineoue a oaenoiaue i?ioeanni? Just Write ( Symantec ), a ca-

oai, neaaeai, a aaia?aoi? i?eeiaeaiee Object Vision (Borland).

I?aaaea, yoi oaea ianoaiaea?oiia n?aaenoai Microsoft Windows, ii oai

ia iaiaa ?aaeecaoeey OLE noaea aiciiaeiie eiaiii a Windows.

E?iia iaoaiecia ii/oiaiai yueea, i?aaeiacia/aiiiai, a iniia-

iii, aeey iieueciaaoaey, i?ia?aiienoo a Windows aeinooiiu nia-

oeeaeueiua n?aaenoaa iaiaia aeaiiuie iaaeaeo i?eeiaeaieyie.

I?ia?aiiiui iooai iiaeii onoaiiaeoue i?yioth naycue iaaeaeo caaea-

/aie, iai?eia?, i?eieiay aeaiiua ec iineaaeiaaoaeueiiai ii?oa, aaoi-

iaoe/anee iiiauaoue eo, neaaeai, a y/aeee yeaeo?iiiie oaaeeoeu

Excel, n?aaenoaaie eioi?ie iiaeii ooo aea ioia?aaeaoue neiaeiua caaene-

iinoe a aeaea a?aoeeia eee inouanoaeyoue eo ia?aaioeo a ?aaeueiii

?aaeeia a?aiaie (yoio iaoaieci iineo iacaaiea aeeiaie/aneiai iaia-

ia aeaiiuie – Dynamic Data Exchange, DDE ).

Iniiaiua oa?ieiu

Eeeaioneia i?eeiaeaiea DDE – i?eeiaeaiea, eioi?iio iaiaoiaee-

ii onoaiiaeoue aeeaeia n na?aa?ii e iieo/eoue aeaiiua io na?aa?a a

i?ioeanna aeeaeiaa.

DDE-aeeaeia – acaeiinaycue iaaeaeo eeeaioneei e na?aa?iui i?e-

eiaeaieyie.

Na?aa?-i?eeiaeaiea – DDE i?eeiaeaiea, eioi?ia ia?aaeaao aeai-

iua eeeaioo a i?ioeanna aeeaeiaa.

DDE-O?aicaeoeey -iaiai niiauaieyie eee aeaiiuie iaaeaeo eeeai-

oii e na?aa?ii.

Item eiy – no?iea, eaeaioeoeoee?othuay iaeioi?ia iiiaeanoai

aeaiiuo, eioi?ia na?aa? a ninoiyiee ia?aaeaoue eeeaioo a i?ioeanna

aeeaeiaa.

Service eiy – no?iea, aaia?e?oaiay na?aa?ii e eniieuecoa-

iay eeeaioii aeey onoaiiaeaiey aeeaeiaa.

No?ieiaue oeacaoaeue – aeaieiia neiai, aaia?e?oaiia iia?a-

oeeiiiie nenoaiie, eaeaioeoeoee?othuaa no?ieo, ia?aaeathuothny a
i?ioean-

na aeeiaie/aneiai iaiaia aeaiiuie.

Topic eiy – no?iea, eioi?ay eaeaioeoeoee?oao oei aeaiiuo,

iaiaoiaeeiuo eeeaioneiio i?eeiaeaieth i?e aeeiaie/aneii iaiaia aeaiiuo.

Oeeueo? o?aicaeoeee – oeaa, eioi?ue i?aiyonoaoao ia?aaea/a

iaaeaeaoaeueiuo oeiia o?aicaeoeee a ooieoeeth ia?aoiiai auciaa.

A Microsoft Windows aeeiaie/aneee iaiai aeaiiuo yaeyaony oi?-

iie nayce, eioi?ay eniieuecoao iauea iaeanoe iaiyoe aeey iaiaia

aeaiiuie iaaeaeo i?eeiaeaieyie. I?eeiaeaiea iiaeao eniieueciaaoue DDE
a

iaeioi?ue iiiaio a?aiaie aeey ia?aaea/e e iieo/aiey iiauo aeaiiuo io

na?aa?a.

Iaoaieci DDE noiae n iaoaieciii ii/oiaiai yueea, eioi?ue ya-

eyaony /anoueth iia?aoeeiiiie nenoaiu WINDOWS. Nouanoaoao eeoue iac-

ia/eoaeueiay ?acieoea a oii, /oi ii/oiaue yuee, a aieueoeinoaa neo-

/aa, eniieuecoaony eae aooa? a?aiaiiiai o?aiaiey eioi?iaoeee. DDE

iiaeao auoue eieoeeaeece?iaai iieueciaaoaeai e a aieueoeinoaa neo/aaa

i?iaeieaeaoue ?aaioaoue aac aai aiaoaoaeuenoaa.

Aeaeeioaea DDEML iaania/eaaao iieueciaaoaey iaai?ii n?aaenoa,

eioi?ua oi?iuatho eniieueciaaiea iaoaiecia DDE a WINDOWS i?eeiaea-

ieyo. Aianoi oiai, /oiau ia?aaaouaaoue, iieo/aoue e ia?aaeaaaoue DDE

niiauaiey iai?yioth, i?eeiaeaiey eniieuecotho ooieoeee DDEML aeaeeioa-

ee. Aeaeeioaea DDEML oaeaea iaania/eaaao ?aaioo ni no?ieaie e ?ac-

aeaeyaiuie aeaiiuie, aaia?e?oaiuie DDE i?eeiaeaieyie. Aianoi oiai,

/oiau eniieueciaaoue oeacaoaee ia iauea iaeanoe iaiyoe, DDE i?eei-

aeaiey nicaeatho e iaiaieaathony no?ieiauie oeacaoaeyie, eioi?ua

eaeaioeoeoee?otho no?iee e aeaiiua.

Oaea nouanoaothuea i?eeiaeaiey, eniieuecothuea i?ioieie DDE, in-

iiaaiiue ia niiauaieyo iieiinoueth niaianoeiu n oaie, eioi?ua en-

iieuecotho aeaeeioaeo DDEML. Aio ii/aio i?eeiaeaiea, eniieuecothuaa

DDE-i?ioieie iiaoo onoaiiaeoue aeeaeia e auiieiyoue o?aicaeoeee n

i?eeiaeaieyie, eniieuecothueie aeaeeioaeo DDEML.

Acaeiinaycue iaaeaeo eeeaioii e na?aa?ii.

DDE aicieeaao anaaaea iaaeaeo eeeaioneei i?eeiaeaieai e na?aa?-

iui. Eeeaioneia i?eeiaeaiea eieoeeaeece?oao iaiai aeaiiuie iooai on-

oaiiaeaiey aeeaeiaa n na?aa?ii e ia?aaea/e o?aicaeoeee. O?aicaeoeey

iaiaoiaeeia aeey aeaiiuo e ianeoaeeaaiey. Na?aa? ioaa/aao ia o?aicae-

oeeth e iaania/eaaao eeeaioa aeaiiuie. Na?aa? iiaeao eiaoue n?aco ian-

eieueei eeeaioia a iaeii e oiaea a?aiy, a naith i/a?aaeue, eeeaio ii-

aeao iieo/aoue aeaiiua n?aco io ianeieueeeo na?aa?ia. Iaeioi?ia i?e-

eiaeaiea iaeiia?aiaiii iiaeao auoue e eeeaioii e na?aa?ii. A aeiaaaie

e auoaneacaiiiio, eeeaio e na?aa? iiaoo iai?aaoue aeeaeia a ethaia

oaeiaiia aeey ieo a?aiy.

DDE na?aa? eniieuecoao o?e ca?aca?ae?iaaiiuo oeia eiai, ?an-

iieiaeaiiuo ea?a?oe/ii: service, topic item – oieeaeueii eaeaioeoe-

oee?otho iaeioi?ia iiiaeanoai aeaiiuo, eioi?ia na?aa? iiaeao ia?aaeaoue

eeeaioo a i?ioeanna aeeaeiaa.

Service eiy – yoi no?iea, eioi?oth aaia?e?oao na?aa? a oa

i?iiaaeooee a?aiaie, a eioi?ua eeeaio iiaeao onoaiiaeoue aeeaeia n

na?aa?ii.

Topic eiy – yoi no?iea, eioi?ay eaeaioeoeoee?oao eiae/an-

eee eiioaeno aeaiiuo. Aeey na?aa?a, eioi?ue iaieioee?oao oaeeaie,

topic eiaia yoi i?inoi iacaaiey oaeeia; aeey ae?oaeo na?aa?ia – yoi

niaoeeoe/aneea eiaia eiie?aoiiai i?eeiaeaiey. Eeeaio iaycaoaeueii

aeieaeai oeacuaaoue topic eiy aianoa n service eiaiai, eiaaea ii oi-

/ao onoaiiaeoue aeeaeia n na?aa?ii.

Item eiy – yoi no?iea, eioi?ay eaeaioeoeoee?oao iaeioi-

?ia iiiaeanoai aeaiiuo, eioi?ia na?aa? iiaeao ia?aaeaoue eeeaioo a

i?ioeanna o?aicaeoeee. Iai?eia?, item eiy iiaeao eaeaioeoeoee?iaaoue

OeAEIA ( int, integer ), NO?IEO ( string, char * ), ianeieueei ia-

?aa?aoia oaenoa, eee BITMAP ia?ac.

Ana auoaoeacaiiua eiaia iicaieytho eeeaioo onoaiiaeoue aeea-

eia n na?aa?ii e iieo/eoue io iaai aeaiiua.

Nenoaiiue ?aaeei

Nenoaiiue ?aaeei ?aaiou iaania/eaaao eeeaioa anae iaiaoiaee-

iie eioi?ioeeae i na?aa?a.

Aeey oiai, /oiau ii?aaeaeeoue, eaeea na?aa?u aeinooiiu a aeai-

iue iiiaio a?aiaie, a oaeaea eaeie eioi?iaoeeae iie iiaoo iaania-

/eoue eeeaioa, iineaaeiee, iaoiaeynue a ia/aeueiii ?aaeeia ?aaiou, aeie-

aeai onoaiiaeoue eiy ono?ienoaa, ?aaiia NULL. Oaeie oaaeii aeeaeiaa

iaeneiaeueii oaaee/eaaao yooaeoeaiinoue ?aaiou, a oaeaea ?aaioo n

na?aa?ii a nenoaiiii ?aaeeia. Na?aa?, a naith i/a?aaeue, aeieaeai iiae-

aea?aeeaaoue ieaeaiienaiiua item eiaia, a oaeaea ae?oaea, /anoi en-

iieuecoaiua eeeaioii:

SZDDESYS ITEM TOPICS – nienie item eiai, n eioi?uie iiaeao

?aaioaoue na?aa? a aeaiiue iiiaio a?aiaie. Yoio nienie iiaeao ecia-

iyoueny a?aiy io a?aiaie.

SZDDESYS ITEM SYSITEMS – nienie item eiai, n eioi?uie ii-

aeao ?aaioaoue na?aa? a nenoaiiii ?aaeeia.

SZDDDESYS ITEM STATUS – cai?ineoue oaeouee noaoon na?aa?a.

Iau/ii, aeaiiue cai?in iiaeaea?aeeaaaony oieueei a oi?iaoa CF_TEXT e

niaea?aeeo no?ieo oeia Aioia/Caiyo.

SZDDE ITEM ITEMLIST – nienie item eiai, iiaeaea?aeeaaaiuo na?-

aa?ii a ianenoaiiii ?aaeeia ?aaiou. Yoio nienie iiaeao iaiyoueny

a?aiy io a?aiaie.

SZDDESYS ITEM FORMATS – nienie no?ie, i?aaenoaaeythuee niaie

nienie anao oi?iaoia ii/oiaiai yueea, iiaeaea?aeeaaaiuo na?aa?ii a

aeaiiii aeeaeiaa. Iai?eia?, CF_TEXT oi?iao i?aaenoaaeai no?ieie TEXT.

Iniiaiia iacia/aiea e ?aaioa ooieoeee ia?aoiiai auciaa

I?eeiaeaiea, eioi?ia eniieuecoao DDEML, aeieaeii niaea?aeaoue ooi-

eoeeth ia?aoiiai auciaa, eioi?ay ia?aaaouaaao niauoey, iieo/aiiua

i?eeiaeaieai. DDEML oaaaeiieyao i?eeiaeaiea i oaeeo niauoeyo iooai

iinueee o?aicaeoeee a ooieoeeth ia?aoiiai auciaa aeaiiiai i?eeiaeaiey.

A caaeneiinoe io oeaaa oeeueo?a o?aicaeoeee, noi?ie?iaaiiiai

i?e auciaa ooieoeee DdeInitialize, ooieoeey ia?aoiiai auciaa iieo-

/aao ioni?oe?iaaiiua o?aicaeoeee aia caaeneiinoe io oiai, yaeyao-

ny ee aeaiiia i?eeiaeaiea eeeaioii, na?aa?ii eee oai e ae?oaei iae-

iia?aiaiii. Neaaeothuee i?eia? aeaiiino?e?oao iaeaieaa oeie/iia en-

iieueciaaiea ooieoeee ia?aoiiai auciaa.

HDDEDATA CALLBACK DdeCallback( uType, uFmt, hconv, hsz1,

hsz2, hdata, dwData1, dwData2 )

UINT uType; // Oei o?aicaeoeee

UINT uFmt; // Oi?iao ii/oiai yueea

HCONV hconv; // Eaeaioeoeeaoi? aeeaeiaa

HSZ hsz1; // Eaeaioeoeeaoi? no?iee #1

HSZ hsz2; // Eaeaioeoeeaoi? no?iee #2

HDDEDATA hdata; // Eaeaioeoeeaoi? aeiaaeueiiai iauae-

oa iaiyoe

DWORD dwData1; // Aeaiiua oaeouae o?aicaeoeee #1

DWORD dwData2; // Aeaiiua oaeouae o?aicaeoeee #2

{

switch (uType)

{

case XTYP_REGISTER:

case XTYP_UNREGISTER:

. . .

return (HDDEDATA) NULL;

case XTYP_ADVDATA:

. . .

return (HDDEDATA) DDE_FACK;

case XTYP_XACT_COMPLETE:

. . .

return (HDDEDATA) NULL;

case XTYP_DISCONNECT:

. . .

return (HDDEDATA) NULL;

default:

return (HDDEDATA) NULL;

}

}

Ia?aiao? uType eaeaioeoeoee?oao oei iineaiiie o?aicaeoeee a

ooieoeeth ia?aoiiai auciaa i?e iiiiue DDEML. Cia/aiey inoaaoeony

ia?aiao?ia caaenyo io oeiia o?aicaeoeee. Oeiu o?aicaeoeee aoaeoo ia-

noaeaeaiu iaie a ?acaeaea “Ia?aaioea O?aicaeoeee”.

Aeeaeia iaaeaeo i?eeiaeaieyie

Aeeaeia iaaeaeo eeeaioii e na?aa?ii anaaaea onoaiaaeeaaaony ii

o?aaiaaieth eeeaioa. Eiaaea aeeaeia onoaiiaeai, iaa ia?oia?a iieo-

/atho eaeaioeoeeaoi?, eioi?ue iienuaaao aeaiiue aeeaeia.

Ia?oia?u eniieuecotho yoio eaeaioeoeeaoi? a aieueoeinoaa ooi-

eoeee DDEML aeey iinueee o?aicaeoeee e aeey eo ia?aaioee. Eeeaioo ii-

aeao iio?aaiaaoueny aeeaeia eae n iaeiei na?aa?ii, oae e n ianeieueee-

ie.

?anniio?ei iiae?iaii eae i?eeiaeaiea onoaiaaeeaaao aeeaeia e

iieo/aao eioi?iaoeeth i oaea nouanoaothueo eaiaeao nayce.

I?inoie Aeeaeia

Eeeaioneia i?eeiaeaiea onoaiaaeeaaao i?inoie aeeaeia n na?aa-

?ii iooai auciaa ooieoeee DdeConnect e ii?aaeaeyao eaeaioeoeeaoi?u

no?ie, eioi?ua niaea?aeao anth iaiaoiaeeioth eioi?iaoeeth i service eia-

ie oaeouaai na?aa?a e eioa?anouai eeeaioa a aeaiiue iiiaio topic

eiaie.

DDEML ioaa/aao ia aucia yoie ooieoeee iinueeie niioaaonoaoth-

uae o?aicaeoeee XTYP_CONNECT a ooieoeeth ia?aoiiai auciaa eaaeaeiai

aeinooiiiai a aeaiiue iiiaio a?aiaie na?aa?a, ca?aaeno?e?iaaiiia

eiy eioi?iai niaiaaeaao n eiaiai, ia?aaeaiiui i?e iiiiue ooieoeee

DdeConnect i?e oneiaee, /oi na?aa? ia ioeeth/ae oeeueo? service

eiaie auciaii ooieoeee DdeServiceName.

Na?aa? iiaeao oaeaea onoaiiaeoue oeeueo? ia XTYP_CONNECT o?ai-

caeoeeth caaeaieai niioaaonoaothuaai oeaaa CBF_FAIL_CONNECTIONS i?e

auciaa ooieoeee DdeInitialize.

A i?ioeanna ia?aaioee o?aicaeoeee oeia XTYP_CONNECT DDEML ia-

?aaeaao iieo/aiiua io eeeaioa service e topic eiaia na?aa?o. Na?-

aa? aeieaeai i?iaa?eoue yoe eiaia e aica?aoeoue TRUE, anee ii a nin-

oiyiee ?aaioaoue n oaeeie eiaiaie, e FALSE a i?ioeaiii neo/aa.

Anee ie iaeei ec nouanoaothueo na?aa?ia ia ioaa/aao ia CONNECT-cai-

?in eeeaioa, ooieoeey DDeConnect aica?auaao aio NULL n eioi?ia-

oeeae i oii, /oi a aeaiiue iiiaio a?aiaie IA aiciiaeii onoaiiaeoue

aeeaeia.

Iaeiaei, anee na?aa? aica?aoee TRUE, oi aeeaeia aue oniaoii

onoaiiaeai e eeeaio iieo/aao eaeaioeoeeaoi? aeeaeiaa

– aeaieiia neiai, iin?aaenoaii eioi?iai e aaaeaony

iaiai aeaiiuie n na?aa?ii.

Caoai na?aa? iieo/aao o?aicaeoeeth aeaea XTYP_CONNECT_CONFIRM

(a neo/aa, anee ii IA iienuaae oeaa oeeueo?a CBF_FAIL_CONFIRMS i?e

auciaa niioaaonoaothuae ooieoeee).

A ieaeai?eaaaeaiiii i?eia?a i?iecaiaeeony iiiuoea onoaiiaeoue

aeeaeia n na?aa?ii, eioi?ue a ninoiyiee ?aaioaoue n service eiaiai

‘My Server’ a nenoaiiii ?aaeeia. N/eoaai, /oi ia?aiao?u

hszSysTopic e hszServName oaea i?aaeaa?eoaeueii nicaeaiu iaie ?aiaa.

HCONV hConv;

HWND hwndParent;

HSZ hszServName;

HSZ hszSysTopic;

. . .

hConv = DdeConnect(

idInst, // Eiiey i?eeiaeaiey

hszServName, // Eaeaioeoeeaoi?

service-eiaie

handle hszSysTopic,// Eaeaioeoeeaoi?

system-topic-eiaie

(PCONVCONTEXT) NULL); // Eniieuecoai eiioaeno

ii oiie/aieth

if( hConv == NULL )

{

MessageBox( hwndParent, “MyServer IA aeinooiai!”,

(LPSTR) NULL, MB_OK );

return FALSE;

}

. . .

A yoii i?eia?a ooieoeey DdeConnect canoaaeyao DDEML iinu-

eaoue o?aicaeoeeth aeaea XTYP_CONNECT a ooieoeeth ia?aoiiai auciaa na?-

aa?a MyServer.

A oaia?ue i?eaaaeai i?eia? ooieoeee ia?aoiiai auciaa na?aa?a,

eioi?ue ia?aaaouaaao o?aicaeoeeth XTYP_CONNECT e n?aaieaaao naia

ca?aaeno?e?iaaiiia eiy n eiaiai, iieo/aiiui io eeeaioa. Eae oaea

auei ioia/aii ?aiaa, anee iie niaiaaeatho, oi na?aa? a ninoiyiee

onoaiiaeoue aeeaeia n eeeaioii.

#define CTOPICS 5

HSZ hsz1; // Eaeaioeoeeaoi? no?iee,

iieo/aiiue io DDEML.

HSZ ahszTopics[CTOPICS]; // Iannea iiaeae?aaeeaaaiuo

topic eiai

int i; // N/ao/ee oeeeea

.

. // Aeey ia?aaioee o?aicaeoeee eniieuecoai noaiaea?oioth

ANSI C

. // eiino?oeoeeth switch –> case –> default.

.

case XTYP_CONNECT:

for (i = 0; i < CTOPICS; i++){if (hsz1 == ahszTopics[i])return TRUE; // Onoaiiaea aeeaeiaa}return FALSE; // Topic eiy IA iiaeaea?aeeaaaony,aeeaeia cai?auai... // Ia?aaioea ae?oaeo oeiia o?aicaeoeee..Anee na?aa? aica?auaao TRUE a ioaao ia o?aicaeoeethXTYP_CONNECT, DDEML iinueaao o?aicaeoeeth aeaea XTYP_CONNECT_CONFIRMa ooieoeeth ia?aoiiai auciaa aeaiiiai na?aa?a. Ia?aaioaa yoo o?ai-caeoeeth, na?aa? iiaeao iieo/eoue eaeaiaeeoeeaoi? aeeaeiaa.Aianoi eiie?aoiiai eiaie na?aa?a eeeaio iiaeao onoaiiaeoueoaaeii aeeaeiaa iooai onoaiiaee eaeaioeoeeaoi?ia service e topiceiai a NULL i?e auciaa ooieoeee DdeConnect.Anee oioy au iaeei ec auoaia?a/eneaiiuo eaeaioeoeeaoi?ia ?a-aai NULL, DDEML iinueaao o?aicaeoeeth oeia XTYP_WILDCONNECT a ooi-eoeeth ia?aoiiai auciaa anao aeoeaiuo a aeaiiue iiiaio DDE-i?eeiaea-iee (eneeth/aiey ninoaaeytho eeoue oa, eoi i?e auciaa niioaaonoaoth-uae ooieoeee oeacae oeaa oeeueo?aoeee XTYP_WILDCONNECT).Ethaia na?aa?-i?eeiaeaiea aeieaeii ioaaoeoue ia aeaiioth o?aicae-oeeth e aica?aoeoue oeacaoaeue ia iannea no?oeoo? oeia HSZPAIR, ieai-/eaathueeny ioeai.Anee na?aa?-i?eeiaeaiea IA aucuaaao ooieoeeth DDeNameServiceaeey ?aaeno?aoeee nianoaaiiiai service eiaie a nenoaia e oeeueo? ia-?aaioee o?aicaeoeee aeeth/ai, oi na?aa? IA iieo/eo o?aicaeoeeth aeaeaXTYP_WILDCONNECT.Auoaiienaiiue iannea aeieaeai niaea?aeaoue iaeio no?oeoo?o aeeyeaaeaeiai service e topic eiai. DDEML auae?aao iaeio ia?o ec ianne-aa aeey onoaiiaeaiey aeeaeiaa e aica?auaao aai eaeaioeoeeaoi? eeeai-oo. Caoai DDEML iinueaao na?aa?o o?aicaeoeeth aeaeaXTYP_CONNECT_CONFIRM (eneeth/aiey ninoaaeytho eeoue oa na?aa?u, ei-oi?ua i?e eieoeeaeecaoeee onoaiiaeee oeeueo? ia?aaioee o?aicaeoeee).I?iaeaiiinoe?oai eniieueciaaiea o?aicaeoeee aeaea XTYP_CONNECT.#define CTOPICS 2UINT uType;HSZPAIR ahszp[(CTOPICS + 1)];HSZ ahszTopicList[CTOPICS];HSZ hszServ, hszTopic;WORD i, j;if (uType == XTYP_WILDCONNECT){// Neaie?oai nienie topic eiai e nicaeaai ian-nea no?oeoo? oeia HSZPAIRj = 0;for (i = 0; i < CTOPICS; i++){if (hszTopic == (HSZ) NULL ||hszTopic == ahszTopicList[i]){ahszp[j].hszSvc = hszServ;ahszp[j++].hszTopic = ahszTopicList[i];}}//// Iineaaeiee yeaiaio ianneaa anaaaea NULL.//ahszp[j].hszSvc = NULL;ahszp[j++].hszTopic = NULL;//// Aica?auaai aeene?eioi? aeiaaeueiiai iauaeoa// iaiyoe,niaea?aeauee no?oeoo?u oeia HSZPAIR.//return DdeCreateDataHandle(idInst, // Eiiey i?eeiaeaiey(LPBYTE) &ahszp, // Oeacaoaeue ia ianneaoeia HSZPAIRsizeof(HSZ) * j, // Aeeeia ianneaa0, // Ia/aeueiia niauaiea(HSZ) NULL, // item-eiy ia nouanoaoao0, // oi?iao item-eiaie oaeaea// ia nouanoaoao0); // Aiceaaaai ana ?aaioo// n ianneaii ia nenoaio}Ethaie na?aa? eee eeeaio iiaeao iai?aaoue aeeaeia a ethaia a?a-iy iooai auciaa ooieoeee DdeDisconnect. Yoi icia/aao, /oi ia?oia?ii iaiaio aeaiiuie iieo/aao o?aicaeoeeth oeia XTYP_DISCONNECT a ooi-eoeee ia?aoiiai auciaa (anee, eiia/ii, ia?oia? ia onoaiiaee oeeueo?ia?aaioee o?aicaeoeee aeaea CBF_SKIP_DISCONNECTIONS).Iau/ii i?eeiaeaiea ?aaae?oao ia o?aicaeoeeth XTYP_DISCONNECTauciaii ooieoeee DdeQueryInfo aeey iieo/aiey eioi?iaoeee i i?ae?a-uaiiii aeeaeiaa. Iinea oiai, eae ooieoeey ia?aoiiai auciaa ia?aai-oaea o?aicaeoeeth oeia XTYP_DISCONNECT, eaeaioeoeeaoi? aeeaeiaaaieueoa ia nouanoaoao.Eeeaioneia i?eeiaeaiea, eioi?ia iieo/aao o?aicaeoeeth oeiaXTYP_DISCONNECT a naiae ooieoeee ia?aoiiai auciaa iiaeao iiiu-oaoueny aiciaiiaeoue aeeaeia i?e i?iiiue auciaa ooieoeeeDdeReconnect. Eeeaioneia i?eeiaeaiea iiaeao aucuaaoue yoo ooieoeethoieueei iaoiaeynue aioo?e naiae nianoaaiiie ooieoeee ia?aoiiai auciaa.Neiaeiue aeeaeiaEeeaioneia i?eeiaeaiea iiaeao eniieueciaaoue ooieoeethDdeConnectList aeey oiai, /oiau ii?aaeaeeoue eaeea na?aa?-i?eeiaea-iey nouanoaotho a nenoaia a aeaiiue iiiaio a?aiaie.Eeeaio iaycaoaeueii aeieaeai iienuaaoue service e topic eiaia,eiaaea ii aucuaaao yoo ooieoeeth; yoi icia/aao, /oi DDEML aeieaeiaiineaoue o?aicaeoeeth aeaea XTYP_CONNECT ana ooieoeee ia?aoiiai auci-aa anao eiathueony a aeaiiue iiiaio na?aa?-i?eeiaeaiee, /uee ca?aaen-o?e?iaaiiua eiaia niaiaaeatho n eiaiaie, oeacaiiuie eeeaioii (en-eeth/aiea ninoaaeytho eeoue oa na?aa?u, eioi?ua oeeueo?otho iieo/aa-iua o?aicaeoeee).A aeiaaaeaiea e auoaneacaiiiio, iiaeii ioiaoeoue, /oi eeeaio,i?e auciaa ooieoeee DdeConnectList, iiaeao oeacaoue NULL a ea/anoaaservice eee topic eiaie, eeai aea n?aco aeey iaieo. Ana aeinooiiua anenoaia na?aa?u, /uee ca?aaeno?e?iaaiiua eiaia niaiaaeatho n eiaia-ie, oeacaiiuie eeeaioii, ioaa/atho ia aai cai?in. Aeeaeia onoaiaa-eeaaaony ni anaie oaeeie na?aa?aie, aeaaea anee a nenoaia caiouaiiiaeii e oiaea na?aa?-i?eeiaeaiea ianeieueei ?ac.Eeeaio iiaeao eniieueciaaoue ooieoeee DdeQueryNextServer eDdeQueryConvInfo aeey oiai, /oiau iiiyoue, eaeie na?aa? iaoiaeeony anienea, iieo/aiiue i?e auciaa ooieoeee DdeConnectList.DdeQueryNextServer aica?auaao eaeaioeoeeaoi? aeeaeiaa aeey neaaeothua-ai na?aa?a, iaoiaeyuaainy a nienea; DdeQueryConvInfo caiieiyaono?oeoo?o CONVINFO eioi?iaoeeae i aeeaeiaa.Eeeaio iiaeao nio?aieoue iieo/aiiua eaeaioeoeeaoi?u aeeaeiaia eioeacaoueny io i?iniio?a inoaaoeony na?aa?ia a nienea.I?eaaaeai i?eia? eniieueciaaiey ooieoeee DdeConnectList aeeyonoaiiaeaiey aeeaeiaa ni anaie na?aa?aie, eioi?ua iiaeaea?aeeaatho eiy'system topic', caoai aoaeai eniieueciaaoue ooieoeee DdeQueryConvInfoe DdeQueryNextServer aeey iieo/aiey eo eaeaioeoeeaoi?ia serviceeiai, iaeiia?aiaiii ia caauaay nio?aieoue iineaaeiea ai a?aiaiiiiaooa?a.HCONVLIST hconvList; // Nienie aeeaeiaiaDWORD idInst; // Aeene?eioi? i?eeiaeaieyHSZ hszSystem; // System topicHCONV hconv = NULL; // Eaeaioeoeeaoi? aeeaeiaaCONVINFO ci; // Eioi?iaoeey i aeeaeiaaUINT cConv = 0; // Eiee/anoai eaeaioeoeeaoi?iaaeeaeiaiaHSZ *pHsz, *aHsz; // Oeacaoaeue ia eaeaioeoeeaoi?no?iee// I?eniaaeeiyainy ei anai na?aa?ai, iiaeaea?aeeaathuei// System topic.hconvList = DdeConnectList(idInst, NULL, hszSystem,NULL, NULL);// Au/eneyai eiee/anoai na?aa?ia a nienea.while((hconv = DdeQueryNextServer(hconvList,hconv))!= NULL)cConv++;// Auaeaeyai aooa? aeey nio?aiaiey eaeaioeoeeaoi?ia no?ie.hconv = NULL;aHsz = (HSZ *) LocalAlloc(LMEM_FIXED, cConv * sizeof(HSZ));// Eiie?oai eaeaioeoeeaoi? no?iee a aooa?.pHsz = aHsz;ile((hconv = DdeQueryNextServer(hconvList,hconv)) != NULL){DdeQueryConvInfo(hconv, QID_SYNC, (PCONVINFO) &ci);DdeKeepStringHandle(idInst, ci.hszSvcPartner);*pHsz++ = ci.hszSvcPartner;}.. // Eniieuecoai eaeaioeoeeaoi?: 'iauaainy' n na?aa?ii..// Inaiaiaeaeaai iaiyoue e i?ae?auaai aeeaeia.LocalFree((HANDLE) aHsz);DdeDisconnectList(hconvList);I?eeiaeaiea iiaeao iai?aaoue eiaeeaeaeoaeueiue aeeaeia, iaoiaeyuee-ny a nienea aeeaeiaia iooai auciaa ooieoeee DdeDisconnect; i?eeiaea-iea iiaeao iai?aaoue ana aeeaeiae, iaoiaeyueany a nienea iooai auci-aa ooieoeee DdeDisconnectList.Iaa auoaoeacaiiua ooieoeee oeacuaatho DDEML i iaiaoiaeeiinoeiinueee o?aicaeoeee aeaea XTYP_DISCONNECT ai ana ooieoeee ia?oia?iaii aeeaeiao aeaiiiai i?eeiaeaiey (a neo/aa eniieueciaaiey ooieoeeeDdeDisconnectList aoaeao iinueaoueny o?aicaeoeey XTYP_DISCONNECT aeeyeaaeaeiai yeaiaioa a nienea aeeaeiaia).Iaiai aeaiiuie iaaeaeo i?eeiaeaieyieOae eae DDE eniieuecoao iaeanoe iaiyoe aeey ia?aaea/e aeaiiuoec iaeiiai i?eeiaeaiey a ae?oaia, DDEML iaania/eaaao eiia/iiai i?ia-?aiienoa ooieoeeyie, i?e iiiiue eioi?uo DDE-i?eeiaeaiey iiaoo nic-aeaaaoue e ia?aaaouaaoue DDE-iauaeou.Aanue niaeo? o?aicaeoeee, eioi?ue aucuaaao iaiai aeaiiuie,o?aaoao io i?eeiaeaiey, yenii?oe?othuaai eo, nicaeaiey iaeioi?iaiaooa?a, niaea?aeauaai yoe aeaiiua, a caoai auciaa ooieoeeeDdeCreateDataHandle.Yoa ooieoeey nicaeaao DDE-iauaeo, eiie?oao aeaiiua ec aooa?a ayoio iauaeo e aica?auaao eaeaioeoeeaoi? aeaiiuo aeey aeaiiiai i?eei-aeaiey.Eaeaioeoeeaoi? aeaiiuo-yoi aeaieiia neiai, eioi?ia eniieuecoaoDDEML aeey iaania/aiey aeinooia e aeaiiui a DDE-iauaeoa.Aeey oiai, /oiau ?acaeaeyoue aeaiiua a DDE-iauaeoa, i?eeiaeaieaia?aaeaao eaeaioeoeeaoi? aeaiiuo DDEML, a caoai DDEML ia?aaeaao aai aooieoeeth ia?aoiiai auciaa i?eeiaeaiey, iieo/athuaai aeaiiua.A ieaeai?eaaaeaiiii i?eia?a iieacaii, eae nicaeaoue DDE-iauaeoe iieo/eoue aai eaeaioeoeeaoi?. A i?ioeanna ia?aaioee o?aicaeoeee oe-ia XTYP_ADVREQ, ooieoeey ia?aoiiai auciaa eiiaa?oe?oao oaeouaaa?aiy a ASCII no?ieo, eiie?oao no?ieo a aniiiiaaoaeueiue aooa?, acaoai nicaeaao DDE-iauaeo, niaea?aeauee auoaoeacaiioth no?ieo. Ooi-eoeey ia?aoiiai auciaa aica?auaao eaeaioeoeeaoi? DDE-iauaeoa DDEML,eioi?ay ia?aaeaao yoio eaeaioeoeeaoi? eeeaioneiio i?eeiaeaieth.typedef struct tagTIME{INT hour; // 0 - 11 oi?iao a?aiaie aeey/ania.INT hour12; // 12-ie oi?iao.INT hour24; // 24-ie oi?iao.INT minute;INT second;INT ampm; // 0 --> AM , 1 –> PM

} TIME;

HDDEDATA EXPENTRY DdeCallback

(uType, uFmt, hconv, hsz1, hsz2, hdata,

dwData1, dwData2)

UINT uType;

UINT uFmt;

HCONV hconv;

HSZ hsz1;

HSZ hsz2;

HDDEDATA hdata;

DWORD dwData1;

DWORD dwData2;

{

CHAR szBuf[32];

switch (uType)

{

case XTYP_ADVREQ:

case XTYP_REQUEST:

if ((hsz1 == hszTime && hsz2 == hszNow)

&& (uFmt == CF_TEXT))

{

// Eiie?oai no?ieo a aooa?.

itoa(tmTime.hour, szBuf, 10);

lstrcat(szBuf, “:”);

if (tmTime.minute < 10)lstrcat(szBuf, "0");itoa(tmTime.minute,&szBuf[lstrlen(szBuf)], 10);lstrcat(szBuf, ":");if (tmTime.second < 10)strcat(szBuf, "0");itoa(tmTime.second,&szBuf[lstrlen(szBuf)], 10);szBuf[lstrlen(szBuf)] = '\0';// Nicaeaai aeiaaeueiue iauaeo e// aica?auaai aai eaeaioeoeeaoi?return (DdeCreateDataHandle(idInst, // eiieyi?eeiaeaiey(LPBYTE) szBuf, // enoiaeiueaooa?lstrlen(szBuf) + 1,0, // niauaieaio aai ia/aeahszNow, // item-eiyCF_TEXT, // oi?iaoii/oiai yueea0));}else return (HDDEDATA) NULL;.. // Ia?aaioea ae?oaeo oeiia o?aicaeoeee..}}Eeeaioneia i?eeiaeaiea iieo/aao oeacaoaeue ia DDE-iauaeo io-oai ia?aaea/e eaeaioeoeeaoi?a aeaiiuo ooieoeee DdeAccessData. Oeaca-oaeue, aica?auaaiue yoie ooieoeeae, iaania/eaaao aeinooi e aeaiiui aoi?iaoa 'OIEUeEI IA *OAIEA'. Eeeaio aeieaeai i?iniio?aoue iieo/aiiuaaeaiiua i?e iiiiue yoiai oeacaoaey e aucaaoue ooieoeethDdeUnaccessData aeey aai oie/oiaeaiey. Eeeaio iiaeao neiie?iaaoue ii-eo/aiiua aeaiiua a ca?aiaa i?eaioiaeaiiue aooa? iin?aaenoaii auci-aa ooieoeee DdeGetData.A neaaeothuai i?eia?a iu iieo/ei oeacaoaeue ia DDE-iauaeo,nio?aiei aai a ia?aiao?a hData, neiie?oai niaea?aeeiia ai a?aiai-iue aooa? e oie/oiaeei oeacaoaeue:HDDEDATA hdata;LPBYTE lpszAdviseData;DWORD cbDataLen;DWORD i;char szData[32];. . .case XTYP_ADVDATA:lpszAdviseData = DdeAccessData(hdata,&cbDataLen);for (i = 0; i < cbDataLen; i++)szData[i] = *lpszAdviseData++;DdeUnaccessData(hdata);return (HDDEDATA) TRUE;. . .Iau/ii, eiaaea i?eeiaeaiea, nicaeathuaa eaeaioeoeeaoi? aeaiiuo,ia?aaeaao aai DDEML, yoio eaeaioeoeeaoi? ii?oeony aioo?e auoaoea-caiiiai i?eeiaeaiey. A yoii iao ie/aai no?aoiiai, anee na?aa? aeie-aeai ?acaeaeyoue aeaiiua oieueei n iaeiei eeeaioii. Anee aea na?aa? aeie-aeai ?acaeaeyoue aeaiiua n?aco n ianeieueeeie eeeaioaie iaeiia?aiaiii,aio i?eaeaony oeacuaaoue oeaa HDATA_APPOWNED i?e auciaa ooieoeeeDdeCreateDataHandle.Yoi aeaeaao aiciiaeiui iieo/aiea i?aa nianoaaiiinoe iaDDE-iauaeo na?aa?-i?eeiaeaiey e i?aaeioa?auaao ii?/o eaeaioeoeeaoi-?a aeaiiuo DDEML. I?eeiaeaiea iiaeao ia?aaeaaaoue DDEML eaeaioeoeeaoi?aeaiiuo ethaia eiee/anoai ?ac, iaeiaei aucuaaoue ooieoeethDdeCreateDataHandle iiaeii eeoue iaeiaaeaeu.Anee i?eeiaeaiea oeacuaaao oeaa HDATA_APPOWNED a ia?aiao?aatCmd i?e auciaa ooieoeee DdeCreateDataHandle, iii iaycaoaeueiiaeieaeii aucuaaoue ooieoeeth DdeFreeDataHandle aeey i/enoee iaiyoe aiacaaeneiinoe io oiai, ia?aaeaaaeny ee eaeaioeoeeaoi? aeaiiuo DDEMLeee iao. Ia?aae oai eae iai?aaoue aeeaeia, i?eeiaeaiea aeieaeii aucu-aaoue ooieoeeth DdeFreeDataHandle aeey i/enoee anao nicaeaiiuo eaeaioe-oeeaoi?ia, ii eioi?ua oae e ia auee ia?aaeaiu DDEML.Anee i?eeiaeaiea aua ia ia?aaeaei eaeaioeoeeaoi? DDE-iauaeoaDDEML, oi iii iiaeao aeiaaaeoue aeaiiua e oaea nouanoaothuaio iauaeooeee iieiinoueth caiaieoue eo a iai. Ana yoe na?aeniua ooieoeee ianeo-aeeaathony ooieoeeae DdeAddData.Iau/ii i?eeiaeaiea eniieuecoao yoo ooieoeeth aeey iiaie eieoeea-eecaoeee noa?uo ia oie/oiaeaiiuo DDE-iauaeoia. Iinea oiai, eae i?e-eiaeaiea ia?aaeaao eaeaioeoeeaoi? aeaiiuo DDEML, DDE-iauaeo, eaeaioe-oeoee?othuee yoio eaeaioeoeeaoi? IA iiaeao auoue eciaiai, iaeiaei iiiiaeao auoue oie/oiaeai.OLE-oaoiieiaeyEae aeaeii ec iienaiiiai auoa i?ioieiea DDE, i?eeiaeaieyaeieaeiu iaycaoaeueii ciaoue oeiu ia?aaeaaaaiuo aeaiiuo, oiaoue eo ia?a-aaouaaoue, a a iniiaiii aeaaea iiaoo ?aaioaoue oieueei n neiaieueiuieno?ieaie. Yoi, eiia/ii, ia i/aiue oaeiaii, eiaaea iaiaoiaeeii, iai?e-ia?, nicaeaoue iaaieueoie oaeno n ?acee/iuie ea?oeieaie, ieeoia?ai-iaie e ae?oaeie iaaeyaeiuie eee ia i/aiue eeethno?aoeeyie. A yoii neo-/aa ia iiiiuue i?ia?aiienoo i?ieoiaeeo OLE - ano?aeaaiea iauaeoia.Aianoa n aeaiiuie iu iieo/aai iaoeiiue eiae, eioi?ue yoe aeaiiua ii-aeao ia?aaaouaaoue.Niiniau oii?yaei/eaaiey, enoi/ieee e oeaeaaua aeieoiaiouI?e eniieueciaaiee OLE-oaoiieiaee iieueciaaoaeue anaaaea eiaaoaeaei n iaeiei aaaeouei i?eeiaeaieai (aeaaiui) e iaeiei aaaeiiui (iiae-/eiaiiui), a oi/iaa, niaeiei aaaeiiui.I?eeiaeaiea, n iiiiuueth eioi?iai iieo/ai iauaeo aeey ano?aeaa-iey anaaaea ea?aao ?ieue iiae/eiaiiiai. Yoi iniaaiii oa?aeoa?ii aeeyneo/aaa ia?aaea/e iauaeoia i?e ano?aeaaiee e naycuaaiee /a?ac ao-oa? i?iiaaeooi/iiai iaiaia.*anoi eniieuecoaiua oa?ieiu I?eeiaeaiea-enoi/iee e Oeaeaaiai?eeiaeaiea eanathony ia iiae/eiaiey i?eeiaeaiee, a ii?aaeaeytho aaiaa-eiaeth iauaeoia.Iaeioi?ua Windows-i?eeiaeaiey iiaoo aunooiaoue oieueei a ?ieeiiae/eiaiiuo, a iaeioi?ua oieueei a ?iee aaaeoueo. Iai?eia?,Paintbrush a OLE oaoiieiaee iiaeao ea?aoue oieueei ?ieue iiae/eiaiii-ai i?eeiaeaiey, neoaeauaai aeey nicaeaiey e iiaeeoeeaoeee ioaeaeueiuoiauaeoia. Ae?oaea i?eeiaeaiey, iai?eia?, Write eee Cardfile iiaeiin/eoaoue ii?aaaeaiiui n oi/ee c?aiey, /oi ai?acaei /aua i?eoiaeeonyanoaaeyoue eeethno?aoeee a neiaeiua ii no?oeoo?a oaeno, /ai oaeno aeeethno?aoeee. Iiaua i?eeiaeaiey,oaeea eae Word, iiaoo auiieiyoue a?aieao OLE iaa yoe ooieoeee.Oiio?aaeaiea oa?ieia iauaeo n/eoaaony i?anoeaeiui a e?oaaoi?ia?aiienoia, oioy /anoi ii oiio?yaeyaony e ia e ianoo. Anyeee?ac?aaio/ee ii/eoaao naiei aeieaii i?eiaieoue a naiai i?iaeoeoa IIIaac iniaie ia oi iaiaoiaeeiinoe. A n?aaea Windows a oa?iei iauaeoaeeaaeuaaaony ianeieueei niaoeeoe/aneee niune. Iieueciaaoaey ia i?ea-eaoatho iinoeaaoue acu III, eee caiyoueny eiino?oe?iaaieai iauaeoiaia N++.Eiaaea ia iauaeoao aiai?yo a ?aieao Windows, oi eiatho a aeaeoaiciiaeiinoue ano?aeaaiey a iaeioi?ue aeieoiaio o?aaiaioa, ii?iaeaeai-iiai ae?oaei i?eeiaeaieai. Aio yoi "eii?iaeiia oaei" e iacuaaaonyiauaeoii.A oaeii iiaeoiaea iao ie/aai iiaiai. Eiaaea a oaeno, iiaeaioaa-eeaaaiue Write, anoaaeyaony ?enoiie ec Paintbrush iin?aaenoaiiClipboard eee oaaeeoe Exnel, a aeieoiaio, iiaeaioaaeeaaaiue a Word,oi ?acoeueoaoii aeaenoaey aoaeao eae ?ac iiyaeaiey iauaeoa.O?aaeeoeeiiiua iauaeou anaaaea i?aaenoaaeytho niaie eiiee. ?aai-oa n ieie iniiauaaaony ia oii, /oi ana Windows i?eeiaeaiey iiaeaea?-aeeaatho ia oieueei naie nianoaaiiue oi?iao , ii e iaeioi?ue iaia-uaiiue, noaiaea?oiue, ea?athuee ?ieue iauaecaanoiiai iaaeaeoia?iaeiiaiycuea. Anee, iai?eia?, a oaenoiaue aeieoiaio anoaaeyaony oaaeeoeaec oaaee/iiai i?ioeanni?a, oi aoooa? i?iiaaeooi/iiai iaiaia i?aia-?acoao aa a oi?iao e noaiaea?oiiio, e oai naiui iaania/eaaaoanoaaeo. Oaeay eiiey a oaenoiaii ?aaeaeoi?a ii aeaeo ia ioee/aaonyio i?eaeiaeo, ii iia iaaeinooiia aeey aianaiey eciaiaiee. Iaaiciiae-ii, anoaaea oaeei niiniaii eiieth ec Paintbrush a Write aeieoiaio,eciaieoue oeaao, oieueio eeiee eee ianooaa.Iiaua iauaeou, aeinooiiua a ?aieao Windows 3.1 i/aiue iioiaeeia o?aaeeoeeiiiua, ii iie ia yaeythony eiieyie - yoi i?eaeiaeu. Iieeiathony a aaeeinoaaiiii yecaiiey?a e iaoiaeyony iaiino?aaenoaaiii aoeaeaauo aeieoiaioao. Oai iie nouanoaotho iaeiia?aiaiii a aeaoo oi?ia-oao - a noaiaea?oiii e a oi?iaoa i?eeiaeaiey-enoi/ieea.Aeaaiaea?y noaiaea?oiiio oi?iaoo iauaeo iiaeao eaeeoee?iaaoueny enio?aiyoue a ?aieao oeaeaaiai aeieoiaioa. Eiaaony aiciiaeiinoue ia?a-aioee iauaeoa oaeaea, eae e ethaiai oaeea i?eaeiaea. Neooaoeey aua-eyaeeo oae, neiaii aioo?e iauaeoa ano?iai ae?oaie. Yoi iaania/e-aaao aeinooi e n?aaenoaai ia?aaioee iiaiai iauaeoa (i?eeiaeaieth-en-oi/ieeo) iin?aaenoaii i?inoiai aeaieiiai uae/ea ia iauaeoa.Ano?iaiiua iauaeouEioi?iaoeey, anoaaeaiiuy a aeieoiaio oeaeaaiai i?eeiaeaiey,i?aaenoaaeyao niaie iauaeo. Oaeie iauaeo ano?aeaaaony a aeieoiaio,ia?aaaouaaaiue aaaeouei i?eeiaeaieai. Yoi cia/eo, /oi ii ?anniao?e-aaaony eae ninoaaiay /anoue aeaiiiai aeieoiaioa, iiaeao ?ania/aou-aaoueny e nio?aiyoueny aianoa n iei. Oaeea iauaeou iiaoo niaea?aeaoueeioi?iaoeeth ethaiai oeia: oaeno, oaaeeoeu, a?aoeee e ae?.Ano?iaiiua iauaeou nouanoaotho oieueei a aaeeinoaaiiii yecai-iey?a e oeueei oai, aaea iie ano?iaiu - a oeaeaaii aeieoiaioa. Ia?a-aaouaathony iie naieie "?iaeeoaeueneeie" i?ia?aiiaie, aucuaaaiuieaanueia yooaeoeaiui niinaii, a ioee/aa io o?aaeeoeeiiiiai.Naycuaaiea n ?iaeeoaeueneei i?eeiaeaieaiNeaaeothuae aanueia oaeiaiie iniaaiiinoueth ano?iaiiuo iauaeoiayaeyaony oi, /oi iie inoathony naycaiiuie n ii?iaeeaoei eo i?eeiaea-ieyie. Aeaaiaea?y yoiio iieueciaaoaeue ecaaaeyaony io iaiaoiaeeiinoeiiiieoue eiaia e aee?aeoi?ee oaeeia-enoi/ieeia. Aeinoaoi/ii aeaieii-ai uae/ea ia iauaeoa - e ?iaeeoaeueneay i?ia?aiia caioneaaony.Aaaeiui aeinoieinoaii iiaeiaiiai naycuaaiey ano?iaiiuo iauae-oia yaeyaony iiaeeueiinoue aeieoiaioia. Iiaeii eaaei ia?aianoe oaeieaeieoiaio n iaeiie iaoeiu ia ae?oaoth (iaiaoiaeeii oieueei /oiau ia ieoiaaeo auea onoaiiaeaia iaiei/ea e auee iaiaoiaeeiua i?eeiaeaiey eeeaeeiaie/aneea aeaeeioaee io ieo). Aeey ia?aaioee ano?iaiiuo iauae-oia aeinoaoi/ii aoaeao uaeeiooue ii iae aeaaaeaeu e ia ae?oaie iaoeiai?iecieaeao oiaea naiia, /oi e ia aaoae: auciaaony niioaaonaothuaai?eeiaeaiea. A yoii neo/aa iaiaoiaeeiui oneiaeai ia?aiina yaeyaonyiaee/ea ia ae?oaie iaoeia oaenoiaiai ?aaeaeoi?a Write e a?aoe/anei-ai ?aaeaeoi?a Paintbrush.I?e ?aaioa a ?aieao DDE oaeie ia?aiin ia aiciiaeai, oi/iaa iiaoaeao aeeth/aoue a naay ia oieueei ia?aiin naiiai oaeea-aeieoiaioa,ii e naycaiiuo n aeaiiui oaeeii oaeeia-enoi/ieeia e oeaeaauo oae-eia - anae no?oeoo?u.Ia?niaeoeau ?acaeoey OLEOaoiieiaey OLE aeaeaao oieueei ia?aua oaae. Iiea oieueei iaei-oi?ua Windows i?eeiaeaiey yaeythony OLE niaianoeiuie. N?aaee ooeeeoa?oiiu Accessories aa?nee 3.1 oaeeie ia naaiaeiaoiee aeaiue yaeytho-ny oieueei Write, Paintbrush e Cardfile. Ii aeaaea iie "a naiai e?o-ao" ia aeiioneatho anoaaee a i?iecaieueiii iai?aaeaiee (o.a. ec eth-aie a ethaoth ae?oaoth). A ianoayuaa a?aiy ?a/ue eaeao i iiaeaea?aeea iae-aieaa ii?aaaeaiiiai n i?aeoe/aneie oi/ee c?aiey "iai?aeaieyano?aeaaiey" - ec Paintbrush a Write e Nardfile aeieoiaioa.*oiau ii?aaeaeeoue eaeea ec i?eeiaeaiee iiaeaea?aeeaath OLE eioa?-oaen, iaiaoiaeeii ec OLE-niaianoeiiai i?eeiaeaiey auiieieoue aee?ae-oeao "ANOAAEOUe IAUAEO" a iaith "Edit". A io?uaoainy ieia aoaeaoi?iaeaiiino?e?iaai nienie aeinooiiuo ano?aeaaaiuo iauaeoia.A ianoiyuee iiiaio iiiaea eiiieeyoi?u oaea aaaee iiiaea?aeeoOLE a naie aeaeeioaee: Borland C++ ver4.5. I?eia? eniieueciaaiey OLEoaoiieiaee i?eaaaeai a i?eeiaeaiee 1. Aeaiiay i?ia?aiia eniieuecoao nic-aeaiiue ?enoiie Paintbrush a aeaea oaeea eee eiie?oao aai ec Clipboard.Caeeth/aieaA caeeth/aiee oioaeinue au ioiaoeoue, /oi nouanoaothuea niiniauiaiaia eioi?iaoeee aicieeaee aianoa n ?acaeoeai Windows. Eae naianooue Windows, iie yaeythony i?iaeieaeaieai caeiaeaiiie a iaa oeaeue:ciiniaiinoue ?aaioaoue n oaeeaie ethauo oi?iaoia, ia ethaii iai?oaeiaaiee.A ioee/ea io noaiaea?oiiai ?aoaiey, eiaaea oe?ia-i?iecaiaeeoaeue iai-ei/ee (oeia Windows) iuoaeanue naia iaienaoue ?acee/iua ae?aeaa?uaeey iiaeaea?aeee ono?ienoa e ?acee/iua aeaeeioaee aeey iiaeaea?aeeeoi?iaoia iiiai/eneaiiuo oaeeia ae?oaeo iaeaoia, oe?ia Microsoftaiceiaeeea yoo iaycaiiinoue ia i?iecaiaeeoaeae iai?oaeiaaiey ei?ia?aiiiiai iaania/aiey. Oaeei ia?acii, iineaaeiaaoaeueiia ?acae-oea Clipboard-->DDE–>OLE yaeyaony i?iaeieaeaieai aiieiuaiey

eaeae “nai ecia?ae – nai aiaae?ye”. Anoannoaaiii, iaeaieueoea ia-

aeaaeaeu nae/an aiceaaathony ia OLE (aa iiaue noaiaea?o OLE.2), oae eae

yoio noaiaea?o iicaieyao aeeth/aoue a naay i/aiue iiuiua n?aaenoaa,
oaeea

eae Multimedia. A iaeiii oaeea iiaeao iaoiaeeony ia oieueei oaeno,

?enoiie, a e aeaaea oeaeue oeeuei, iieiinoueth icao/aiiue e aioiaue

e iieaco.

NIENIE EEOA?AOO?U

1. Aeaaeeia N.A. O?ieia A.A. I?ia?aiie?iaaiea a Microsoft Windows:

A 2-o /anoyo. I.:”AeEAEIA-IEOE”, 1992.

2. Oieoe N. Windows 3.1 aeey iieueciaaoaey. Ia?. n iaiaoeeiai

Eeaa:BHV, 1992.

3. Microsoft Windows Software Development Kit. Version 3.

Programmer’s Reference, Programming Tools, Windows Extensions.

4. Charles Petzold. Programming Windows. Microsoft Press.

5. Aeaeey Windows 3.X. I.: E.A.E. – Nioo, 1992.

6. Borland C++. Usres manual.

I?eeiaeaiea 1. I?eia? eniieueciaaiey OLE oaoiieiaee

// ObjectWindows – (C) Copyright 1992 by Borland International

//

// oleclnt.cpp

// I?eia? Ole Client i?ia?aiiu, enieuecothuae OWL. Iia iieacuaaao

// i?eia? eniieueciaaiey Ole functions, e C++ eeannia .

// Iniiaiia ieii iicaieyao iieueciaaoaeth nicaeaoue paint brush

// object, eee eiie?iaaoue aai ec clipboard.

#include

#include

#include

#include

#include

#include

#include

#include

#pragma hdrstop

#include “oleclnte.h”

#include “oleclntr.h”

#include “oleclnt.h”

// noaoe/aneea aeaiiua eeanna

LPOLECLIENTVTBL TOwlClient::lpClientVtbl = NULL;

int TOleDocWindow::nNextObjectNum = 0;

void TOleApp::InitInstance()

{

TApplication::InitInstance();

vcfLink = RegisterClipboardFormat( “ObjectLink” );

vcfNative = RegisterClipboardFormat( “Native” );

vcfOwnerLink = RegisterClipboardFormat( “OwnerLink” );

// comments in owlole.h mention these ole clipboard formats

}

// iienaiea ooieoeee OWL Object, eioi?ua

// iicaieytho o?aieoue iienaiea Ole Object

int FAR PASCAL _export StdCallBack(LPOLECLIENT lpClient,

OLE_NOTIFICATION notification,

LPOLEOBJECT lpObject )

{

return (( PTOwlClient )lpClient)->TOleDocWindowThis->

CallBack( lpClient ,

notification,

lpObject );

}

TOwlClient::TOwlClient( PTOleDocWindow owner , HINSTANCE hInst )

{

TOleDocWindowThis = owner;

if ( !lpClientVtbl )

{

lpClientVtbl = new OLECLIENTVTBL;

if ( hInst == 0 ) {

lpClientVtbl->CallBack = StdCallBack;

} else {

lpClientVtbl->CallBack = (TCallBack)

MakeProcInstance( (FARPROC)StdCallBack,

hInst );

}

}

lpvtbl = lpClientVtbl;

}

void TOleDocWindow::WMURedraw( RTMessage )

{

bObjectLoaded = TRUE;

InvalidateRect( HWindow, NULL, TRUE );

UpdateWindow( HWindow );

}

#pragma argsused

int TOleDocWindow::CallBack( LPOLECLIENT lpOleClient ,

OLE_NOTIFICATION oleNot,

LPOLEOBJECT lpOleObject )

{

switch ( oleNot ) {

case OLE_CHANGED:

case OLE_SAVED:

PostMessage( HWindow , WM_U_REDRAW, 0, 0L );

break;

case OLE_CLOSED:

break;

case OLE_QUERY_PAINT:

break;

case OLE_RELEASE:

break;

case OLE_RENAMED:

break;

default:

break;

}

return TRUE;

}

void TOleDocWindow::CMAbout( RTMessage )

{

MessageBox( HWindow , “OLE Client Program\n

Written using ObjectWindows\nCopyright (c) 1992 Borland”,

GetApplication()->Name, MB_OK );

}

// nicaeaiea iiaie paint brush

void TOleDocWindow::CMPBrush( RTMessage )

{

BackupObject();

bObjectLoaded = FALSE;

lstrcpy( lpszObjectName, GetNextObjectName() );

ret = OleCreate( “StdFileEditing”,

(LPOLECLIENT)pOwlClient,

“PBRUSH”,

lhClientDoc,

GetApplication()->Name,

&lpObject,

olerender_draw,

0 );

// Nicaeaiea Ole Object – aneio?iiiay iia?aoeey.

// Iaiaoiaeeii iaeeaeaoue aai nicaeaiea, eia/a

// iiaoo aicieeiooue ioeaee i?e ia?aaioea

// niiauaiee yoiai iauaeoa.

wait( ret , lpObject );

// OleSetHostNames onoaiaaeeaaao eiy a na?aa?a OLE.

ret = OleSetHostNames( lpObject, GetApplication()->Name,

lpszObjectName );

wait( ret , lpObject );

}

void TOleDocWindow::CMUndo( RTMessage msg)

{

if ( lpUndoObject )

if ( lpUndoObject != lpObject )

{

LPOLEOBJECT lpObjectToDelete = lpObject;

lpObject = lpUndoObject;

lpUndoObject = NULL;

ret = OleDelete( lpObjectToDelete );

wait( ret , lpObjectToDelete );

bObjectLoaded = bUndoObjectLoaded;

WMURedraw( msg );

}

}

void TOleDocWindow::CMCut( RTMessage msg)

{

CMCopy( msg );

CloseCurrentOle();

}

void TOleDocWindow::CMCopy( RTMessage )

{

if ( OpenClipboard( HWindow ) && EmptyClipboard() )

{

ret = OleCopyToClipboard( lpObject );

check( ret );

CloseClipboard();

}

}

void TOleDocWindow::BackupObject()

{

if ( lpObject )

{

ret = OleClone( lpObject, (LPOLECLIENT)pOwlClient,

lhClientDoc, GetApplication()->Name,

&lpUndoObject );

wait( ret, lpObject );

lstrcpy( lpszLastObjectName, lpszObjectName );

lstrcpy( lpszObjectName , GetNextObjectName() );

bUndoObjectLoaded = bObjectLoaded;

}

}

void TOleDocWindow::CMPaste( RTMessage )

{

if ( OpenClipboard( HWindow ) )

{

BackupObject();

lstrcpy( lpszObjectName, GetNextObjectName() );

ret = OleCreateFromClip( “StdFileEditing”,

(LPOLECLIENT)pOwlClient,

lhClientDoc,

lpszObjectName,

&lpObject,

olerender_draw,

0 );

check( ret );

ret = OleSetHostNames( lpObject,

GetApplication()->Name, lpszObjectName );

wait( ret , lpObject );

bObjectLoaded = TRUE;

CloseClipboard();

PostMessage( HWindow , WM_U_REDRAW, 0, 0L );

}

}

LPSTR TOleDocWindow::GetNextObjectName()

{

static char buffer[ MAXPATH ];

wsprintf( buffer, “object #%03d”, nNextObjectNum++ );

return buffer;

}

void TOleDocWindow::Paint( HDC hdc, PAINTSTRUCT _FAR &)

{

LPOLEOBJECT lpObjectToDraw = NULL;

if ( bObjectLoaded )

lpObjectToDraw = lpObject;

else if ( lpUndoObject )

lpObjectToDraw = lpUndoObject;

if ( lpObjectToDraw ) {

RECT rect;

GetClientRect( HWindow, &rect );

// Caia/aiea ii OleDraw:

// OleDraw aeieaeai aica?auaoue OLE_ERROR_OBJECT, anee

// object aue ia?eniaai iaaa?ii.

ret = OleDraw( lpObjectToDraw , hdc, &rect ,

NULL, 0 );

wait( ret, lpObjectToDraw );

}

}

TOleDocWindow::TOleDocWindow( PTWindowsObject parent,

LPSTR title )

: TWindow( parent, title )

{

ret = OLE_OK;

lhClientDoc = 0;

bObjectLoaded = FALSE;

bUndoObjectLoaded = FALSE;

bUndoObjectLoaded = FALSE;

pOwlClient = NULL;

lpObject = NULL;

lpUndoObject = NULL;

strcpy( lpszDocName , “noname.ole” );

*lpszLastObjectName = 0;

*lpszObjectName = 0;

bDefDocName = TRUE;

}

void TOleDocWindow::SetupWindow() {

TWindow::SetupWindow();

RegisterClientDoc();

pOwlClient = new TOwlClient( this );

}

void TOleDocWindow::RegisterClientDoc() {

ret = OleRegisterClientDoc(

GetApplication()->Name,

lpszDocName,

0,

&lhClientDoc );

check( ret );

}

void TOleDocWindow::ShutDownWindow()

{

CloseCurrentOle();

if ( pOwlClient ) delete pOwlClient;

TWindow::ShutDownWindow();

}

void TOleDocWindow::RegFileName( LPSTR FileName )

{

lstrcpy( lpszDocName , FileName );

ret = OleRegisterClientDoc( GetApplication()->Name,

lpszDocName ,

0,

&lhClientDoc );

check ( ret );

}

void TOleDocWindow::CMActivate( RTMessage )

{

BackupObject();

RECT rect;

GetClientRect( HWindow, &rect );

ret = OleActivate( lpObject , OLEVERB_PRIMARY, TRUE,

TRUE ,

HWindow , &rect );

wait ( ret, lpObject );

PostMessage( HWindow , WM_U_REDRAW, 0, 0L );

}

void TOleDocWindow::WMInitMenu( RTMessage msg )

{

HMENU hMenu = (HMENU)msg.WParam;

WORD wEnableUndo;

if ( (lpObject != lpUndoObject) &&

( lpUndoObject != NULL ))

wEnableUndo = MF_ENABLED;

else wEnableUndo = MF_GRAYED;

EnableMenuItem( hMenu, CM_UNDO ,

wEnableUndo );

EnableMenuItem( hMenu, CM_COPY ,

( bObjectLoaded ? MF_ENABLED : MF_GRAYED ));

EnableMenuItem( hMenu, CM_CUT ,

( bObjectLoaded ? MF_ENABLED : MF_GRAYED ));

ret = OleQueryCreateFromClip( “StdFileEditing”,

olerender_draw, 0 );

EnableMenuItem( hMenu, CM_PASTE ,

(( ret == OLE_OK ) ? MF_ENABLED : MF_GRAYED ));

EnableMenuItem( hMenu, CM_ACTIVATE ,

( bObjectLoaded ? MF_ENABLED : MF_GRAYED ));

EnableMenuItem( hMenu, CM_CLEAR ,

( bObjectLoaded ? MF_ENABLED : MF_GRAYED ));

DrawMenuBar( HWindow );

}

LPSTR TOleDocWindow::GetClassName() { return “OLEDOCWINDOW”; }

void TOleDocWindow::GetWindowClass(WNDCLASS _FAR &wc )

{

TWindow::GetWindowClass( wc );

wc.lpszMenuName = “MENU_DOCWINDOW”;

}

void TOleDocWindow::CMClear( RTMessage )

{

CloseCurrentOle();

}

void TOleDocWindow::CloseCurrentOle()

{

// ieii/aoaeueiia nio?aiaiea

if ( lpObject ) {

ret = OleDelete( lpObject );

wait( ret , lpObject );

}

if ( lpUndoObject ) {

ret = OleDelete( lpUndoObject );

wait( ret , lpObject );

}

lpObject = lpUndoObject = NULL;

bObjectLoaded = FALSE;

InvalidateRect( HWindow , NULL, TRUE );

UpdateWindow( HWindow );

}

void TOleApp::InitMainWindow()

{

MainWindow = new TOleDocWindow(NULL, “OWL OLE Application” );

}

int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

LPSTR lpCmd, int nCmdShow)

{

TOleApp OleApp (“OleApp”, hInstance, hPrevInstance,

lpCmd, nCmdShow);

OleApp.Run();

return (OleApp.Status);

}

Нашли опечатку? Выделите и нажмите CTRL+Enter

Похожие документы
Обсуждение

Оставить комментарий

avatar
  Подписаться  
Уведомление о
Заказать реферат
UkrReferat.com. Всі права захищені. 2000-2019