Old 23rd June 2000, 23:39   #1
kcchesnut
Junior Member
 
Join Date: Jun 2000
Posts: 4
looking for source code examples ... other than win32 c. c++ would be good, mfc even better.
thanks
kc
kcchesnut is offline   Reply With Quote
Old 1st July 2000, 01:32   #2
herbie123
Junior Member
 
Join Date: Jun 2000
Posts: 15
I just created a sample MFC project for a general purpose plugin. You can find it here: http://www.casema.net/~hhondius/MFCWinamp.zip. Please read the readme.txt, it explains some important things.
HTH
herbie123 is offline   Reply With Quote
Old 4th July 2000, 23:52   #3
dreami
Junior Member
 
Join Date: Jul 2000
Posts: 6
Oh man!

The link was dead. I was sooo looking for mfc/c++ source for a general purpose plugin as I am having trouble with my config()'uration dialog (crashes when I do Create(IDD_TO_MY_DLG_RESOURCE,NULL) for my config CDialog)

could you please repost a nonbroken url?
dreami is offline   Reply With Quote
Old 5th July 2000, 01:57   #4
peter
ist death
 
peter's Avatar
 
Join Date: May 2000
Posts: 3,704
I have a SIMPLE solution for all your problems: STOP USING MFC #$^&!
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
this-&gt;sucks=TRUE;
[/code]

[This message has been edited by PP (edited July 04, 2000).]
peter is offline   Reply With Quote
Old 5th July 2000, 09:48   #5
dreami
Junior Member
 
Join Date: Jul 2000
Posts: 6
Bah.

MFC is simply the most efficient and straightforward way of writing windows applications, so why settle for less.

And yes, I've tried Win32 programming with C, won't do that again. Go flame at MFC on M$'s site or something, these devel forums should remain more constructive.
dreami is offline   Reply With Quote
Old 5th July 2000, 18:52   #6
kcchesnut
Junior Member
 
Join Date: Jun 2000
Posts: 4
try this link:
http://www.utdallas.edu/~cchesnut/MFCWinamp.zip

kcchesnut is offline   Reply With Quote
Old 6th July 2000, 00:57   #7
peter
ist death
 
peter's Avatar
 
Join Date: May 2000
Posts: 3,704
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by dreami:
Bah.
MFC is simply the most efficient and straightforward way of writing windows applications, so why settle for less.
And yes, I've tried Win32 programming with C, won't do that again. Go flame at MFC on M$'s site or something, these devel forums should remain more constructive.
<HR></BLOCKQUOTE>
MFC ? Efficient ? Do you really believe to all that crap written in MSVC manual ? I started using MSVC some 2 years ago. Initially I used MFC for everything too, but later I found that most of things can be done much easier WITHOUT MFC. Threads (CreateThread vs. CWinThread class) and dialogs (DialogBox and DialogProc vs. CDialog) are the best examples. MFC creates a BIG MESS in your code.
My biggest project - GF3 (fractal generator, uses MDI interface) was started using that MFC crap. Oldest parts of its code used MFC for a very long time while newer modules were MFC-free. Some day I was attempting to fix a strange bug in color table setup dialog. I added a few harmless modifications to its code and run it. Then whole Windows froze in a very nice way - no cursor movement, no ctrl+alt+del. Of course, this meant war... GF3 v3.5 is totally MFC-free. Imagine how damn entertaining was it to remove all the MFC crap... But now the code is much more clean and much easier to debug; the executable file is some 2x smaller (after adding PNG and JPEG libraries).
Anyway, if you use your brain properly, it shouldn't hurt you to create your own classes and define their basic behaviors without using MFC.


[This message has been edited by PP (edited July 05, 2000).]
peter is offline   Reply With Quote
Old 6th July 2000, 21:22   #8
dreami
Junior Member
 
Join Date: Jul 2000
Posts: 6
With 'efficient' I meant less time spent writing those window routines all over again - not MFC being ultrafast.

Enough with that, here is problem: I have this little piece of code in my config() for my General Purpose plugin:
---
CWnd * winampWnd = CWnd::FromHandle(plugin.hwndParent);

CSettingsDlg * settings = new CSettingsDlg(winampWnd);
settings-&gt;Create(IDD_SETTINGS_DLG,winampWnd);
settings-&gt;ShowWindow(SW_SHOW);
---

Now this same exact code naturally works in a non-dll app, but crashes on Create() in my plugin. And yes, it isn't the dialog resource, I've checked it million times. Anyone written genplugins with mfc? What the hell is the deal here. I know I can write the dialog with DialogBox, tried it. Just don't want to. Kingdom for a solution :-)
dreami is offline   Reply With Quote
Old 6th July 2000, 21:48   #9
dreami
Junior Member
 
Join Date: Jul 2000
Posts: 6
Sorry all!

I missed kcchesnut's post on the url.. doh! Well, the thing was to add that
---
AFX_MANAGE_STATE(AfxGetStaticModuleState());
---
..and now my dlg works just fine. I have little experience working on .dll's, actually this is my first. Thanks a bunch!
dreami is offline   Reply With Quote
Old 7th July 2000, 18:15   #10
herbie123
Junior Member
 
Join Date: Jun 2000
Posts: 15
&gt;The link was dead.
The link is not dead, it's just case-sensitive
BTW I found a *great* MFC Winamp DLL at codeproject, definitively worth a look: http://www.codeproject.com/dialog/winampwnd.asp.
herbie123 is offline   Reply With Quote
Old 21st July 2000, 16:27   #11
spib
Senior Member
 
Join Date: Jun 2000
Location: Manchester, UK
Posts: 106
Firstly - Guys, calm down.

MFC is only an application framework - don't be so down on it. Sure it's big but it makes VC++ *almost* a RAD environment. People use it to generate applications fast without having to resort to a restrictive language like VB. It's also great for beginners - I bet you both started learning using MFC.

The codeproject link mentioned above is to an article I wrote. If you have any more problems, email me and I'll try and help you out.

James

spib is offline   Reply With Quote
Old 22nd July 2000, 02:01   #12
peter
ist death
 
peter's Avatar
 
Join Date: May 2000
Posts: 3,704
Yes, I DID learn how to program in C/C++ with MFC. And I think that it is pretty good for C++ newbies that are familar with object programming. But it is really good only for newbies. Of course, it can make it possible to write programs faster because of its integration with MSDev, but I just like to have low-level control over everything.

[This message has been edited by PP (edited July 21, 2000).]
peter is offline   Reply With Quote
Old 23rd July 2000, 14:55   #13
MArtist
Junior Member
 
Join Date: Jul 2000
Posts: 4
Herbie123
Thanks.. VERY much for that source sample.
Great, kudos for you

Everyone:
MFC is as bloated and disgusting as windows is. But as far as windows programming goes, it is definately nice and easy to use.
I am familiar with win32 and xwindows (xlib/xt/motif). I must say MFC with visual C++ makes programming windows VERY EASY. And that's all that really matters.
You want performance.. go back to the ASM level (which I used to be a huge advocate of, but of course have learned in time thats not the efficient way to program).

Currently I am writing ASIO drivers for winamp.
I have to say I have been playing with the IN plugs, and have been having lots of problems using C++ with C, winamp doesnt seem to like it very much, anyhow this example really helps thanks again.


Anyhow, .. Keep on coding




------------------
David Pridie
Secret Level Games
www.secretlevel.com
MArtist is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump