Luca Diracca - 2010-03-10

Hi all,
I've been using SmartWin++ for a while in one project of mine and I'm very happy with it.
Now, though, I've crashed into a problem I seem not able to solve, so here I am asking for some help.

I'm writing some dlls for adding optional extra-functionality to the software. The thing I want to do is to get some new classes which are subclasses of a given one. Not a whole new app, though, just new classes to be stored in a vector and used when/if needed.

Everything goes well if the classes are "computational", things become harder when I require some Smartwin++ features.

In the DLL I create a class (maListaDiTaglio) which is a subclass of the class moduloAggiuntivo which is a subclass of WidgetFactory< WidgetWindow, moduloAggiuntivo >. Then I create a function

maListaDiTaglio* DLL_EXPORT CreateModuloAggiuntivo(FinestraTotale * parent)
{

    return new maListaDiTaglio(parent);
}

and I call it from the main app via

HMODULE hMod = LoadLibrary((arrFiles[i]).c_str());
if (hMod) {
    CreateModuloAggiuntivoFunc _CreateModuloAggiuntivoFunc;
    _CreateModuloAggiuntivoFunc = (CreateModuloAggiuntivoFunc)GetProcAddress(hMod, "CreateModuloAggiuntivo");
    if (_CreateModuloAggiuntivoFunc) {
        moduloAggiuntivo* maTmp = _CreateModuloAggiuntivoFunc(this);
        moduliAggiuntivi.push_back(maTmp);
             }
}

Everything works ok since I call createWindow() in the constructor of the class maListaDiTaglio. Here the program crashes and I've not been able to fix it.

Any help would be greatly appreciated!

Luca