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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:26:41+00:00 2026-05-10T17:26:41+00:00

I am importing the CreateICeeFileGen() function from the unmanaged DLL mscorpe.dll in a C#

  • 0

I am importing the CreateICeeFileGen() function from the unmanaged DLL mscorpe.dll in a C# application, in order to generate a PE file. This function returns a pointer to an C++ object defined here, is there any way I can access fields from this class via C# or do I need to write an unmanaged wrapper DLL?

The code I’m using currently is as follows:-

[DllImport(@'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorpe.dll', EntryPoint = 'CreateICeeFileGen')] static extern void CreateICeeFileGen(out IntPtr iceeFileGenPointer); ... IntPtr filePtr; CreateICeeFileGen(out filePtr);     

N.B.: I know you can do similar things with .net libraries but I need to use unmanaged libraries for my purposes.

  • 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. 2026-05-10T17:26:41+00:00Added an answer on May 10, 2026 at 5:26 pm

    You need a wrapper library to be able to use the class from C#.

    The best bet would be to create the wrapper using C++/CLI, which can directly call the unmanaged function and expose the details with a managed class. This will eliminate the need to use P/Invoke for anything.

    (Well, technically if you know the class layout you could mess around with pointer arithmetic to access the fields, but this would be very fragile and messy, and trying to call virtual functions in this way would be extremely ugly).

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

Sidebar

Related Questions

When importing numbers from a csv file, I need to convert them to floats
I'm importing some data from a CSV file, and numbers that are larger than
Importing a spreadsheet I have filled a DataTable object with that data and returns
When importing a CSV file into Excel, it only strips the double-quotes from the
I'm relatively new to DLL importing and function binding. Let's say I have a
I've seen this question regading the importing of js-files related to the tag content
When I type 'from' (in a LINQ query) after importing System.Linq namespace , it
In importing the environment from a subcommand, I want to add all environment variables
After importing content from a legacy website using the Feeds module, I'm left with
While importing a python script from another script I want the script code that

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.