| View previous topic :: View next topic |
| Author |
Message |
DevilGilad Grandmaster Cheater
Reputation: 0
Joined: 10 May 2007 Posts: 624 Location: Delete C:\WINDOWS folder and you'll be able to see me.
|
Posted: Sat Jun 30, 2007 12:55 pm Post subject: [Help] Delphi |
|
|
I want to open with Delphi my own program (like music [mp3 for example]).
I got one button and one textbox...
I want the button do something like that:
ShellExecute(Handle, 'Open', 'C:\lol\pwnt\'+Edit1.Text+'.mp3', nil, nil, SW_SHOWNORMAL);
It tells me that there's an errors.
The errors are:
[Error] Unit1.pas(408): Incompatible types: 'String' and 'PAnsiChar'
[Fatal Error] Project1.dpr(7): Could not compile used unit 'Unit1.pas'
What do I have to do to fix this problem...?
Thx :]
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 30, 2007 12:57 pm Post subject: |
|
|
| ShellExecute(Handle, 'Open', PChar('C:\lol\pwnt\'+Edit1.Text+'.mp3'), nil, nil, SW_SHOWNORMAL);
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sat Jun 30, 2007 12:58 pm Post subject: |
|
|
| you must use .res files to open mp3 files (if you want it to be played on all computers, not only yours) else you need a Tmediaplayer component before you can play .mp3's
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 30, 2007 1:00 pm Post subject: |
|
|
Kevinnn, stop spewing nonsense. You DON'T need to embed them in your application, how do you think all media players work when you tell them to play an external mp3 file? embed it in a resource file and recompile themselves?!
Last edited by appalsap on Sat Jun 30, 2007 1:03 pm; edited 1 time in total |
|
| Back to top |
|
 |
DevilGilad Grandmaster Cheater
Reputation: 0
Joined: 10 May 2007 Posts: 624 Location: Delete C:\WINDOWS folder and you'll be able to see me.
|
Posted: Sat Jun 30, 2007 1:02 pm Post subject: |
|
|
| Kevinnn wrote: | | you must use .res files to open mp3 files (if you want it to be played on all computers, not only yours) else you need a Tmediaplayer component before you can play .mp3's |
My program installs itself on C:\ driver, so dun worry bout it...
| appalsap wrote: | | ShellExecute(Handle, 'Open', PChar('C:\lol\pwnt\'+Edit1.Text+'.mp3'), nil, nil, SW_SHOWNORMAL); |
Thx, appalsap :]
_________________
|
|
| Back to top |
|
 |
|