|
hi
i need to stop the wave file which is playing in Media player programmatically.
if the code is generalised then its very useful.
Anyone have the solution for this?
Thanks in advance
regards
Halid
|
|
|
|
|
1) First off i'd like to get an opinion about creating cool code and leaving it all in one inclusive header.h package...?
CMemDC is great example...one simple little header no cpp files, less to look after...I know this sounds silly, but I find when my projects reach 20 or so classes, single includes look really appealing when i'm doing file managment. Despite your code inlining all the time I don't see why most code packages couldn't be written this way? What do you think...?
2) Flicker free scrollbars...this is starting to annoy me and i'm sure others have encountered this problem, how do you solve it...? Ownerdrawn scrolls...create them in seperate window...what hacks do you use...?
3) I've created a nifty custom control class originally derived from CView...but i'd much prefer CWnd derived...so I plan on converting. When you have a CWnd derived control how do you use it in a CView scenerio...? Do you throw it into a CFormView or actually convert from CWnd to CView...?
Just some questions/concerns I have for CP community in hopes of clearing some doughts(spelling) I have.
Cheers and thanx in advance!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
1) I guess leaving all the code in the .h file can make sense for short classes where everything can be inlined without much code bloat. Also, for templates this is the best option too (though not the only one). Apart from these cases, I guess having a separate .cpp file for the implementation is not that uncorfomtable for the user after all.
3) IMHO, the simplest way to use a CWnd -derived class as a CView of sorts is by following your first approach: create a CFormView and drop your class there as a child control.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx Joaquín.
I just needed to hear that from someone other myself. Not that I have dual personalities or anything, but I certainly struggle with myself with such issues like, personal preference.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
|
What prevented me from suggesting CCtrlView as an alternative is the fact that the encapsulated window must have a distinct class name, which is not the case (by default) with CWnd -derived classes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
IMHO, it's easier to register the class and use CCtrlView derivative instead of playing with window hosted in CFormView.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
This is what I like about this world of ours --that people have different opinions from one's own
Of course, registering and using CCtrlView is a nice solution. Regards.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I am Sinead.I have reached intermediate ,well,upper intermediate level in MFC.I now want to learn more about stuff like different messages,structures,owner draw,hooks and other such stuff Micheal Dunn talks about.
Could anyone suggest a good book that encompasses my needs.
Also,should I go for MFC or API?
cheers .
|
|
|
|
|
This one is quite good: Professional MFC With Visual C++ 6
by Mike Blaszczak.
|
|
|
|
|
Most of this stuff can be researched on MSDN, esp. the older versions of MSDN, I have a copy dating back to '93!
Also try for some Windows Internals books. And above all look at the MFC code.
Normski. - Professional Windows Programmer
|
|
|
|
|
Ya,thanx but is there any book by the MS press?
I prefer book to MSDN .Book can be read anytime anywhere.
Sinead.
|
|
|
|
|
Programming Windows by Charles PEtzhold is THE book for API Programming. I personally recommend using MFC, but Petzhold's book is still useful in that case.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
thanks,
I knew Charles was good book,now confirmed that you said.
thanx again
|
|
|
|
|
Hy!
How can I set an item checked in a CListCtrl( I'm talking about that blue bar that when you click on a item )
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Use the CListCtrl::SetItemState() function with LVIS_SELECTED
|
|
|
|
|
m_list.SetItemState(nItem,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi
probably easy to fix, but my VC wants to rebuild ALL the files inthe project when I hit F7 rather than just the files which have changed
what setting do i need to fix?
regards
bryce
|
|
|
|
|
Go to Tools | Customize menu and open the Customize dialog. In the Category choose Build. In Command select BuildRebuildAll. Check the Current Key. If it displays F7, remove it.
|
|
|
|
|
cool
you couldnt tell me how to stop F5 from asking about rebuilds when i want to run in debug mode as well?
coz its always reporting the files are out of date etc when no cpp or .h files have changed
bryce
|
|
|
|
|
I want to run WordPad.exe and open a text file from my Win32 program.
Now I use this API: ShellExecute but it seems not work. Could anyone tell me the right way to call ShellExecute and use WordPad.exe to open a given text file ?
Thanks !!
PS> I did it this way, but it didn't work..
And, how can I know the right "path" to WordPad.exe ?
hAppInst = ::ShellExecute( ghParentWnd, "open", "WordPad.exe myDoc.exe", NULL, NULL, SW_SHOWDEFAULT );
|
|
|
|
|
|
Hello Manio,
The following is a sample code listing that demonstrates how to call ::ShellExecute() :
HINSTANCE hInstExe = NULL;
hInstExe = ShellExecute
(
(HWND)NULL, // Replace this with your window handle.
(LPCTSTR)"open",
(LPCTSTR)"WordPad.exe",
(LPCTSTR)"c:\\sometext.txt", // Replace this with your specific file.
(LPCTSTR)NULL,
(INT)SW_SHOWNORMAL
);
Looking at your sample code, I think it is an error to specify "Wordpad.exe" together with "myDoc.exe" as in "WordPad.exe myDoc.exe". It is also a little odd that you want WordPad.exe to open an EXE file.
Furthermore, the parameter to Wordpad.exe should be specified in the 4th parameter. In my case, my parameter is "c:\\sometext.txt".
Hope the above will help you, Manio.
Best Regards,
Bio.
|
|
|
|
|
I found that a call to MoveMemory failed for some values of the last parameter dwLen. The call works perfect for all values in 98, but fails for some values in XP. Are there any known issues?
|
|
|
|
|
I bet the memory you are copying is invalid under an NT operating system or the length is too large.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|