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. EndFuncAt 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?