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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:29:12+00:00 2026-05-25T23:29:12+00:00

I am loading a .dll written in Delphi 7 using DllImport within a Windows

  • 0

I am loading a .dll written in Delphi 7 using DllImport within a Windows service written in C# .NET 4. Before deploying this service, I just want to make sure that I don’t have to do anything special to handle the unmanaged .dll.

My C# code looks something like this:

[DllImport("MyDelphiDLL.dll")]
private static extern string DoSomething(string value);

private void SomeMethod(List<string> values)
{
    foreach (string value in values)
    {
        string newValue = DoSomething(value);
    }
}

The DoSomething function will be called multiple times, and I suspect that MyDelphiDLL.dll only gets loaded either when the managed .dll gets loaded, or upon the first reference to DoSomething, but I’m not really sure.

I have looked at the DllImportAttribute Class documentation at MSDN, but it doesn’t really state one way or the other. I’ve also searched SO, and Googled the question every way that I can think of, and still haven’t found a definitive answer.

I just want to make sure I go about this correctly.

  • 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-25T23:29:13+00:00Added an answer on May 25, 2026 at 11:29 pm

    There no problem with what you’re doing. The DLL will be loaded once and will stay loaded.

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

Sidebar

Related Questions

I'm loading a DLL using LoadLibrary from my Delphi project like so: DLLHandle :=
I'm loading a dll by using it's name like this: HANDLE hlib = LoadLibrary(Winfax.dll);
I have a Windows service written in C# using Visual Studio 2010 and targeting
On Windows I am loading a DLL and running it. The DLL performs a
After loading a PHP template (using jQuery's load function), this simple script won't make
I'm getting a crash when loading dsound.dll from another DLL in Windows 7. The
I want to test wrapping a dll with ctypes . I've written the following
Let me start off by saying I had one DLL loading in just fine.
I have an assembly written in .net 3.5. I distributed this file to a
when loading a .dll file from lua it gives me this error: loop or

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.