Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I encounter "exited with code -1073741819" when installing plugins #1055

Open
Geoff-Y opened this issue Nov 15, 2022 · 0 comments
Open

I encounter "exited with code -1073741819" when installing plugins #1055

Geoff-Y opened this issue Nov 15, 2022 · 0 comments

Comments

@Geoff-Y
Copy link

Geoff-Y commented Nov 15, 2022

hi sir, i think i need some help
i load my plugins by ctkPluginFrameworkLauncher, the code snippet is as follows:
///////////////////////////////////////////////////////////////////////////////////////////
const QString EVENT_ADMIN_SERVICE = "org.commontk.eventadmin";
void MainWindow::loadPlugins()
{
QDir appDir = QApplication::applicationDirPath();
appDir.cd("plugins");
QString pluginPath = appDir.path();

ctkPluginFrameworkLauncher::addSearchPath(pluginPath);
ctkPluginFrameworkLauncher::start(EVENT_ADMIN_SERVICE);

m_ctkContext = ctkPluginFrameworkLauncher::getPluginContext();

QDirIterator it(pluginPath, QStringList() << "*.dll", QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
while (it.hasNext())
{
    try
    {            
        QSharedPointer<ctkPlugin> plugin = m_ctkContext->installPlugin(QUrl::fromLocalFile(it.next()));
        plugin->start(ctkPlugin::START_TRANSIENT);

        qDebug() << "plugin name: " << plugin->getSymbolicName() << "\r";
        qDebug() << "plugin version: " << plugin->getVersion() << "\r\n";
    }
	catch (const ctkPluginException& e)
	{
		qDebug() << "error in: " << e.what();
	}
}

}
///////////////////////////////////////////////////////////////////////////////////////////
in most cases, the code work fine(vs2019+Qt5.15), but if i [Rebuild] the solution, it popups the "exited with code -1073741819".
after debugging, i locate the code line:

ctkPluginFrameworkLauncher::start(EVENT_ADMIN_SERVICE);

but bad luck, i don't find problem after reading the source code of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants