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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:53:24+00:00 2026-05-27T03:53:24+00:00

I am trying to convert C# project to Delphi, the C# code itself is

  • 0

I am trying to convert C# project to Delphi, the C# code itself is importing functions from native dll let us name it ‘dmp.dll’ which I don’t have the signature of its native functions and I have to look at how these functions are imported in c# and try to import them in Delphi code, and I did import a lot of them and they work fine, but now I am struggling with this function (StartLogging). This is how they imported in C#:

[DllImport("dmp.dll", CharSet = CharSet.Auto, EntryPoint = "StartLogging")]
public static extern int StartLogging(String AdapterName, 
  PLOG_RECORD_CALLBACK LogRecordCallback, 
  SafeWaitHandle StopLoggingEvent);

no problem about PLOG_RECORD_CALLBACK, but the problem is on this parameter SafeWaitHandle which is class exists in Microsoft.Win32.SafeHandles namespace. How can I port it to Delphi? What is the equivalent data type to it in Delphi?

And here is how they use it in the C# Code:

AutoResetEvent StopEvent = new AutoResetEvent(false);

The class AutoResetEvent exists in System.Threading
Then they call the method like this:

StartLogging(comboBox1.Text, CallbackProcedure, StopEvent.SafeWaitHandle);

Then at the last and to stop the logging they use:

StopEvent.Set();

I am really confused and I don’t know how to do this, appreciate your help.
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-27T03:53:25+00:00Added an answer on May 27, 2026 at 3:53 am

    You can probably use SyncObjs TEvent. If you create it with the ManualReset argument set to False, it should work about the same way. Just pass the Event.Handle (which is a THandle and is compatible with anything in the API expecting one).

    I don’t have a sample of using a non-manual reset event, but an example of creating a TEvent can be found in the accepted answer here; to make it a non-manually reset (IOW, AutoReset), just change the second parameter to False.

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

Sidebar

Related Questions

I'm trying to convert a .groupproj project group file (from Delphi 2009), to use
I am trying to convert my model-first project to code-first, as I can see
This is the VBA code for an Excel template, which I'm trying to convert
I'm trying to convert a project from ant to maven. The unit tests depend
I am trying to convert a Java project which uses Ant into a Maven
I'm trying to convert a simple Spring 2.5 hello world project (from Spring Recipes)
I am trying to convert a SourceForge project from Subversion to Git. According to
I'm trying to convert this code from Javascript to CoffeeScript: for (var i =
i'm trying to convert the following code from Java to C#. // Replace 0
I'm trying to convert a project over to scala 2.8 from 2.7 and I've

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.