Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access/Assign in COM Object?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00481355
Message ID:
00483842
Vues:
6
I am trying to get something simple and am tripping somewhere. Can you tell me wat you did in your example that I didn't?
Define Class killthis as Custom OLEPublic

cSourceName = "SOURCENAME"

Procedure cSourceName_Assign
  Parameters cNothing
  ? This.cSourceName + "!"
  This.PlayWavAPI("c:\winnt\media\birp.wav")		
EndProc

Function Init
  lParameters cOne
  This.cSourceName = cOne
  Return .t.
EndFunc
Function Destroy
EndFunc

Function PlayWavAPI
  Parameters pcWavfile
  Declare Integer mciSendString IN WINMM String sendstr, Integer retstr, Integer szret, Integer callback
  mciSendString("open "+FullPath(pcWavfile) + " type waveaudio alias mmwav", 0, 0, 0)
  mciSendString("play mmwav wait", 0, 0, 0)
  mciSendString("close mmwav", 0, 0, 0)
  Return .t.
EndFunc
At the command window, I did:
Set Procedure to d:\wintemp\killthis
oK = CreateObject("killthis")
? oK.init("aa")
But I thought I would see "aa" as a return value but instead I get "SOURCENAME!.T.". The birp.wav is playing, so I know the Assign method is firing. Where did I goof?

Btw, I'm now checking with my social secretary for other Philly bakery options. :)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform