BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Playing a mp3 via mciSendString from Resource ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Oren Halvani
Guest





PostPosted: Tue Sep 12, 2006 4:28 pm    Post subject: Playing a mp3 via mciSendString from Resource ? Reply with quote



dear builders,

can someone tell me if it's possible to use mciSendString
for playing a MP3 from resource that is build-in the application ??


thanks for any hint on this...



Oren

/*******************************************************/
void __fastcall TfrmMainUnit::Button1Click(TObject *Sender)
{
mciSendString( "play MP3_FROM_RESOURCE", NULL, 0, NULL);
}
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Sep 12, 2006 10:01 pm    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote



"Oren Halvani" <Spam (AT) halvani (DOT) de> wrote in message
news:450699fa (AT) newsgroups (DOT) borland.com...

Quote:
can someone tell me if it's possible to use mciSendString
for playing a MP3 from resource that is build-in the application ??

It is not. MCI does not support playing anything from resources directly.


Gambit
Back to top
Oren Halvani
Guest





PostPosted: Tue Sep 12, 2006 11:12 pm    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote



"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> schrieb im Newsbeitrag
news:4506e869$1 (AT) newsgroups (DOT) borland.com...
Quote:

"Oren Halvani" <Spam (AT) halvani (DOT) de> wrote in message
news:450699fa (AT) newsgroups (DOT) borland.com...

can someone tell me if it's possible to use mciSendString
for playing a MP3 from resource that is build-in the application ??

It is not. MCI does not support playing anything from resources directly.


Gambit

Thanks Remy :-)

i will save the mp3 file from resouce and than use the mciSendString...
but only one more thing: What should i do if i want to load the required DLL
"WinMM.dll" via LoadLibrary( ) can u show me how to call the DLL-Entry address...?



Oren
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Sep 13, 2006 12:59 am    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote

"Oren Halvani" <Spam (AT) halvani (DOT) de> wrote in message
news:4506f88a (AT) newsgroups (DOT) borland.com...

Quote:
What should i do if i want to load the required DLL "WinMM.dll"
via LoadLibrary( )

What about it? What exactly do you want to do? Why are you trying to load
WinMM.DLL manually anyway?

Quote:
can u show me how to call the DLL-Entry address...?

You never call a DLL's entry point yourself. It is called automatically by
the DLL loader. In the case above, by LoadLibrary().


Gambit
Back to top
Oren Halvani
Guest





PostPosted: Wed Sep 13, 2006 1:51 am    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> schrieb im Newsbeitrag
news:45071353 (AT) newsgroups (DOT) borland.com...


Quote:
What about it? What exactly do you want to do? Why are you trying to load
WinMM.DLL manually anyway?


Because i don't want my programm to be depend directly to the "WinMM.DLL"
if it's existing, otherwise my programm would be directly "linked" to the DLL...
Only if the DLL is there, than the programm should use its function: "mciSendDtring",


Quote:
You never call a DLL's entry point yourself. It is called automatically by
the DLL loader. In the case above, by LoadLibrary().


Gambit

sorry, no "entry point"...my mistake.....i mean: GetProcAddress( ) ....

how should i call:

GetProcAddress((HMODULE)hInstance, "Name_Of_Dll_Function");


i remember, i've used something similar in the past....


in header...
-------------------------------------------------------------------------
private:
typedef int (DLLFUNCTION)(int, int);

DLLFUNCTION *WinMM_DllFunction;

public:
TDLLTest();
void CallDllFunction(int iTest1, int iTest2);
}

// in cpp....


TDLLTest::TDLLTest( )
{
HINSTANCE hInstance;

hInstance = ::LoadLibrary("DelphiDLL.dll");
WinMM_DllFunction = (DLLFUNCTION*)::GetProcAddress((HMODULE)hInstance, "Name_Of_Dll_Function");
}

void TDLLTest::CallDllFunction(int iTest1, int iTest2)
{
int iResult;

if (WinMM_DllFunction) iResult = (*WinMM_DllFunction)(iTest1, iTest2);
}
-------------------------------------------------------------------------



Oren
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Sep 13, 2006 2:40 am    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote

"Oren Halvani" <Spam (AT) halvani (DOT) de> wrote in message
news:45071dcf (AT) newsgroups (DOT) borland.com...

Quote:
Because i don't want my programm to be depend directly
to the "WinMM.DLL" if it's existing

Why not? That is a Microsoft DLL that is on all Windows systems. Since you
are using the Windows Multimedia system anyway, you are better off
statically linking to it. There is no point in dynamically loading it in
your code.

Quote:
otherwise my programm would be directly "linked" to the DLL...

As it should be. That DLL is always available.

Quote:
Only if the DLL is there

The DLL is part of the Windows OS, and has been since the days of Windows 95
and NT 3.1. It is been available on all Sindows systems ever since.

Quote:
how should i call:

GetProcAddress((HMODULE)hInstance, "Name_Of_Dll_Function");


i remember, i've used something similar in the past....

That is how to dynamically load a DLL function. So what exactly are you
having a problem with? Please be more specific.

Quote:
typedef int (DLLFUNCTION)(int, int);

Use a pointer in the typedef, not in the variable declarations:

typedef int (*DLLFUNCTION)(int, int);

DLLFUNCTION WinMM_DllFunction;

WinMM_DllFunction = (DLLFUNCTION) ::GetProcAddress(hInstance,
"Name_Of_Dll_Function");

iResult = WinMM_DllFunction(iTest1, iTest2);


Gambit
Back to top
Oren Halvani
Guest





PostPosted: Wed Sep 13, 2006 3:09 am    Post subject: Re: Playing a mp3 via mciSendString from Resource ? Reply with quote

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> schrieb im Newsbeitrag
news:450729d7$1 (AT) newsgroups (DOT) borland.com...


Quote:
Why not? That is a Microsoft DLL that is on all Windows systems. Since you
are using the Windows Multimedia system anyway, you are better off
statically linking to it. There is no point in dynamically loading it in
your code.

otherwise my programm would be directly "linked" to the DLL...

As it should be. That DLL is always available.


Well, actually you've answered my question :-)

i'll link my program staticly without LoadLibrary(...)

if the DLL is installed by default, i really don't need to call
it dynamicly at all....


thanks Remy !!!



Oren
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.