Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8347005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:12:42+00:00 2026-06-09T07:12:42+00:00

I have a dll where I want to do some networking, this dll is

  • 0

I have a dll where I want to do some networking, this dll is called from an C# application as an unmanaged DLL.
All initialization works fine but it freezes everytime the ->get() is supposed to run. I have this code:

.........
QUrl path(remotePath);
QNetworkRequest request(path);

currentFile.setFileName(localPath);
if(!currentFile.open(QIODevice::WriteOnly)){
doCallback("failed to open: " + localPath);
}
doCallback("before get: " + remotePath);
QNetworkReply* reply = this->manager->get(request);
doCallback("after get: " + localPath);
...........

The “before get” callback is executed fine but never the one “after get” so I guess it completely freezes when manager is trying the Get() method. Have I missed something or is this just plain impossible through an DLL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:12:45+00:00Added an answer on June 9, 2026 at 7:12 am

    Okey so I got this working and I thought I would share my knowledge. With my unmanaged dll I exported an init function which creates a new QCoreApplication, through this I can later use the event loop by using the QCoreApplication object as parent to my class which executes all networking.

    QCoreApplication* coreApp = 0;
    extern "C" __declspec(dllexport) void initdll()
    {
        if (!coreApp) {
            int argc    = 0;
            coreApp = new QCoreApplication(argc, 0);
        }
        if(!MyFunc){
            MyFunc = new QtDll(coreApp);
        }
    }
    

    By calling this init function in my C# (or whatever) application before I tried any networking I got it working with the code in my first post by adding an exec of the event loop.

    QNetworkReply* reply = this->manager->get(request);
    currentReply = reply;
    QEventLoop eLoop;
    connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
    eLoop.exec( QEventLoop::ExcludeUserInputEvents );
    

    Thanks Peter for your feedback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DLL and application that will call some function in this dll. For
I have an Isapi dll which performs some basic URL rewriting. It works fine
I have a dll called utilities which contains some helper methods and I want
I have a method I want to import from a DLL and it has
I have a win32 COM dll. I want to register this dll for different
I want to get this straight. I know what DLL's are. I have done
I have some dll's for which i want to run code coverage using TestDriven.net
I have a dll which includes a function called ReadPort that reads data from
HI all I have a dll c#.net project and it refers some other sub
I have dll method that should be QoSed - this method should be called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.