Click to See Complete Forum and Search --> : VC7.0: Add class from typelib


martho
April 30th, 2004, 08:29 AM
Hello!

Sorry if I'm a bit off-topic but I couldn't find any other forum suitable here.

In VC++ 6.0 you could generate classes out of a -.dll or .olb-file with:
ClassWizard (CTRL+W) -> Automation -> Add Class -> From a type librabry

How the h**l is it done in 7.0? I couldn't find something equal...

mdmd
April 30th, 2004, 11:37 AM
project/add class ( or rclick on project and select add class.

In the resulting dialog there is an icon "MFC Class from Type Lib"

martho
April 30th, 2004, 04:29 PM
Thanx! But this makes me an extra file for every class. In VC++ 6.0 you get one .h-file (mso.h) and one .cpp-file (mso.cpp). This seem to me more convinient. How can I do this?

mdmd
April 30th, 2004, 05:12 PM
Click on a class under "Generated Class". You'll be able to change the filename on the bottom of the dialog. You can choose
the same filename for all the interfaces.

martho
May 1st, 2004, 03:52 AM
Hi mdmd,

thanks again! But I can only choose one class a time, so I have to enter the file-name x-times?! Isn't there a better way? Or am I wrong?

Andreas Masur
May 1st, 2004, 12:17 PM
[Moved thread]

mdmd
May 1st, 2004, 12:37 PM
Originally posted by martho
Hi mdmd,

thanks again! But I can only choose one class a time, so I have to enter the file-name x-times?! Isn't there a better way? Or am I wrong?

As far as I know you need to select each class from
the "Generated Classes" list and change its filename seperate
from the other classes.
So you can choose all the classes from the typelib, but you'll need
to change each filename separately. I haven't looked furtuer to
see anything different or a way to change the behaviour.

martho
May 1st, 2004, 12:46 PM
Hi mdmd, thanx again for your help! In VC++ 6.0, this is really much easier, so I think I will generate the files there and just import them ;)