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

  • Home
  • SEARCH
  • 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 949665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:26:13+00:00 2026-05-15T23:26:13+00:00

I have successfully gotten Dreamweaver to accept my DLL and call it’s methods. The

  • 0

I have successfully gotten Dreamweaver to accept my DLL and call it’s methods. The DLL is written in C++ with C interpeted functions (so function names aren’t mangled.)

I would like to become comfortable with C++ pointers and datatype, but I have a much stronger proficiency with C# so for our timeline I think it’s worthwhile to investigate alternatives to a straight C solution.

Would I theoretically be able to build a DLL in C# that would be seen from the “outside” the same as a C DLL?

and as an alternative

Would I be able to “wrap” a C# DLL with the working C DLL?

The main part of my concern is the datatypes of the functions, as when dreamweaver calls them it is expecting void and char pointers as the format for passing data back and forth.

Thank you.

  • 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-15T23:26:14+00:00Added an answer on May 15, 2026 at 11:26 pm

    Yes, the C++/CLI compiler makes this easy to do. It automatically generates a “thunk” that ensures that the CLR gets loaded when an unmanaged program calls an exported function. Best demonstrated with an example.

    Starting with the C# code, create a new project from the Class Library project template. You’ll have to write a static method, necessary because C code doesn’t know anything about classes. Here’s a simple example:

    using System;
    
    namespace ClassLibrary1 {
        public static class Mumble {
            public static int method(int arg) { return arg; }
        }
    }
    

    Right-click the solution name in the Solution Explorer window, Add + New Project. Select Visual C++, CLR, Class Library. Right-click the new project, Properties, Common Properties, Framework and References, click Add New Reference. Projects tab, select your C# project.

    Open the .cpp file and write code like this:

    #include "stdafx.h"
    
    using namespace ClassLibrary1;
    
    extern "C" __declspec(dllexport)
    int method(int arg) {
        return Mumble::method(arg);
    }
    

    Build. This DLL can now be used by your unmanaged code, it can call the “method” function. Both this DLL and your C# DLL need to be copied to the directory of the unmanaged program.

    Beware that there’s overhead in calling this method. The thunk that the C++/CLI compiler generates does a fair amount of work to ensure that the CLR is loaded and initialized. Debugging is going to be unfun (use Debugger.Break()) and uncaught managed exceptions will crash your program with a very poor diagnostic.

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

Sidebar

Related Questions

Have successfully gotten the csrf middleware working in express as per previous SO questions.
So I have successfully gotten AJAX requests to work before but I have always
I have successfully gotten my low-level mouse hook code to work, but there are
I have a multistop gradient created with colorzilla that I have successfully gotten to
In response to my question about Windows API's, I have successfully gotten it to
I have a QuickLook plugin which I have successfully debugged and gotten working under
I'm currently using OAuth 2.0 to access Google's reader API. I have successfully gotten
Ok. I've got a Ruby on Rails application and have successfully gotten authentication (thanks
I have successfully gotten a bunch of Twitter user_ids using the Twitter API resource
I have successfully bound a control to a property on my page. The property

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.