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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:58:32+00:00 2026-05-20T07:58:32+00:00

I’m trying to use a MFC Dll in my C# app. It basically is

  • 0

I’m trying to use a MFC Dll in my C# app. It basically is a proxy for easier connection with a hardware device.
I’m writing a wrapper class using P/Invoke to be able to use the methods defined in the dll.

  • I’m fairly new to P/Invoke stuff. It this going to work? I can’t test it very often because I have not the hardware available to test on my dev machine.
  • Could you refer me to a page with equivalent data types of C++ in C#? What type should I use when the variable has a * next to it? like
    double *, ULONG *, int *

ULONG WINAPI PCXUS_Open(ULONG *hPCXUS, int boot)   
ULONG WINAPI PCXUS_WRITE( ULONG hPCXUS, int Board, int Test, int Unit, 
LPCSTR strParam, double *dblValue, double dblArrayValue1[MAX_ROW], 
double dblArrayValue2[MAX_ROW], LPSTR StrValue, int *Clipped)  

And lastly, how should I define variables with brackets in their definitions? Like:
double dblArrayValue1[MAX_ROW], double dblArrayValue1[MAX_ROW]

UPDATE: Here’s the definition for the second method:

Arguments:
hPCXUS         //Your access number (see PCXUS_Open function)
Board          //Board number (0 to N)
Test           //Test number (0 to 7) (only for USPC with MUX extension)
Unit           //0 = µs ; 1 = mm ; 2 = inch
StrParam       //Pointer to parameter name ( see the list )
DblValue       //Pointer to parameter value
DblArrayValue1 //Parameter data array 1
DblArrayValue2 //Parameter data array 2
StrValue       //ASCII parameter value
Clipped        //Pointer to clip information
  • 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-20T07:58:33+00:00Added an answer on May 20, 2026 at 7:58 am

    Yes, odds are decent that you can pinvoke these functions. They look like regular C functions, not instance methods of a C++ class. ULONG is uint in C#, double is plain double. The * means that a pointer to the value is passed. It is ambiguous though, it could either be an argument that’s passed by reference (ref or out keyword in C#) or it could be an array.

    The first function definitely passes its 1st argument as “out uint” in C#, it returns a handle value.

    The second function is tougher. There’s no decent guess whether dblValue is an array or passed by reference, its name is lousy. Start your guess at “ref double”, you have to look in the C++ code to be sure. Same problem with strParam, it should be “string” if its value is passed in, StringBuilder if a value is returned. The dblArrayValue arguments are definitely arrays, double[] in C#.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.