Question

I've created a test application for a 3rd party lib I am using, it compiles fine but never seems to hit __stdCall WriteDone.

from the example code it looks like this function

    if(cmcd->BuildISOImage(isoName, &CMCDBurner::WriteDone, NULL) == TRUE)
    {
        qDebug() << "inside build iso";
    }

Calls this code, but to the best of my knowledge it never makes it here.

void __stdcall CMCDBurner::WriteDone(int DeviceId, bool Failed, void *arg)
{
    qDebug() << "inside write done.";
}

This is the whole test application

#include <QCoreApplication>
#include "Windows.h"
#include "MCDBcls.h"
#
#include <QDebug>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    char* cdDestination = "\\";
    char* isoName = "C:\\LinearSystems\\AVCommand\\ISO\\aviso.iso";

    CMCDBurner* cmcd = new CMCDBurner();

    cmcd->ClearAll();

    cmcd->InsertFile(cdDestination, "C:\\DLS\\Interviews\\Test_001\\20130515-87701\\interview.xml" );
    int c = cmcd->Prepare();
    int b = cmcd->GetFilesCount();

    if(cmcd->BuildISOImage(isoName, &CMCDBurner::WriteDone, NULL) == TRUE)
    {
        qDebug() << "inside build iso";
    }

    return a.exec();
}


void __stdcall CMCDBurner::WriteDone(int DeviceId, bool Failed, void *arg)
{
    qDebug() << "inside write done.";
}
Était-ce utile?

La solution

I just realized you try defining the WriteDone function for the class CMDCDBurner. Try moving the function in front of your main method and leaving out the CMDCDBurner:::

void __stdcall WriteDone(int DeviceId, bool Failed, void *arg)
{
    qDebug() << "inside write done.";
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top