|
Hi David,
Thanks for the prompt,as am new to MFC can u show example how to use sndPlaySound/PlaySound.
Thanks !!
|
|
|
|
|
YUANGE wrote: ...can u show example how to use sndPlaySound/PlaySound.
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry..
I dun seen understand the source code from the net..
can u show me an example..
thanks again
|
|
|
|
|
If this is too much for you, perhaps you should master the basics first.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
for 1 and 2 -
"Animation controls can only display AVI clips that do not contain audio."
To explore various options for playing AVI (and other) video files, see the following:
Graphics and Multimedia[^]
DirectShow[^]
Windows Multimedia Start Page[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I suggest use of MCI functions they can show wav,mp3,mpeg,avi
|
|
|
|
|
Hello all,
I need to close my app (this->SendMessage(WM_CLOSE); ) just when the user set the focus to another application.
In the main dialog pretranslatemessage handler, I've tried to capture the messages WM_KILLFOCUS, WM_ACTIVATEAPP, WM_ACTIVATE and WM_COMMAND . (All of them without luck).
Could you please tell me which one should I use?
Thank you in advance.
|
|
|
|
|
WM_ACTIVATEAPP would be appropriate. Why are you overriding PretranslateMessage? Why not to handle the message through MFC message map; use ON_WM_ACTIVATEAPP() inside the BEGIN_MESSAGE_MAP and END_MESSAGE_MAP pair. Also this is the prototype of the handler
void CMyDialog::OnActivateApp(BOOL , DWORD);
--
=====
Arman
|
|
|
|
|
Worked...
I do not understand why it did not worked inside the PreTranslateMessage...
Thank you for yuor feedback.
|
|
|
|
|
hello i am z1n i'm really interested in learning c++ so where should i go first hoping some of you vets could show me the best resource's?
|
|
|
|
|
A good free online resource is books by Bruce Eckel[^]
--
=====
Arman
|
|
|
|
|
|
Please refer this[^].
Regards,
Paresh.
|
|
|
|
|
|
If I have this code made in the Form.h of may project, how can i make the conection in
the main project file(.cpp) for variable "W".....please help.....can you give me a link or something like that where I can learn to do the conections between the variables from interface(form) and my algorithm(code)....
private: System::Void StartPackingbutton_Click(System::Object^ sender, System::EventArgs^ e) {
int W;//Container Width
try {
W=Convert::ToInt32(ContainerWidthtextBox->Text, CultureInfo::CurrentCulture);
}
int main()
{ int W;
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
return 0;
}
|
|
|
|
|
|
Hi!
Can anyone tell me how can i return an int array from an exported function of DLL?
I have a function in VC++ Dll which is exported from DLL. This function will fill an int array and it should return to calling application(VC++ again).
Can anyone send me a sample code? or logic how this can be done?
And how the calling application should parse this array?
Thanks in advance.
|
|
|
|
|
A simple implementation could mimic standard Windows APIs GetWindowText , GetWindowsLength behaviour.
The Above APIs deals with char s instead of int s, but the underlying idea can be the same: accept a buffer allocated by the calling code (at least giving to the calling code the hint of required buffer length) and just fill it.
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Thanks much all of you.
My problem is solved.
I did a simple pass of array by "Passing a pointer(int* ReturArray()) to first element in the array". Then increment the pointer and retrive its contents on the application side.
It was a simple int array. so did not want to complicate things.
But did go throgh the links and saved for future use.
Good Info. Thanks again.
|
|
|
|
|
Hello,
I use CSortListCtrl to show some data in a list, and all informations come from a lokal files,
i have a vector to store all datas for CSortListCtrl!
The property LVS_OWNERDATA is set!
Vector is for my own class derived from CObject, have some CStrings and integers!
Like this:
vector<CMyObject>VectorObject;
CMyObject myOb;
myOb.csName = "foo";
myOb.csIindex.Format("%d", iIndex);
VectorObject.push_back(myOb);
When the user click on some column header, i like that the CSortListCtrl sorts all items and show.
Problem is that sometime i get a NULL pointer and my sort function crash!
if((GetStyle() & LVS_OWNERDATA)==0)
VERIFY( CListCtrl::SortItems( CompareFunction, reinterpret_cast<DWORD>( this ) ) );
else
{
for_each(VectorResults.begin(), VectorResults.end(), print);
sort(VectorResults.begin(), VectorResults.end(),compare_vector);
for_each(VectorResults.begin(), VectorResults.end(), print);
}
int compare_vector(const CMyObject& v1, const CMyObject& v2)
{
return lstrcmp(v1.csIndex, v2.csIndex);
}
In debug mode i can see that v2.csIndex is NULL, maybe im out of index, or what?
When i use for_each(VectorResults.begin(), VectorResults.end(), print); to see what is inside my
Vector, there is nothing strange, all infos are ok!
My question is how to use sort() ??
The idea to check if v2.csIndex is NULL dont work, because i go to CString compare funktion and
crash!
thanks for any help
termal
-- modified at 4:06 Friday 27th April, 2007
|
|
|
|
|
csIndex is of type CString (I guess) and thus cannot be NULL. Why? Because to be a NULL, it should be of a pointer type. But of course what is inside of CString (I mean its m_pData) can be NULL. So if there is no error before printing, I'm skeptical about the print method itself. Try to find out whether this method has no bugs in it.
--
=====
Arman
|
|
|
|
|
Hello,
this occurs when i try to sort my vector, and no other place!
int compare_f(CMyObject a, CMyObjectb)
{
if(0 > a.csName.Compare(b.csName))
return -1;
else if(0 < a.csName.Compare(b.csName))
return 1;
else
return 0;
}
regards
termal
|
|
|
|
|
Can anyone help me with saving a text introduced in a text button in a different file?
|
|
|
|
|
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|