|
http://www.codeproject.com/audio/mp3player.asp
|
|
|
|
|
what about more advanced features? e.g. how do you continuously play a file? I found mciSendCommand(), but cannot work out the device id (i am not a multimedia programmer thus not familiar with these stuff )
with wav file functions, you can ask the system to play the sound in a loop...
|
|
|
|
|
If you just want to play a simple wav file, try ::PlaySound(...). very simple
include file:
<mmsystem.h>
|
|
|
|
|
I was just playing around with the VC++ Express, mixing up template code and managed classes. I wasn't able to figure out how to write a template class (managed or unmanaged) that can work with both managed and unmanaged classes. Is it even possible?
There are obvious syntactic differences, for eg, it's T * for unmanaged and T ^ for managed classes.. I tried specializing the template for managed classes, but then couldn't figure out how.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
managed C++ probably uses the .NET framework for templates. and they can't be specialised.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
But aren't templates compile time thingies? I guess they only need to be supported by the compiler and no runtime support is required. Generics, yes, but templates, I don't think so.
What I wanted to do is to write a template class that can take both managed and unmanaged types as type parameters. Is there any other way it can be done?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Sorry - I guess I misunderstood you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You'll need partial template specialization for this to work. Ie:
#include <vcclr.h>
using namespace System;
template <typename T> class TestClass
{
T member;
public:
TestClass (T mem) : member (mem){}
};
template <typename T> class TestClass<T^>
{
gcroot<T^> member;
public:
TestClass (T^ mem) : member (mem){}
};
int main(array<System::String ^> ^args)
{
TestClass<String^> tc(gcnew System::String(L"something")); //managed
TestClass<int> tn(1); //native
return 0;
}
<hr>
<a href = http://www.codeproject.com/script/profile/whos_who.asp?id=14112#Blog> My programming blahblahblah blog</a>. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Oooh ok. I did try partial specialization, but I didn't get the syntax for specializing for managed classes (T^). I guess the syntax is the same as for specializing for T*.
Thanks a lot.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Dear fellow CPians,
I am perplexed as to what's the fuss about a trivial phrase like 'Initialisation is Resource Acquisition'. I would be grateful if some kind enlightened soul could shed some light on it. What does it signify?
SDX-{5A853460-2944-42f8-84B8-2432DE3657EF}
|
|
|
|
|
|
|
Guys thanks a lot for the pointers. Its not a big deal after all, only the obvious restated as jargon.
SDX-{5A853460-2944-42f8-84B8-2432DE3657EF}
|
|
|
|
|
I'm using visual C++ .NET, and I'd like to make an ActiveX control for on a website, but I fail to find how to do it.. Sure you have many sites on how to us vb.NET and C# into a control for a website (such as, say; windows update), but I can't find a *manual* that says how to do it in vc++ .NET.
I know it's something with making an assembly, but.. that's all i have now.. an empry assembly..
Any help is much appreciated,
Michael
|
|
|
|
|
It's actually alot easier than you would suspect.
There is a utility that is included with the .NET Framework SDK, called:
AxImp.exe
This converts your ActiveX control into a .NET assembly.
|
|
|
|
|
Sounds pretty simple, you just need a nested loop.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
If both arrays are same size, then you can just put them into a
for(i=0;i<length;i++)
snprintf(newarray, maxlen, "%s/%s", oldarray[0][i], oldarray[1][i]);
Otherwise, as Christian says, a nested loop.
|
|
|
|
|
Hi all,
I've got an application where a window (parent) opens a child window. How do I ensure that only one of these windows (child) can be open at any time????
Thanks all
|
|
|
|
|
The problem now is that I need to check whether the form is open and if so bring it to the front when required. I can do this ok but when I've closed the from it won't reopen until an application restart.
Any ideas anyone???
|
|
|
|
|
I've got some C++ classes doing some math and I want to use them in windows forms app.
I add for example file.cpp and file.h to project
////////////////////////////////////////////////////////////////////////
file.h
class Test1
{
public:
Test1();
~Test1();
...etc
};
file.cpp
Test1::Test1()
{
etc...
}
...etc...
////////////////////////////////////////////////////////////////////////
then add some button to windows form for instance:
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
Test1 *pp;
pp = new Test1; //err no default constructor
pp->func();
}
and then comes a lot of errors for this Test1 class allocation?
9ine
|
|
|
|
|
The most likely problem is that you need to add #include "stdafx.h" at the top of your cpp file. OTherwise, there's no reason for the class to not fit in with no changes
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
the problem was that I as accustomed put (#include "testclass.h") to the Form1.cpp file of the windows forms and (class TestClass;) in Form1.h which was the problem with "no default constructors" and the like erro messages for TestClass, but it should be only (#include "testclass.h") in Form1.h file and all activity concerning my TestClass should be in Form1.h file only.
9ine
|
|
|
|
|
I have my Form borders set to "none", because I am using a bitmap for my
background. How do I drag the Form so the user can move the Form?
|
|
|
|
|
By catching a click and drag in whatever area works for you and setting your own window position based on the difference between the current mouse pos, and the mouse pos when you last checked.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Would you show me some code examples?
|
|
|
|