I'm trying to create a Visual C++ wizard that acts like MFC class wizard, according to MSDN Documentation,

and my template dialog resouce(MyWizard\Templates\1033\dialog.rc) looks like this:

    DIALOG 0, 0, 320, 200
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "Dialog"
    FONT [!output DLG_FONT_SIZE], "[!output DLG_FONT_NAME]"
    BEGIN
        DEFPUSHBUTTON   "OK",IDOK,209,179,50,14
        PUSHBUTTON      "Cancel",IDCANCEL,263,179,50,14
    END

I correctly wrote the default.htm and default.js functions to run my wizard, and here is the OnFinish function defined in default.Js:

        var strProjectRC = GetProjectFile(selProj, "RC", true);
        var oResHelper = wizard.ResourceHelper;

        oResHelper.OpenResourceFile(strProjectRC);
        var strTemporaryResourceFile = RenderToTemporaryResourceFile(strRCTemplFile);
            var strSymbolValue = oResHelper.AddResource(strDialogID, strTemporaryResourceFile, "DIALOG");

        if (strSymbolValue == null)
            return;

        wizard.AddSymbol("DD_DIALOGBAR", strSymbolValue.split("=").shift());

        oResHelper.CloseResourceFile();

The AddResource function should return a positive value, but the result is always less than 0, so I'm not able to add the resource in my custom wizard. A further problem is that Visual Studio does not permit to debug AddResource and AddSymbol functions, which are defined in C++.

How can I fix the error? Is there a way to debug the functions?

0 Answers