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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:02:40+00:00 2026-05-20T18:02:40+00:00

Is this possible to write Win32 .dll files by C#.NET ? If yes, where

  • 0

Is this possible to write Win32 .dll files by C#.NET ?
If yes, where i can find some tutorials?
If no, so what’s your suggestion to write Win32 .DLLs?

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-20T18:02:41+00:00Added an answer on May 20, 2026 at 6:02 pm

    It sounds like you’re trying to create a classic Win32 DLL with Win32-style exports? (Win32-style exports are what DllImport picks up.) You can’t do that with managed code (C# or managed C++); as far as I know, you’ll need to use unmanaged C/C++ to do that.

    Programming Windows by Charles Petzold or a similar book on programming Win32 might be a good place to start; or find a ‘hello world’ Win32 DLL sample. Or just create a Win32 DLL project in Visual Studio and look at the files it creates for you, likely there should be some placeholder text to get you started.

    Managed code does use files that also have .dll as the extension, but they are really containers for managed code, and don’t have Win32-style entry points, so other code that’s expecting Win32 entry points can’t use them. They are sometimes referred to as “managed assemblies” rather than dlls to avoid confusion.

    —

    Update – there might be an alternate option: you can create what’s called a “Mixed mode DLL” which is a DLL that contains both native code and managed code. This DLL could then have the managed C# class that you want to ‘export’, and a small amount of mixed C/C++ that exports the Win32-style APIs. While this is possible, it’s not necessarily a good thing to do: code that’s expecting to load a plain Win32 DLL may not be expecting to get the CLR loaded as a consequence; and you could hit problems if the process already has a conflicting version of the CLR already loaded. Mixed-mode DLLs tend to be more useful for allowing a C# assembly to reuse C/C++ code, rather than allowing C#/managed code to masquerade as a Win32 DLL.

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

Sidebar

Related Questions

Is it possible to write executable application in .net that can be registered as
Is this Possible that write a Socket by C# in ASP.net ? for Example
if this possible to write a com control or activex in C# and use
For instance is it possible to write this if (variable != null) without using
Not sure this is possible, but looking to write a script that would return
As a followup to this question , is it possible to write a single
Is it possible to re-write this query to restart numbering when the UName changes
Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this
It seems to be possible in Java to write something like this: private enum
Is this possible? For example if i write Car myCar; Then the constructor taking

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.