Custom AppWizards 
Author Message
 Custom AppWizards

Hi,

I am writing a custom MFC appwizard to automate the generation of
boiler-plate code for OpenGL.  Its working fine except that I am not able to
programmatically specify that the OpenGL libraries must be linked with in
all the configurations of the new project.  I did a little searching and
found out that it can be done by overriding the "CustomizeProject" method
(Technical Note no. Q173483).  Unfortunately, however, I am not able to do
this (the call to "IConfigurations::Item" fails saying the parameter passed
is incorrect).

Does anybody know of any sample code that deals with the generation of
custom appwizards in VC++?
Thanks for any help :).

--
Ranju. V
--



Thu, 04 Dec 2003 20:54:27 GMT  
 Custom AppWizards
I am not a AppWizard expert, but it is probably possible to add to user code
this line
#pragma comment(lib, "mylib.lib")

Radek

Quote:
> Hi,

> I am writing a custom MFC appwizard to automate the generation of
> boiler-plate code for OpenGL.  Its working fine except that I am not able
to
> programmatically specify that the OpenGL libraries must be linked with in
> all the configurations of the new project.  I did a little searching and
> found out that it can be done by overriding the "CustomizeProject" method
> (Technical Note no. Q173483).  Unfortunately, however, I am not able to do
> this (the call to "IConfigurations::Item" fails saying the parameter
passed
> is incorrect).

> Does anybody know of any sample code that deals with the generation of
> custom appwizards in VC++?
> Thanks for any help :).

> --
> Ranju. V
> --



Thu, 04 Dec 2003 22:02:22 GMT  
 Custom AppWizards


| I am not a AppWizard expert, but it is probably possible to add to user
code
| this line
| #pragma comment(lib, "mylib.lib")
|
| Radek

Hmm.  Thanks Mr. Bukowski.  Never thought about that!
Still, I wonder how its done using the Developer Studio object model.

Thanks again :).

--
Ranju. V
http://www.geocities.com/cool_ranju/
--



Fri, 05 Dec 2003 13:31:23 GMT  
 Custom AppWizards

Quote:

> Hi,
> Does anybody know of any sample code that deals with the generation of
> custom appwizards in VC++?

Ranju,

Try the following code in your CMyAppWiz::CustomizeProject function (which
should be
defined by the app wizard wizard:

void CMyAppWiz::CustomizeProject(IBuildProject* pProject)
{
    using namespace DSProjectSystem;

    long lNumConfigs;
    IConfigurationsPtr pConfigs;
    IBuildProjectPtr pProj;
    CString strMarbleDir = GetMarbleDir();

    // Needed to convert IBuildProject to the DSProjectSystem namespace
    pProj.Attach((DSProjectSystem::IBuildProject*)pProject, true);

    pProj->get_Configurations(&pConfigs);
    pConfigs->get_Count(&lNumConfigs);

    // Loop for each individual configuration (i.e. Debug and Release)
    for (long j = 1 ; j < lNumConfigs+1 ; j++)
    {
        _bstr_t varTool;
        _bstr_t varSwitch;
        _bstr_t varOutput;
        IConfigurationPtr pConfig;
        _variant_t varj = j;

        pConfig = pConfigs->Item(varj);

        varTool = "link.exe";
        varSwitch = "mylib.lib";
        pConfig->AddToolSettings(varTool, varSwitch, varj);
    }

Quote:
}



Sat, 06 Dec 2003 00:38:28 GMT  
 Custom AppWizards


Quote:
> void CMyAppWiz::CustomizeProject(IBuildProject* pProject)
> {
>     using namespace DSProjectSystem;

>     long lNumConfigs;
>     IConfigurationsPtr pConfigs;
>     IBuildProjectPtr pProj;
>     CString strMarbleDir = GetMarbleDir();

Scratch that line.  It is unnecessary.  Otherwise, it should work.

Dave



Tue, 09 Dec 2003 05:02:23 GMT  
 Custom AppWizards
Dave,

have you tried this under VC6 SP5, it just crashes for me
everytime, even with the MS code I tracked down.

Always in the add or remove ..

I must be missing something.



Quote:


> > void CMyAppWiz::CustomizeProject(IBuildProject* pProject)
> > {
> >     using namespace DSProjectSystem;

> >     long lNumConfigs;
> >     IConfigurationsPtr pConfigs;
> >     IBuildProjectPtr pProj;
> >     CString strMarbleDir = GetMarbleDir();

> Scratch that line.  It is unnecessary.  Otherwise, it should work.

> Dave



Thu, 11 Dec 2003 14:18:19 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Problem with custom template files in VC5 custom AppWizards

2. Problem with custom template files in VC5 custom AppWizards

3. Custom Appwizard how to custom Lib and Include?

4. Custom Build Steps in a Custom AppWizard

5. custom appwizard

6. Custom Appwizard that generates two projects

7. Custom AppWizards

8. Custom AppWizard

9. custom Appwizard

10. Custom AppWizard doesn't create a correct DSP file

11. Migration of custom appwizards from VC5 to VS.NET

12. custom appwizard in vs.net ?

 

 
Powered by phpBB® Forum Software