Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does my code fail when using COM?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Why does my code fail when using COM?
Divers
Thread ID:
01536990
Message ID:
01536990
Vues:
79
Hi

Can anyone explain why "Do dcvfpsrvc.prg" works when I use CreateObject("dcvfpsrvc") but locks up VFP when I try CreateObject("dcvfpsrvc.dcvfpsrvc")?

I created both dcvfpsrvc.exe and dcworker.exe marked both as OLEPublic.
Public go

Set Step on

*go=CreateObject("dcvfpsrvc.dcvfpsrvc")
go=CreateObject("dcvfpsrvc")
For ln=1 to go.nWorkerCount
   go.aWorkers(ln).Test
EndFor
go.StopWorkers
go.DestroyWorkers

Return

Define Class dCVFPSrvc As Session OLEPublic


   Protected nProcessQueue,cStartin,cAppBase,dNow,nServerOffset,height,width
   Dimension aWorkers[1]
   aWorkers(1) = NULL

   Height = 63
   Width = 100
   *-- Process Task Queue Flag
   nProcessQueue = 0
   *-- The number of work COM Objects Created.
   nworkercount = Iif(Version(2)=0,2,4)
   *-- The folder from which the application was started.
   cstartin = ""
   *-- The base Directory for Customer Applications
   cappbase = ""
   *-- The time the service was run.
   dNow = Datetime()
   *-- The server's time zone offset.
   nServerOffset = ""
   
   Name = "dCVFPSrvc"
   
   *-- Creates the Worker COM Objects
   Protected PROCEDURE createworkers
      Local ln
      Dimension This.aWorkers(This.nWorkerCount)
      For ln=1 to This.nWorkerCount
         This.aWorkers(ln)=CreateObject("dcworker.dcWorker")
         This.aWorkers(ln).oMain = This
      EndFor
   ENDPROC
...
EndDefine
Simon White
dCipher Computing
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform