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 3312428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:59:39+00:00 2026-05-17T21:59:39+00:00

I have a winapp running with a DLL referenced to it. all the major

  • 0

I have a winapp running with a DLL referenced to it. all the major operations are done in the DLL.

I have like 1000 xml files stored in a location which i have to read and store data into another format.

From the UI, i click on an import button, the call is passed to the DLL layer which converts one xml after another stored at the location in a foreach loop.

In case one xml fails because it is not in proper format, the tool has to display a message in an textbox in my UI but the exception occurs in the dll. The tool has to continue with the other XML’s.

I know through a delegate its possible but am confused on how to use it between the DLL and the UI as the DLL does not have the textbox handle.

thanks…

  • 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-05-17T21:59:40+00:00Added an answer on May 17, 2026 at 9:59 pm

    You need to use events – the relevant class in DLL can define event to signal success/failure of each xml file that UI can handle. Another way would be to accept callback function (delegate) in the method to inform the UI. Here’e the simple sample code:

    In DLL:

    // delegate that will inform UI
    public delegate void FileProcessedHandler(string filePath, bool success);
    
    ...
    
    // Method that process files
    public void Process(FileProcessedHandler callback)
    {
    
       // loop processing file one by one
       for(..)
       {
          // process one file 
          var success = processFile(filePath);
    
          // Notify UI
          if (null != callback)
          {
             callback(filePath, success);
          }
       }
    }
    

    In UI:

    ...
    // code that invokes DLL for processing file
    // must invoked on the different thread so that UI will remain responsive
    ThreadPool.QueueUserWorkItem(o => { [object from DLL].Process(OnFileProcessed); });
    
    ....
    
    // Callback method (assuming inside control/form)
    public void OnFileProcessed(string filePath, bool success)
    {
       // Its important to marshal call to UI thread for updating UI
       this.Invoke(() => {
          Text1.Text = string.Format("File: {0}, Processed: {1}", filePath, success? "Success": "Failure");
       });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wxPython app which is running on MS Windows and I'd like it
I have a winapp which writes data into a xml(Data.xml). This xml is my
I have a small winapp that uses LinqToSQL as it's DAL. I am creating
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have done quite a bit of searching for a guide (of any substance) for
If I have a Windows Application WinApp that has a public function pubFun ,
I have a native api function which looks like: DWORD WINAPI WlanRegisterNotification( __in HANDLE
I need help with database connections and my winapp. I have a windows app
I have a Native WinApi C++ Application that finds media(.wmv, .mp3 etc.) files in
I have two running processes in Windows, and each process has a pipe to

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.