????? ????? ?????? ??? ?????? ??? COM + ?????? ???????? ??????

?????? ????????? ?????? ?????????
???? ???????: 246627 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

??????

?? ????? ???????? ?????? ????? ?? ??????? ????? ?????? ??? ????? ? ??????? ???? Microsoft ????? ????? ?????? ?????? (MSMQ) ??? ?? ???? ?? ?????? ??? ?? ????? ??????? ?? ????? ????????. ?? ??? ???????? ?? ????? ?????? ?????? ?????? ?????? ????????. ????? ?????? ???? ?? ???????? ???????? ?? ????? ???????? ???? ??? ????? ????? ????? ??? ???? ??????? ????? ????? ??? ????? ??????? ??????? ??? ???? ?? ??????:
  • ??? ?? ????? ?????? ????? ?????? IPersistStream. ?? Visual Basic? ??? ?? ??? ??? ????? ??? ???? "??????" ?? ??? ????? ????? Class_ReadProperties ? Class_WriteProperties ???? ????.
  • ??? ????? ??? ?????? ????? ?????? ???? ???? ??? ???? ????????? ?????? ????? ????????? ??????.
  • ???? ????? ?? ?????, ???? ?????? ????? ??? ?? ????? ???????? ?? ??? ??????? ?????? ?????? ?????? ?? ????? ?????? ?????.

??????? ????

????? ??? ???

????? ?? ??? ????? ??? ????? ?????? ?????? ?????? ?? ????? ?????? ????? ???? ?????? ?

????? ??? ????: ????? ?? ???? ??????? ????? ??????? ?????? ???? Customer.CCustomer ????. ??? ?????? ????? ?? ????? Customer.dll ????? ???????? ???????? ???????. ???? ??? ?? ??? ????? ?????? ??? ????? ??????? ????? ?? ?? ????? ????????:
'CCustomer Class. Marked as 'Persistable'
Option Explicit

Public Name As String
Public Age As Integer
Public Address As String

Private Sub Class_ReadProperties(PropBag As PropertyBag)
    Name = PropBag.ReadProperty("Name")
    Age = PropBag.ReadProperty("Age")
    Address = PropBag.ReadProperty("Address")
    MsgBox "Person read!!"
End Sub

Private Sub Class_WriteProperties(PropBag As PropertyBag)
    PropBag.WriteProperty "Name", Name
    PropBag.WriteProperty "Age", Age
    PropBag.WriteProperty "Address", Address
    MsgBox "Person Written!!"
End Sub

Private Sub Class_Initialize()
    MsgBox "CCustomer Class_Initialize"
End Sub

Private Sub Class_Terminate()
    MsgBox "CCustomer Class_Terminate"
End Sub
				
??? ????? ????? ?? ???? ??? ??? ?? ??? ??????? ????? ??????? ???????. ?? ??????? ?????? ????? ????? ??? ?????? ?????? ???? (? ?? ?????? ????? ?? Class_Initialize!).

???? ????? ?? ???? ???? ?? ?????? ?? ??? ????????? ??????. ??? ?????? ???? Orders.COrder ?? ??? ????? ???? Orders.dll ? ????? ??? ???? ???????? ????????? ???????? ???????:
Public Sub AddOrder(ByVal ItemID As Long, ByVal Amount As Double, ByVal Customer As Customer.CCustomer)
    
    MsgBox "Customer order for item '" & ItemID & "' for " & Customer.Name
    
End Sub
				
???? ?? ??????? ?????? ??????? ?????? ?? ??????? ??? ???? ???? ?? ????? Customer.CCustomer. ?????? ?? ?????? ???????? ????? ?? ??????? ?? ???? ?? ??????? ??? ??????? ????? ???????? ?? ??? ???????. ??? ???? ??? ?? ?? ???? ?? ??? ???? ????? ?? ??? ??????.

????? ?????? ???? ?? ??? ????? ????? EXE ??????. ???? ???? ?? ????? ?? ??? ????? ????????? ???????? ???????:
    Dim oOrder As COrder
    
    Dim oCust As CCustomer
    Set oCust = New CCustomer
    oCust.Name = "Eduardo A. Jezierski"
    oCust.Age = 23
    oCust.Address = "One Microsoft Way, Redmond, WA"
    
    Set oOrder = New COrder    
    oOrder.AddOrder 123, 100, oCust
    Set oOrder = Nothing
    
    Set oCust = Nothing
				
?? ????? ???? "????????" ????? ?? ???? ?? COM + ? ????? ??? ????? COM +. ??? ???? ?????? ?????? ??? ???? ??????? ??? ??????, ???? ?? ???:
  1. (??? ???? ??????? CCustomer Class_Initialize) ????? ???? CCustomer ???? ????? ??????.
  2. ??? ????? ???? COrder.
  3. ?? ????? ??????? AddOrder ?? COM + ???????.
  4. ???? ???? ????? ???? ??? "????? ??????? ?????? '123' Eduardo Jezierski ?".
  5. ????? ???? COrder.
  6. ???? ????? ???? CCustomer ????? ???? ???? ??????? CCustomer Class_Terminate ?????.

????? ?? ????? ????????

????? ???? ???? ???? ??? ????? ??? ???????? ?

??????? ???? ????? ????? ???? COrder ??? ?? ????? ????????. ???? ????? ????? ????? Microsoft ??????? ?????? ??? ???????:
246825????? ????? ????? COM + ?? ????????
??? ??? ????? ????? ?????? ???? ???????? ????? ?? ????? ????????. ?????? ????? ?? ?????? ?? ??? ??? ????? COrder ?? ??? ???:
Set o = GetObject("queue:/new:Orders.COrder")
				
??? ???? ???? ????? ???? COrder "stand-in" ???? ???? ????? ?????????? ??????? ???? ????? ??? ??? ???? COrder ???? ?? ????? COM +.

???? ???? ??????? ????. ??? ?????? ??? ??? ????? ?? ???? ???? ?????? ?????? ???? ?? ???????:
  1. ?????? ??? ????? ???? ??????? ?? ????? ??????.
  2. ??? ????? ???? ???? ?? ????? ?????? COrder ???????? ???? GetObject ?????? ??????.
  3. ?? ??????? ????? AddOrder. ???? QC ???? ???? ?? COrder ? ???? ?? ?????? ??????? ???? ?? Class_WriteProperties ??????? ?????? ???? ??????? ????? ? ?? ???? ???????? ?????? (ItemID ? ????).
  4. ??? ????? ???? ???? COrder ??? ?? ???. ??? ??? ?????? ???? ??? ??? ????????? ??????? ????? (??? AddOrder ?? ??? ??????) ?? ??? ???? ???? ?????? ??????? ???? ??????? ?? ????? ???? ?????? ??????? ?? Microsoft (MSMQ) ? ?????? ??? ??????.
  5. ?????? ?????? ?????? ?????? ?? ?? ???? ???? ?????? ??????? ?????? ????? ???.

    meanwhile...

  6. ????? ??? ????? ??????? ???? ????? ?? ??? ?????? ????? ?????? ??????? ???????.
  7. ??? ??????? ?? ?? ?????? "????????" ?????? ?????? ?? ???? ????? MSMQ ?? figures ????? ??? COrder ??? ????????? ?? ??? ???????? ?. ??? ?????? ?????? ????? ?????? ???? COrder ??? ??????.
  8. ???? ???? ??? "???????" ?? ?????. QC ???? ?????? ??????? ???????? ???? ??????? ?? ???????.
  9. ?? ??? ??????? ????? ??????? AddOrder ???. ??? ???? ????? ??? ????? ???????? ???? ??????? ? ????? ????? ???? CCustomer ? ????? ??? "?????" ???? ???? Class_ReadProperties ??????.
  10. ????? ????? ?????? ?????? ?????? ??????? ??????? AddOrder ??? ???? COrder ????? ???? ???? chores ????? ??. ???? ???? ??????? ???? ?????? ??????? ?? ????? ????? ???????? ???? ???? ??? ?????? ???????. ?? ??????? ?? ????????? ??????? ?????? ?????? ?????? ??? ?? ?????? ?????? COrder ??????? CCustomer ???????.
?? ????? ????????? ???????? COrder ??????? ??? ????? ?? ?????? ??????? ??? ?? ??????? ???? ??? ???????? ?????? ??????? ???? ?? ??????? ?? ?????? ?? ????? ?? ????? ???. ???? ???????? ??? ???????? ???? ?????? ??? ??????.

???????

???? ???????: 246627 - ????? ??? ??????: 21/???? ??????/1435 - ??????: 2.7
????? ???
  • Microsoft Visual Studio 6.0 Enterprise Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
????? ??????: 
kbnosurvey kbarchive kbmt kbcomplusqc kbhowto KB246627 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????246627

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com