.

OLE VFP

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

IEIENOA?NOAI IAUAAI E I?IOANNEIIAEUeIIAI IA?ACIAAIEss ?INNEENEIE
OAAeA?AOeEE

AIEAIA?AAeNEEE AINOAeA?NOAAIIUE OAOIE*ANEEE OIEAA?NEOAO

Eaoaae?a «NAI? e IE»

Naiano?iaay ?aaioa

oaia:

«Visual FoxPro 5.0 eae OLE-ca?aa?»

Auiieiee: nooaeaiou a?oiiu AN-563

Iaooae I.I.

I?iaa?ee:

Aieaia?aae 1999a.

Niaea?aeaiea:

Visual FoxPro eae OLE-na?aa? 2

Nicaeaiea OLE-na?aa?a a Visual FoxPro 7

OLE-na?aa? a eiiiuethoa?iie naoe 11

Automation Manager 14

Remote Automation Connection Manager 15

Visual FoxPro eae OLE-na?aa?

Ia/eiay n iyoie aa?nee, Visual FoxPro iiaeao auiieiyoue ooieoeee
OLE-na?aa?a. OLE-na?aa? — yoi i?eeiaeaiea, eioi?ia iiaeao i?aaeinoaaeoue
naie iauaeou aeey oi?aaeaiey ae?oaie i?ia?aiia, iiaeaea?aeeaathuae OLE
Automation.

Yoa iiaay aiciiaeiinoue nouanoaaiii ?anoe?yao aiciiaeiinoe
eniieueciaaiey Visual FoxPro, iiyoiio inoaiiaeiny /ooue iiae?iaiaa ia
oii, /oi aea oaeia OLE-na?aa?.

Aieueoeinoai OLE-na?aa?ia yaeythony oae iacuaaaiuie na?aa?aie
Out-of-Process. Iie i?aaenoaaeytho ec naay eniieiyaiua i?ia?aiiu (oaeeu
n ?anoe?aieai AOA) e iiaoo acaeiiaeaenoaiaaoue eae n 16-bit, oae e n
32-bit OLE-eiio?ieea?aie. ?anieaoie ca yoi yaeyaony iaaunieay nei?inoue
iaiaia aeaiiuie e iio?aaeyaiua cia/eoaeueiua ?ano?nu iaiyoe. Ae?oaie oei
OLE-na?aa?a iacuaaaony In-Process e i?aaenoaaeyao ec naay
DLL-aeaeeioaeo, eioi?ay aeeiaie/anee iiaea?oaeaaony e aua?oaeaaony a
caaeneiinoe io iaiaoiaeeiinoe. Oi?ioei i?eia?ii oaeiai na?aa?a yaeyaony
i?ioeanni? aac aeaiiuo NOAAe Access 7.0. Iaiai aeaiiuie n yoei oeiii
OLE-na?aa?a i?ienoiaeeo cia/eoaeueii auno?aa, ii ?aaioaoue ii iiaeao
oieueei n OLE-eiio?ieea?ii oaeie aea ?ac?yaeiinoe.

A Visual FoxPro aeinooi e iauaeoai auiieiyaony, eae e a iiaeaaeythuai
aieueoeinoaa ae?oaeo OLE-na?aa?ia, n iiiiuueth iauaeoa aa?oiaai o?iaiy
Application. A oaae. 1 ia?a/eneaiu aai naienoaa, a a oaae. 2 — iaoiaeu.

Naienoaa Iauaeoa Application

Oaaeeoea 1.

Naienoai Ia?aiao?u e iienaiea

ActiveForm.Property

[ = Setting]

ActiveForm.Method Property – naienoai oi?iu.

Setting – cia/aiea naienoaa.

Method – iaoiae oi?iu.

Iaania/eaaao nnueeo ia aeoeaioth oi?io eee iauaeo SCREEN

AutoYield [ = IExpr ] IExpr ii oiie/aieth ?aaai .O., /oi
i?aaeoniao?eaaao i?ei?eoao niauoee Windows. Cia/aiea .F. i?aaeioa?auaao
i?a?uaaiea auiieiaiey eiaea Visual FoxPro. I?e yoii niauoey Windows
noaayony a i/a?aaeue. Ii?aaeaeyao niinia ia?aaioee niauoee Windows.

Caption [ = cText ] cText – oaeno caaieiaea.

Ii?aaeaeyao caaieiaie ieia i?eeiaeaiey.

DefaultFilePath [ = nPath ] nPath – iaicia/aiea ono?ienoao eaoaeiaa eee
iooue.

Ii?aaeaeyao eaoaeia ii oiie/aieth aeey i?eeiaeaiey.

Ii?aaeaeyao iooue e eiy oaeea aeey caionea eiiee Visual FoxPro.

Height [ = nHeight ] nHeight – aunioa ieia i?eeiaeaiey. Ii?aaeaeyao
aunioo ieia i?eeiaeaiey.

Let [ = nDist ] nDist – ?annoiyiea io eaaiai e?ay.

Ii?aaeaeyao ?aniieiaeaiea ieia i?eeiaeaiey ioiineoaeueii eaaiai e?ay.

Name [ = cName] cName – eiy iauaeoa.

Caaeaao eiy iauaeoa aeey nnueee a eiaea i?ia?aiiu.

OLERequestPendingTimeOut

[ = Nmilliseconds ] Nmilliseconds – aaee/eia caaea?aeee a
ieeeenaeoiaeao, eioi?ay ii oiie/aieth ?aaia 5000 in. Anee ia?aiao? ?aaai
0, oi niiauaiea ia iiyaeyaony.

Ii?aaeaeyao caaea?aeeo, eioi?ay i?ienoiaeeo ia?aae iiyaeaieai niiauaiey
i oii, /oi nenoaia caiyoa a i?ioeanna auiieiaiey cai?ina OLE Automation,
anee iieueciaaoaeue eniieuecoao eeaaeaoo?o eee iuoue.

OLEServerRaiseError [ = lExpression ] lExpression ii oiie/aieth ?aaai
.F. – niiauaiea ia ioeaea aoaeao iiyaeyoueny. Anee ia?aiao? ?aaai .O.,
niiauaiey aoaeao.

Ii?aaeaeyao iiyaeaiea niiauaiey ia ioeaea, eiaaea enoaeaao a?aiy,
onoaiiaeaiiia a naienoaa OLEServerBusyTimeout.

OLEServerBusyTimeout [ = Nmilliseconds ] nMilliseconds – aaee/eia
caaea?aeee a ieeeenaeoiaeao aei iiyaeaiey niiauaiey i oii, /oi na?aa?
caiyo.

Ii?aaeaeyao a?aiy, a oa/aiea eioi?iai i?ienoiaeeo iiaoi?iia auiieiaiea
cai?ina OLE Automation, anee na?aa? caiyo.

StartMode Aica?auaao /enei, eaeaioeoeoee?othuaa oei caioneaaiiai
i?eeiaeaiey.

StatusBar [ = cMessageText ] cMessageText – no?iea niiauaiey.
Ii?aaeaeyao oaeno a noaoon – no?iea i?eeiaeaiey.

Top [ = nDist ] nDist — ?annoiyiea io aa?oiaai e?ay.

Ii?aaeaeyao ?aniieiaeaiea ieia i?eeiaeaiey ioiineoaeueii aa?oiaai e?ay.

Version Aica?auaao a aeaea no?iee neiaieia iiia? aa?nee caioneaaiiai
i?eeiaeaiey.

Visible [ = lExpr ] lExpr ii oiie/aieth ?aaai .F., o. a. caioneaaiay
eiiey i?eeiaeaiey iaaeaeeia. Anee ia?aiao? lExpr ?aaai .O. – i?eeiaeaiea
noaiiaeony aeaeeiui.

Ii?aaeaeyao, aoaeao ee caioneaaiay eiiey i?eeiaeaiey aeaeeia.

Width [ = nWidth ] nWidth — oe?eia ieia i?eeiaeaiey. Ii?aaeaeyao oe?eio
ieia i?eeiaeaiey.

Iaoiaeu Iauaeoa Application

Oaaeeoea 1.

Iaoiae Ia?aiao?u e iienaiea

DataToClip ([ nWorkArea | cTableAlias ] [, nRecords ] [, nClipFormat])
nWorkArea, cTabieAlias — ?aai/ay iaeanoue eee inaaaeiiei enoi/ieea
aeaiiuo.

nRecords — /enei eiie?oaiuo caienae. uClipFormat ii oiie/aieth ?aaai 1,
i?e yoii aeaiiua iieae ?acaeaeythony i?iaaeaie. Anee ia?aiao? ?aaai 3,
aeaiiua ?acaeaeythony ciaeii oaaoeyoeee.

Eiie?oao caiene a aooa? iaiaia a aeaea oaenoa, a eioi?ii eaaeaeay
caienue caieiaao ioaeaeueioth no?ieo.

DoCmd (cCommand) cCommand – au?aaeaiea, i?aaenoaaeythuaa eiiaiaeo VFP.

Iicaieyao auiieieoue eiiaiaeo Visual FoxPro ec i?eeiaeaiey yaeythuaainy
OLE-eiio?ieea?ii.

Eval (cExpression) cExpression – au?aaeaiea, eioi?ia iaiaoiaeeii
i?aia?aciaaoue.

I?aia?acoao au?aaeaiey e aica?auaao aai a Visual FoxPro.

Help ([cFileName] [, nContexId] [, cHelpTopic]) cFileName – eiy e iooue
e oaeeo iia?aoeaiie iiiiue. NContextID – eaeaioeoeeaoi? ?acaeaea.
cHelpTopic – oaia ?acaeaea.

Ioe?uaaao ieii n eiioaenoiie ni?aaeie.

Quit() Cae?uaaao caiouaiioth eiieth i?eeiaeaiey Visual FoxPro.

RequestData ([nWorkArea | cTableAlias] [, nRecords]) nWorkArea,
cTableAlias – ?aai/ay iaeanoue eee inaaaeiiei enoi/ieea aeaiiuo.
nRecords – /enei eiie?oaiuo caienae.

Nicaeaao iannea n aeaiiuie ec enoi/ieea aeaiiuo Visual FoxPro.

Aeey nnueee ia iauaeo Application iiaeii eniieueciaaoue nenoaiioth
ia?aiaiioth _VFP.

Visual FoxPro 5.0 eiaao neaaeothuea eieeaeoeee, eioi?ua annioeee?othony
n iauaeoii Application:

Forms — oi?iu;

Objects — iauaeou;

Controls — yeaiaiou oi?aaeaiey;

Pages — no?aieoeu;

Buttons — eiiiee;

Columns — eieiiee.

I?e yoii ia?aoeoa aieiaiea, /oi yoe eieeaeoeee yaeythony eieeaeoeeyie
eneeth/eoaeueii OLE-iauaeoia e iiaoo eniieueciaaoueny oieueei n iauaeoii
Application. E yoei eieeaeoeeyi iaeuecy ia?auaoueny, eniieuecoy
annioeee?iaaiiua ia?aiaiiua n aeeth/aiiuie a ieo iauaeoaie. Au aeieaeiu
eniieueciaaoue naienoai Application, eae yoi iieacaii ieaea:

oFrm = CREATEOBJECT( ‘Form’)

? oFrm.Application.Forms[1].Controls.Count

Anee au oaea ienaee i?ia?aiiu a Visual FoxPro 3.0, oi i?eaaaeaiiia auoa
ooaa?aeaeaiea iiaeao aucaaoue iaeioi?ia oaeeaeaiea. Ia?a/eneaiiua
eieeaeoeee auee i?aaenoaaeaiu e a o?aoueae aa?nee, yoi aeaenoaeoaeueii
oae. Ii, oae eae Visual FoxPro 3.0 ia iia auiieiyoue ooieoeee
OLE-na?aa?a, oi yoe eieeaeoeee ia ioaa/aee iauai?eiyoui noaiaea?oai OLE.
A ia?aoth i/a?aaeue ca n/ao oiai, /oi eo naienoaa auee aeinooiiu aeey
eciaiaiey. Yoi oaeiaii, anee iu ?aaioaai n iaeiei i?eeiaeaieai.
Ii-i?aaeiaio iai ieeoi ia iaoaao i?iaeieaeaoue eniieueciaaoue yoe
aiciiaeiinoe. Ii, eae oieueei iu ia/eiaai eniieueciaaoue i?eeiaeaiea eae
OLE-na?aa?, o. a. ia?auaainy e iaio ec ae?oaiai i?eeiaeaiey, oi aeieaeiu
eniieueciaaoue iauaeou Visual FoxPro eae OLE-eieeaeoeee.

Iai?eia?, ie/oi ia iaoaao iai i?e nicaeaiee oi?iu a Visual FoxPro
iaienaoue oaeie eiae:

Frm = CREATEOBJECT (‘Form’ )

? oFrm.ControlCount &&*enei yeaiaioia oi?aaeaiey a oi?ia

Aeey OLE-na?aa?a /enei yeaiaioia oi?aaeaiey a oi?ia neaaeoao
ii?aaeaeyoue oae, eae yoi auei iieacaii a i?aaeuaeouai i?eia?a, n
eniieueciaaieai naienoaa Count.

Nicaeaiea OLE-na?aa?a a Visual FoxPro

Eniieuecoy Visual FoxPro 5.0, iiaeii nicaeaoue OLE-na?aa?,
ooieoeeiiaeueiinoue eioi?iai aoaeao eniieueciaaia ianeieueeeie
i?eeiaeaieyie.

Aeey nicaeaiey OLE-na?aa?a eniieuecoaiua a iai eeannu aeieaeiu auoue
iienaiu eae OLE Public, o. a. aeinooiiua aeey OLE Automation. Aeey yoiai
a eiiaiaeo DEFINE CLASS aeeth/aia iiaay iioeey OLEPUBLIC. Anee eeann
nicaeaaony a Eiino?oeoi?a eeannia, iaiaoiaeeii eniieueciaaoue
niioaaonoaothuee iacaaeneiue ia?aeeth/aoue a aeeaeiaiaii ieia Class
Info. Ioiaoea eeanna eae OLE Public iicaieyao Project Manager i?e
iino?iaiee i?eeiaeaiey nicaeaaaoue e ?aaeno?e?iaaoue aeaiiue eeann eae
ILA-na?aa? e eioi?iio aeieaeai iieo/eoue aeinooi OLE-eiio?ieea?.

A Visual FoxPro au iiaeaoa nicaeaoue eae In-Process na?aa? (DLL), oae e
Out-of-Process na?aa? (AOA). Iaa oeia na?aa?a i?e ?aaioa eniieuecotho
aeaeeioaeo iiaeaea?aeee i?eeiaeaiee Visual FoxPro (runtime), iaeiaei
nouanoaaiii ioeeaathony a eniieueciaaiee iaiyoe.

Na?aa? AOA caioneaaony a nianoaaiiii aae?aniii i?ino?ainoaa, e a yoii
ieaia aai caione ie/ai ia ioee/aaony io caionea eiiee Visual FoxPro.

Na?aa? DLL eniieuecoao aae?aniia i?ino?ainoai oiai i?eeiaeaiey, eioi?ia
eieoeee?iaaei aai caione. Iiyoiio ii caioneaaony e ?aaioaao auno?aa.
Anoanoaaiii no?aieaiea eniieueciaaoue a ia?aoth i/a?aaeue eiaiii oaeie
oei na?aa?a, iaeiaei ia anaaaea iu iiaeai oae iinooieoue. Na?aa? DLL ia
iiaeao eniieueciaaoueny eae aiaoiee na?aa? OLE Automation e, oaeei
ia?acii, aeieaeai iaoiaeeoueny ia eieaeueiii eiiiuethoa?a. Ii ia
iiaeaea?aeeaaao niauoey, o. a. ia iiaeao eniieueciaaoueny aeey
eioa?aeoeaiie ?aaiou. Neaaeoao oaeaea o/eouaaoue, /oi aaa?ey na?aa?a
DLL, eae i?aaeei, aea/ao aaa?eth oi?aaeythuae i?ia?aiiu.

Na?aa? AOA eiaao aua iaeii i?aeiouanoai. Ii iiaeao auiieiyoue ?ieue
OLE-na?aa?a e iau/iiai i?eeiaeaiey Visual FoxPro. Oaeei ia?acii, anee
i?eeiaeaiea-eiio?ieea? eniieuecoao na?aa? aeey auiieiaiey i?ioeanna,
eioi?ue iiaeao auoue aanueia ?ano?niaieei, ii auiieiyaony eieaeueii ia
yoii na?aa?a, iu iieo/ei auea?uo a i?iecaiaeeoaeueiinoe.

Iieaaeai i?inoaeoee i?eia? nicaeaiey OLE-na?aa?a Visual FoxPro.
Nicaeaaeei iiaue i?iaeo Ole_serv, a eioi?ii aoaeao iaeei i?ia?aiiiue
oaee ni neaaeothuei eiaeii:

DEFINE CLASS OLE_SERV AS CUSTOM OLEPUBLIC

PROCEDURE INIT

MESSAGEBOX(PROGRAM(), “?AAIOAAO IIE IA?AUE OLE-SERVER”)

ENDDEFINE

Iaaeiai eiiieo Build e nicaeaaeei EXE- eee DLL-oaee. Anee au
aieiaoaeueii neaaeeee ca niiauaieyie iiyaeythueieny a i?ioeanna
iino?iaiey oaeea, oi iaaa?iyea caiaoeee niiauaiea «Creating Type Library
and Registering OLE Server», eioi?ia naeaeaoaeuenoaoao i nicaeaiee e
?aaeno?aoeee iaoae i?ia?aiiu eae OLE-na?aa?a. Iaiiiiei, /oi yoi
i?iecioei ec-ca iaee/ey iioeee OLEPUBLIC a eiiaiaea iienaiey eeanna.

I?e iino?iaiee OLE-na?aa?a (OLE_SER.EXE eee OLE_SER.DLL) nicaeathony
oaeeu OLE_SERV.TLB e OLE_SERV.VBR.

Oaee TLB — yoi aeaeeioaea OLE-o6uaeoia na?aa?a, eioi?ay iiaeao auoue
i?iniio?aia n iiiiuueth Visual FoxPro Class Browser, Excel, Visual Basic
e Visual C. Oaee VBR – yoi oaenoiaue oaee n aeaiiuie aeey caiene a
?aaeno?a Windows.

Oaia?ue iiaeii iaa?aoue a eiiaiaeiii ieia neaaeothuoth no?i/eo:

oObj = CREATEOBJECT(“OLE_SERV.OLE_SERV”)

Iinea iai?iaeieaeeoaeueiiai iaeeaeaiey, o?aaothuaainy aeey caa?ocee
na?aa?a au oaeaeeoa ieii n caaieiaeii «?aaioaao iie ia?aue OLE-na?aa?!»
e niiauaieai n eiaiai auiieiyaiie a aeaiiue iiiaio i?ioeaaeo?u – Init.

Oioy iao OLE-na?aa? ia auiieiyao ieeaeie iieaciie ?aaiou,
naeaeaoaeuenoaii aai aeoeaiinoe iiaoo neoaeeoue neaaeothuea co?i/ee:

? oObj.Application.Name

? oObj.Application.Visible

? TYPE(“oObj”)

? oObj.Application.Docmd(“MESSACEBOX(HOME())”)

? oObj.Application.Docmd(“_ClipText=HOME()+SYS(2003)+ SYS(2004)”)

Ia?aoeoa aieiaiea ia iineaaeithth no?ieo i?eia?a. Iia caienuaaao a aooa?
iaiaia iooue e OLE-na?aa?o n iiiiuueth o?ao ooieoeee. Iai?eia?, yoi
iiaeao auoue no?iea: D\WORKS\VFP5_SAMPLE\. A iaoai i?eia?a iia aoaeao
iiaoi?aia o?e ?aca. Yoi naeaeaoaeuenoaoao i oii, /oi OLE ia/eiaao iiene
na?aa?a n eaoaeiaa SYSOAI IN Windows.

Oaeei ia?acii, i?e ?ani?ino?aiaiee i?eeiaeaiey e onoaiiaea na?aa?a ia
?acee/iuo eiiiuethoa?ao a ?acee/iuo eaoaeiaao, iu iiaeai noieeiooueny n
i?iaeaiie oeacaiey iooe eae e na?aa?o, oae e eniieuecoaiui ei
eiiiiiaioai (oaeeai aacu aeaiiuo, oi?i, io/aoia e o. ae.). Eo/oaa
?aoaiea – yoi eniieueciaaiea aeey na?aa?a AOA-ooieoeee Windows API
GetModuleFileName(), eioi?ay aica?auaao iieiue iooue e aeaaiiio oaeeo
AOA oaeouaai i?ioeanna, anee a ea/anoaa ia?aiai ia?aiao?a ia?aaeaaony
ioeue. Aeey na?aa?a DLL iiaeii eniieueciaaoue ooieoeeth GetModuleHandleQ
n eiaiai oaeea DLL a ea/anoaa ia?aiao?a aeey aica?auaiey oeacaoaey ia
na?aa?. Yoio oeacaoaeue iiaeii eniieueciaaoue a ooieoeee
GetModuleFileName() aeey iieo/aiey iieiiai iooe e na?aa?o DLL.

Naeaeaai aua ianeieueei caia/aiee ian/ao iino?iaiey OLE-na?aa?a.
Auaa?eoa eiiaiaeo Project Info ec iaith Project, eiaaea ioe?uo
iineaaeiee ianoaeaeaaiue i?iaeo, ea iiyaeaoainy aeeaeiaiaii ieia
ia?aeaeeoa ia aeeaaeeo Servers. Ia yoie aeeaaeea nin?aaeioi/aia
eioi?iaoeey, eioi?oth au iiaeaoa i?iniio?aoue eee eciaieoue aeey
eaaeaeiai eeanna OLE Public a i?iaeoa. Ia?aoeoa aieiaiea, /oi yoa
eioi?iaoeey iiyaeyaony oieueei iinea oiai, eae aoaeao iino?iai EXE- eee
DLL-oaee.

?ane?uaathueeny nienie Instancing iicaieyao oeacaoue, eae aoaeao
?aaioaoue na?aa? Out-of-Process. Aiciiaeiua onoaiiaee i?eaaaeaiu a oaae.
3.

Aiciiaeiua ?aaeeiu ?aaiou OLE-na?aa?a Visual FoxPro

Oaaeeoea 3.

Single Use Eaaeaeue eeeaio eniieuecoao naith nianoaaiioth eiieth
na?aa?a. Oaeei ia?acii aeey ianeieueeeo iieueciaaoaeae aoaeao caiouaii
niioaaonoaothuea eiee/anoai eiiee na?aa?a.

Multiple Use Ana eeeaiou eniieuecotho iaeio eiieth na?aa?a. Aeey oiai,
/oiau ecaaaeaoue eo acaeiiiai aeeyiey i?e ?aaioa n iaueie aeaiiuie,
neaaeoao onoaiiaeoue cia/aiea naienoaa DataSession ?aaiui 2 (private).

Not Creatable I?aaeioa?auaao nicaeaiea OLE-na?aa?a, ianiio?y ia iaee/ea
a i?iaeoa eeanna OLE Public.

OLE-na?aa? Visual FoxPro ?aaeno?e?oaony aaoiiaoe/anee. Aeey ?o/iie
?aaeno?aoeee na?aa?a AOA aeinoaoi/ii aai caionoeoue n iioeeae
/regserver. Iioeey /unregserver iicaieyao oaeaeeoue eioi?iaoeeth i
na?aa?a ec ?aaeno?a Windows. Aeey ?aaeno?aoeee na?aa?a DLL a?o/ioth
caionoeoa ooeeeoo REGSVR32.EXE n eiaiai oaeea a ea/anoaa ia?aiai
ia?aiao?a. Oaeaeeoue eioi?iaoeeth i na?aa?a ec ?aaeno?a iiaeii,
eniieueciaaa aoi?ie ia?aiao? /u. Iai?eia?:

REGSVR32 OLE_SERV.DLL /u

OLE-na?aa? Visual FoxPro aeey naiae ?aaiou o?aaoao i?enoonoaey
aeaeeioaee iiaeaea?aeee – oaeeia VFP500.DLL e VFP5ENU.DLL.

OLE-na?aa? a eiiiuethoa?iie naoe

I?e eieeaeoeaiia ?aaioa n aeaiiuie OLE-na?aa? aeieaeai ia?aaaouaaoue
auciau anao iieueciaaoaeae eiiiuethoa?iie naoe e, neaaeiaaoaeueii,
aeieaeai iaoiaeeoueny ia na?aa?a, a ia ia eaaeaeii eiiiuethoa?u
iieueciaaoaey. Oaeie iiaeoiae iicaieyao i?aaieciaaoue o?aoo?iaiaaoth
iiaeaeue ia?aaioee aeaiiuo. Yoa iiaeaeue ioee/aaony io o?aaeeoeeiiiie
iiaeaee eeeaio-na?aa?, o. e. ioia?aaeaao ia i?inoi oece/aneia acaeiiia –
?aniieiaeaiea iieueciaaoaey e i?ia?aiiu, a eiaeeo ia?aaioee aeaiiuo. A
o?aoo?iaiaaie iiaeaee auaeaeytho neaaeothuea eiae/aneea i?ioeannu:

Iieueciaaoaeueneee i?ioeann — i?aaenoaaeyao aiciiaeiinoue ?aaiou n
aeaiiuie iieueciaaoaeth i?eeiaeaiey, iaania/eaaao caueoo aeaiiuo io
ianaieoeeiie?iaaiiiai aeinooia.

Aecian-i?ioeann — iaania/eaaao aaeeiua i?aaeea ?aaiou n aeaiiuie n oi/ee
c?aiey oaoiieiaee i?iecaiaenoaaiiiai i?ioeanna, aaia?e?oao
eioi?iaoeeiiioth iiaeaea?aeeo ia?eaoeiaa e iaiaaeaeiaioa.

I?ioeann ia?aaioee aeaiiuo — iaania/eaaao iienaiea e o?aiaiea aeaiiuo
ia?aaioeo e auiieiaiea cai?inia, iiaeaea?aeeo oeaeinoiinoe aeaiiuo.

Oaeei ia?acii, a yoie eiae/aneie iiaeaee aecian-i?ioeann iiaeao auoue
?aaeciaai ia iniiaa OLE-na?aa?a, a eioi?ii n iiiiuueth niioaaonoaothueo
iaoiaeia aoaeao i?aaieciaaia ia?aaioea aeaiiuo, iinueaaiuo io eeeaioneeo
i?eeiaeaiee n oeaeueth auiieiaiey eiiieaeniuo ?an/aoia ia iniiaa
?acee/iuo enoi/ieeia, e au?aaioee eaeeo-eeai ?aoaiee aeey aeaeueiaeoae
ia?aaioee.

Aiciiaeiinoue acaeiiaeaenoaey iaaeaeo OLE-eiio?ieea?ii e OLE-na?aa?ii
iaania/eaaaony aeaoiy iauaeoaie:

Proxy — iaania/eaaao oi?ie?iaaiea iaeaoa aeaiiuo n ia?aiao?aie auciaa
aeey OLE-na?aa?a. Yoio iauaeo ?aaioaao a aae?aniii i?ino?ainoaa
OLE-eiio?ieea?a e iaania/eaaao niaaeeiaiea n niioaaonoaothuei iauaeoii
Stub a aae?aniii i?ino?ainoaa OLE-na?aa?a.

Stub — i?eieiaao iaeao aeaiiuo e iaania/eaaao ia?aaae?anaoeeth auciaa
aeey auiieiaiey niioaaonoaothueo aeaenoaee ia OLE-na?aa?a. Yoio iauaeo
?aaioaao a aae?aniii i?ino?ainoaa OLE-na?aa?a e naycai n
niioaaonoaothuei iauaeoii Proxy a aae?aniii i?ino?ainoaa
OLE-eiio?ieea?a.

I?e ?aaioa OLE Automation ia iaeiii eiiiuethoa?a ooieoeeiie?iaaiea
iauaeoia Proxy e Stub iaania/eaaaony nenoaiiui oaeeii OLEAUT32.DLL

Anee OLE-eiio?ieea? e OLE-na?aa? ?aniieiaeaiu ia ?aciuo eiiiuethoa?ao,
aeey iaania/aiey nayce iaaeaeo ieie iaiaoiaeeii eniieueciaaoue
aeiiieieoaeueiue eiiiiiaio, eioi?ue iacuaaaony Automation Manager (oaee
AUTMGR32.EXE). Yoio eiiiiiaio aeieaeai auoue onoaiiaeai ia iaieo
eiiiuethoa?ao.

OLE-eiio?ieea? i?iaeieaeaao eniieueciaaoue iauaeo Proxy, ii a yoii
neo/aa aai ooieoeeiie?iaaiea iaania/eaaaony oaeeii AUTPRX32.DLL. Ia
eiiiuethoa?a n aiaoiei OLE-na?aa?ii Automation Manager oi?aaeyao eae
iauaeoii Stub aeey iieo/aiey iaeaoia aeaiiuo io OLE-eiio?ieea?a, oae e
iauaeoii Proxy aeey eieoaoeee iaee/ey OLE-eiio?ieea?a ia yoii
eiiiuethoa?a. Oaeei ia?acii aeey OLE-cepaa?a nicaeathony ana oneiaey,
/oiau ii ia iuouae «iaeeii/anoaa» io ionoonoaey OLE-eiio?ieea?a ia oii
aea naiii eiiiuethoa?a,

Na?aa? OLE Visual FoxPro 5.0 iiaeaea?aeeaaao ia?aoiua nayce. Au iiaeaoa
eniieueciaaoue iaoiae ia na?aa?a, eioi?ue aoaeao iieo/aoue nnueeo ia
iauaeo io OLE-eiio?ieea?a eae iaeei ec ia?aiao?ia. Yoa aiciiaeiinoue
iicaieyao onoaiaaeeaaoue aneio?iiioth naycue n na?aa?ii, anee yoa naycue
ia iiaeao auoue onoaiiaeaia iaiaaeeaiii ii i?e/eia auiieiaiey na?aa?ii
eaeiai-oi aeeeoaeueiiai i?ioeanna.

A yoii neo/aa ia na?aa?a, eioi?ue aoaeao, iai?eia?, iacuaaoueny
Processor (a ?aaeno? Windows — MyServer.Processor) aeieaeai auoue iienai
eeann:

DEFINE CLASS Processor AS Custom OLEPUBLIC

oObjRef = “”

PROCEDURE SetupRef (oRef)

This.oObjRef = oRef

ENDPROC

PROCEDURE DoCallBack

This.oObjRef.Notify ()

ENDPROC

ENDDEFINE

A eeeaioneii i?eeiaeaiee caieoai:

oObjl = CREATEOBJECT (“Job”)

o0bj2 – CREATEOBJECT (“MyServer .Processor”)

o0bj2 . SetUpRef ( oObjl)

DEFINE CLASS Job AS Custom

PROCEDURE Notify

= MESSAGEBOX (“Caaeaiea auiieiaii!”)

ENDPROC

ENDDEFINE

Eae oieueei ia na?aa?a aucuaaaony iaoiae DoCallBack, neaaeoao auiieiaiea
iaoiaea Notify iauaeoa eeeaioneiai i?eeiaeaiey.

Anee naycue n OLE-na?aa?ii i?ienoiaeeo ii eiiiuethoa?iie naoe oi ia
eiiiuethoa?a eeeaioneiai i?eeiaeaiey aeieaeai auoue onoaiiaeth
Automation Manager.

Ia?aiia/aeueii Automation Manager e Remote Automation Manager auee
?ac?aaioaiu aeey Visual Basic 4.0 e a aeaeueiaeoai eniieueciaaiu a
Visual FoxPro 5.0 aeey ?anoe?aiey ooieoeeiiaeueiinoe a iaeanoe
?ac?aaioee e?oiiuo i?iaeoia i?e eieeaeoeaiie ?aaioa n aeaiiuie.

Automation Manager

Automation Manager ?aaioaao a oiiiaii ?aaeeia, o. e. aai iniiaiia
i?aaeiacia/aiea caeeth/aaony a oi?aaeaiee i?ioeannii OLE Automation a
naoe iooai aiaoieo i?ioeaaeo?iuo auciaia. Eae ioia/aeinue auoa, yoe
auciau oi?ie?othony ca n/ao acaeiiaeaenoaey iaaeaeo iauaeoaie OLE Proxy
e OLE Stub. Aac ieo au ia niiaeaoa nicaeaoue aiaoiee OLE-na?aa?.

Automation Manager onoaiaaeeaaaony ia na?aa?a e ?ani?aaeaeyao auciau io
iauaeoa Proxy ?aai/ae noaioeee e niioaaonoaothuaio iauaeoo Stub na?aa?a.
Aica?auaaiua cia/aiey Automation Manager iai?aaeyao OLE-eiio?ieea?o
/a?ac iauaeo Stub. Ca N/ao yoiai ie OLE-eiio?ieea?, ie OLE-na?aa? ia
/oanoaotho, /oi ?aniieiaeaiu ia ?aciuo eiiiuethoa?ao.

A aieueoeinoaa neo/aaa aeinoaoi/ii onoaiiaee Automation Manager ia
na?aa?a. Iaeiaei, anee i?eeiaeaiea i?aaeoniao?eaaao iaee/ea «ia?aoiie
nayce» io OLE-na?aa?a, iaiaoiaeeia onoaiiaea Automation Manager e ia
eeeaioneee eiiiuethoa?. Iau/ii caione Automation Manager i?ienoiaeeo
aaoiiaoe/anee, eae oieueei nenoaia iaia?oaeeaaao a yoii iaiaoiaeeiinoue.
Anee yoiai ia i?iecioei, iaeia ec iaeaieaa aiciiaeiuo i?e/ei —
iia?aaeaeaiea eee iai?aaeeueiay caienue a ?aaeno?a Windows.

A neo/aa iaiaoiaeeiinoe iaiin?aaenoaaiii ec Visual FoxPro
ca?aaeno?e?iaaoue Automation Manager iiaeii neaaeothuae eiiaiaeie:

RUN /n c:\vfp\autmgr32.exe /regserver

Onoaiiaee Automation Manager a ?aaeno?a Windows eiatho neaaeothuaa
?aniieiaeaiea:

HKEY_LOCAL_MACHINE\Software\Microsoft\Automation Manager/

Remote Automation Connection Manager

Remote Automation Connection Manager (RACMan) iaienai ia Visual Basic
4.0 e iiyoiio aeey ?aaiou o?aaoao iaee/ey aeaeeioaee iiaeaea?aeee Visual
Basic. Aai iniiaiia iacia/aiea caeeth/aaony a oi?aaeaiee caienyie
?aaeno?a Windows, eioi?ua aeeth/atho iaiaoiaeeiua naaaeaiey aeey
aiaoiaai niaaeeiaiey ni noi?iiu eeeaioa e aeinooia eeeaioa ia na?aa?a.
RACMan o?aaoao ?aaeno?aoeee na?aa?a ia eeeaioneii eiiiuethoa?a, iiyoiio
i?e onoaiiaea i?eeiaeaiey iio?aaoaony oaee CLIREG32.EXE, eioi?ue
ia?aienuaaaony aaoiiaoe/anee, anee au eniieuecoaoa Setup Wizard. I?e
caionea i?ia?aiia CLIREG32.EXE o?aaoao ianeieueeeo ia?aiao?ia, a oii
/enea: eiy oaeea n ?anoe?aieai VBR, eioi?ue aaia?e?oaony aaoiiaoe/anee
i?e nicaeaiee OLE-na?aa?a, naoaaia eiy eiiiuethoa?a, naoaaie i?ioieie e
ia?aiao?u aeinooia iieueciaaoaey. I?e yoii oieueei ia?aue ec oeacaiiuo
ia?aiao?ia yaeyaony iaycaoaeueiui.

Oaeei ia?acii, RACMan iaania/eaaao aeaa ooieoeee:

Aiaoiaa niaaeeiaiea ia eiiiuethoa?a eeeaioa. Iieueciaaoaeue iiaeao
eciaieoue na?aa?, eioi?ue oaea ca?aaeno?e?iaai ia aai eiiiuethoa?a, e
ca?aaeno?e?iaaoue iiaue OLE-na?aa?.

Aeinooi eeeaioa e na?aa?o. Na?aa? iiaeao ii?aaeaeyoue aiciiaeiinoue
aeinooia eeeaioa eae n eniieueciaaieai eiaie eiiiuethoa?a, oae e eiaie
iieueciaaoaey. I?e yoii aeey Windows NT iaania/eaaaony eioaa?e?iaaiiay
aaoi?ecaoeey aeinooia.

Onoaiiaee aeey aiaoiaai OLE-na?aa?a caienuaathony a ?aaeno?a Windows
aeey aeaiiiai na?aa?a n eeth/ii CLSID a HKEY_CLASSES__ROOT.

I?eaaaeai i?eia? eniieueciaaiey OLE-na?aa?a a eiiiuethoa?iie naoe aeey
auiieiaiey ?an/aoia n aeaiiuie oaaeeoeu, o?aiyuaeny ia oaee-na?aa?a.
Auiieiei iineaaeiaaoaeueii neaaeothuea aeaenoaey:

1. Aeey nicaeaiey OLE-na?aa?a iaieoai neaaeothuoth i?ia?aiio:

*1*’Nicaeaai iiaeeeann ec aaciaiai eeanna Custom

*!* ‘Eeth/aaia neiai OLEPUBLIC iaycaoaeueii

*1* ‘Eiaiii iii e iicaieyao naeaeaoue iao iauaeo OLE-iauaeoii

DEFINE CLASS Sum_table AS CUSTOM OLEPUBLIC

* Naienoai, eioi?ia caiiieiaao cia/aiea noiiu

Sum_paid = I

* Iaoiae aeey ?an/aoa noiiu

PROCEDURE Proc Summary

PARAMETERS What

S3T EXCLUSIVE OFF

SELECT SUM (lnv_details.price*lnv_aetails .quantity) AS sum ;

FROM N :\OFFICE4\DATABASE\ Invoices, ;

C: \OFFICE4\DATABASE\lnv_details ;

WHERE Invoices .kod_id = lnv_deta-ils.kod_id ;

AND Invoices .paid = What ;

INTO CURSOR cur_sum

**”* Aica?auaaiia cia/aiea

SELECT cur_sum

THIS. Sum_paid = cur_sum .sum

USE IN cur_sum

END PROC

ENDDEFINE

Yoa i?ia?aiia aoaeao n/eoaoue noiio auienaiiuo n/aoia. A caaeneiinoe io
cia/aiey ia?aaeaaaaiiai ia?aiao?a aoaeao n/eoaoueny noiia ii anai n/aoai
eee oieueei ii iiea/aiiui.

A i?iaeoa iaaeiai eiiieo Build, uaeue iai iuoeie ia caaeneiii
ia?aeeth/aoaea Build Executable e neiiieee?oai AOA-oaee OLE-na?aa?a n
eiaiai Ole_sum. Iaiiiiei, /oi iai o?aaoaony eiaiii yoio oei na?aa?a,
anee iu niae?aainy eniieueciaaoue aai a naoe.

Ca?aaeno?e?oai nicaeaiiue na?aa? ia oaee-na?aa?a, auiieiea neaaeothuoth
eiiaiaeo:

REGSVR32 C:\OFFICE4\OLE_SUM.EXE

4. Caionoei Remote Automation Connection Manager, auaa?ai a nienea NII
Classes iao eeann e onoaiiaei o?aaoaiua ia?aiao?u aeinooia.

He caaoaeueoa oaaaeeoueny, /oi ia aeeaaeea Client Access iacaaeneiue
ia?aeeth/aoaeue Allow Remote Activation aeeth/ai.

5. Neiie?oeoa oaee OLE_SUM.VBR ia eieaeueiue eiiiuethoa?.

6. Ca?aaeno?e?oeoa ia eieaeueiii eiiiuethoa?a OLE-na?aa?, eniieuecoy
eioi?iaoeeth, niaea?aeauothny a oaeea VBR. Aeey yoiai iaiaoiaeeii
auiieieoue neaaeothuoth eiiaiaeo:

C:\VFP\CLIREG32 N \VFP\OLE_SUM.VBR

Ia ye?aia iiyaeony aeeaeiaiaia ieii, a eioi?ii iaiaoiaeeii oeacaoue
naoaaia eiy oaee-na?aa?a

7. Ia na?aa?a e eieaeueiii eiiiuethoa?a caionoeoa Automation Manager.

8. Ia eieaeueiii eiiiuethoa?a caionoeoa Visual FoxPro e iaaa?eoa a ieia
Command neaaeothuea eiiaiaeu:

oSum = CREATEOBJECT(“ole_sum.sum_table”)

oSum.ProcSuitmiary(.T.)

? oSum.Sum_paid

oSum.?rinSummary(.F.)

?oSum.Sum_paid

Ia ye?aia au oaeaeeoa iieo/aiiue ?acoeueoao.

Oe?ieea aiciiaeiinoe eniieueciaaiey OLE-na?aa?a Visual FoxPro
caeeth/athony a oi?aaeaiee ei ec ethaie ae?oaie i?ia?aiiu,
iiaeaea?aeeaathuae OLE Automation. Iai?eia?, oa aea aeaenoaey iu iiaeai
auiieieoue ec Excel, eniieuecoy neaaeothuoth i?ioeaaeo?o:

Sub mysub()

Dim sum_obj As Object

Set sum_obj = CreateObject(“ole_sum.sum_table”)

sum_obj.ProcSummary True

Sheets(“Eeno1”).Cells(1,1).Value = sum_obj.Sum_paid

End Sub

I?ioeaaeo?a iiianoeo cia/aiea noiiu a ia?aoth y/aeeo ia ia?aue eeno
Excel. Yoio i?inoaeoee i?eia? iaaeyaeii iieacuaaao aiciiaeiinoe
OLE-na?aa?a Visual FoxPro, eioi?ue iiaeao ea?aoue ?ieue na?aa?a aeaiiuo
a iaaieueoie eiiiuethoa?iie naoe, oai, aaea ia o?aaoaony any iiuue oaeeo
na?aa?ia AAe, eae SQL Server eee Oracle.

PAGE

– PAGE 18 –

Похожие документы
Обсуждение
    Заказать реферат
    UkrReferat.com. Всі права захищені. 2000-2019