Hi,
I've been trying to add a script to create a custom C++ file type to
visual studio 2005 with limited success. I can get the file created
and
added to a project, however, I need to add a custom build step to the
file
and I am not having much success (in implementing or finding the
first
step to getting things done).
So what I have so far is this (with some modifications):
function OnFinish(selPro j, selObj)
{
try {
var className = wizard.FindSymb ol('ITEM_NAME') ;
var fullFileName = wizard.FindSymb ol('PROJECT_PAT H') + "\\" +
className + ".xml"
addFileToSoluti onExplorerFolde r(fullFileName, selProj);
var file = createFileOnDis k(fullFileName) ;
writeTemplate(f ile, className);
} catch(e) {
if (e.description. length != 0)
SetErrorInfo(e) ;
return e.number
}
}
function writeTemplate(f ile, className)
{
file.WriteLine( "...stuff..."); ;
}
function createFileOnDis k(fullFileName) {
var fso = new ActiveXObject(' Scripting.FileS ystemObject');
var file = fso.CreateTextF ile(fullFileNam e, true, false);
return file;
}
function addFileToSoluti onExplorerFolde r(fullFileName, selProj)
{
selProj.Object. Filters.Item(dt e.SelectedItems (1).Name).AddFi le(fullFileName );
}
If someone can point me to some reference (or post a follow-up) as to
how i can add a custom build step for all configurations to the file
I
just added - that would be fantastic.
tom
I've been trying to add a script to create a custom C++ file type to
visual studio 2005 with limited success. I can get the file created
and
added to a project, however, I need to add a custom build step to the
file
and I am not having much success (in implementing or finding the
first
step to getting things done).
So what I have so far is this (with some modifications):
function OnFinish(selPro j, selObj)
{
try {
var className = wizard.FindSymb ol('ITEM_NAME') ;
var fullFileName = wizard.FindSymb ol('PROJECT_PAT H') + "\\" +
className + ".xml"
addFileToSoluti onExplorerFolde r(fullFileName, selProj);
var file = createFileOnDis k(fullFileName) ;
writeTemplate(f ile, className);
} catch(e) {
if (e.description. length != 0)
SetErrorInfo(e) ;
return e.number
}
}
function writeTemplate(f ile, className)
{
file.WriteLine( "...stuff..."); ;
}
function createFileOnDis k(fullFileName) {
var fso = new ActiveXObject(' Scripting.FileS ystemObject');
var file = fso.CreateTextF ile(fullFileNam e, true, false);
return file;
}
function addFileToSoluti onExplorerFolde r(fullFileName, selProj)
{
selProj.Object. Filters.Item(dt e.SelectedItems (1).Name).AddFi le(fullFileName );
}
If someone can point me to some reference (or post a follow-up) as to
how i can add a custom build step for all configurations to the file
I
just added - that would be fantastic.
tom