I have a template wizard that is generating an "Object expected" error:
VSWIZARD 6.0 Wizard=VsWizard.VsWizardEngine.7.1
Param="WIZARD_NAME = DNNModule"
Param="WIZARD_UI = FALSE"
Param="PROJECT_TYPE = VBPROJ"
Param="TEMPLATES_PATH =
V:\INetPub\DNN31\DesktopModules\_Templates\ModuleName\"
Param="SCRIPT_PATH =
V:\INetPub\DNN31\DesktopModules\_Templates\VSWizardCode\_DNNModule\"
Param="SCRIPT_COMMON_PATH = VBWizards\"
I had to add the SCRIPT_COMMON_PATH to get rid of the "Invalid procedure
call or argument" error....obviously it was not finding Common.js...
But now I get an "Object expected" error... I'm using the following
Default.js (reduced for testing):
function OnFinish(selProj, selObj)
{
var oldSuppressUIValue = true;
try
{
oldSuppressUIValue = dte.SuppressUI;
var bSilent = wizard.FindSymbol("SILENT_WIZARD");
dte.SuppressUI = bSilent;
var strCompanyName = "ABCXYZ";
AddBaseNameToWizard("COMPANY_NAME", strCompanyName, ".");
// Add CreationDate() call
CreationDate();
// Get the Project name from the wizard
var strProjectName = wizard.FindSymbol("PROJECT_NAME");
// Get the Project path from the wizard
var strProjectPath = wizard.FindSymbol("PROJECT_PATH");
// Get the Templates path from the wizard
var strTemplatePath = wizard.FindSymbol("TEMPLATES_PATH");
// Create the project (this call is in common.js)
var strTemplateFile = strTemplatePath + "\\DNNModule.vbproj";
var project = CreateVSProject(strCompanyName + "." + strProjectName,
".vbproj", strProjectPath, strTemplateFile);
if( project )
{
var folder;
var strItemName;
var item;
// Add icon
item = project.ProjectItems.AddFromFileCopy(strTemplatePath +
"\\icon_CompanyName.ModuleName_32px.gif");
item.Name = "icon_" + strCompanyName + "." + strProjectName + "_32px.gif";
project.Properties("RootNamespace").Value = "";
project.Properties("AssemblyName").Value = strCompanyName +
".DNN.Modules." + strProjectName;
project.Properties("OptionStrict").Value = 1;
// Save the project
project.Save();
}
return 0;
}
catch(e)
{
switch(e.number)
{
case -2147221492 /* OLE_E_PROMPTSAVECANCELLED */ :
return -2147221492;
case -2147024816 /* FILE_ALREADY_EXISTS */ :
case -2147213313 /* VS_E_WIZARDBACKBUTTONPRESS */ :
return -2147213313;
default:
ReportError(e.description);
return -2147213313;
}
}
finally
{
dte.SuppressUI = oldSuppressUIValue;
}
}
function CreationDate()
{
var Months = new Array("January","February","March","April","May","June",
"July","August","September","October","November","December");
var myDate = new Date();
var currentDate = myDate.getFullYear() + "/" + Months[myDate.getMonth()] +
"/" + myDate.getDate();
wizard.AddSymbol("CREATION_DATE", currentDate);
return 0;
}
Anyone have any ideas for debuging this? It appears to fail on the
CreateVSProject call....I could be wrong... Is the VSWizard perhaps getting
hung up trying to create something becase I changed the SCRIPT_PATH?
All suggestions sincerely appreciated!
Vivek Vishist - 23 Aug 2005 21:19 GMT
The best way to debug the script files that I used is very vague one but it
works. Add following code to your Defaul.js file. You can define it in the
begining of OnFinish function and pass the book object to other
methods/functions and then using Book.ActiveSheet.Cells(1,1).Value =
"Visual Studio path is: " + wizard.FindSymbol('CUSTOM_VSPATH'); you can
write the output to this excel.
/*
//this is what I use to debug this script :-)
Excel = new ActiveXObject("Excel.Application");
Excel.Visible = true;
Book = Excel.Workbooks.Add()
Book.ActiveSheet.Cells(1,1).Value = "Visual Studio path is: " +
wizard.FindSymbol('CUSTOM_VSPATH');
*/
Hope this helps,
Vv
>I have a template wizard that is generating an "Object expected" error:
>
[quoted text clipped - 108 lines]
>
> All suggestions sincerely appreciated!