There's so much comedy on television. Does that cause comedy in the streets?
Probeer eens om in plaats van via die dll een shell execute van je mp3-tje te doen, om uit te sluiten dat het toch in je uiteindelijke aanroep zit. En post eens wat (relevante) code, misschien zie je wat over het hoofd.
Zo scherp als een voetbal!
Dat kan pas morgen, m'n code staat op de PC op m'n stage. Ik zal even wat code zoeken van waaruit ik dat MP3 aanroepen heb gebruikt.
There's so much comedy on television. Does that cause comedy in the streets?
Dit is een stukkie van de code (CodeProject).
Open en Play voor het initializen van de speler en het spelen:
Die roep ik dus na elkaar aan als mijn variabele 'Tick' een bepaalde waarde heeft (1 tick per seconde).
Open en Play voor het initializen van de speler en het spelen:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| public void Open(string sFileName)
{
Pcommand = "open \"" + sFileName + "\" type mpegvideo alias MediaFile";
mciSendString(Pcommand, null, 0, 0);
isOpen = true;
}
public void Play(bool loop)
{
if (isOpen)
{
Pcommand = "play MediaFile";
if (loop)
Pcommand += " REPEAT";
mciSendString(Pcommand, null, 0, 0);
}
} |
Die roep ik dus na elkaar aan als mijn variabele 'Tick' een bepaalde waarde heeft (1 tick per seconde).
There's so much comedy on television. Does that cause comedy in the streets?
Misschien moet je even de return waarde van mciSendString controleren.
Somniferous whisperings of scarlet fields. Sleep calling me and in my dreams i wander. My reality is abandoned (I traverse afar). Not a care if I never everwake.
En bij die return value pointer (2e parameter van mciSendString) kan ik gewoon een string opgeven? Ik ben niet zo'n programmeer-crack, dus vergeef me mijn noobisch vraagjes...
There's so much comedy on television. Does that cause comedy in the streets?
Van de MSDN:
Op deze pagina vind je de mogelijke (non-zero) foutcodes die je functie terugstuurt als DWORD. Kijk daar eens naar, of pass de waarde door naar mciGetErrorString en bekijk 'm als tekst.
De return-string parameter kan je volgens mij idd null laten, omdat je geen antwoord van de functie nodig hebt.
Bron: MSDN.MCIERROR mciSendString(
LPCTSTR lpszCommand,
LPTSTR lpszReturnString,
UINT cchReturn,
HANDLE hwndCallback
);
Parameters
lpszCommand
Pointer to a null-terminated string that specifies an MCI command string. For a list, see Multimedia Command Strings.
lpszReturnString
Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.
cchReturn
Size, in characters, of the return buffer specified by the lpszReturnString parameter.
hwndCallback
Handle to a callback window if the "notify" flag was specified in the command string.
Return Values
Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values.
To retrieve a text description of mciSendString return values, pass the return value to the mciGetErrorString function.
Op deze pagina vind je de mogelijke (non-zero) foutcodes die je functie terugstuurt als DWORD. Kijk daar eens naar, of pass de waarde door naar mciGetErrorString en bekijk 'm als tekst.
De return-string parameter kan je volgens mij idd null laten, omdat je geen antwoord van de functie nodig hebt.
Zo scherp als een voetbal!
Het is gelukt! Het lag aan het thread van waaruit ik het aanriep. Bedankt voor de suggesties!
There's so much comedy on television. Does that cause comedy in the streets?
Pagina: 1