Home > Net >  C # call c dynamic library
C # call c dynamic library

Time:11-07

Used to make c + +, the recent project the following questions need to proceed with c # and PC pinvoke c # design by using c + + dynamic libraries, there are similar to the following interface read (intptr buffer, int len), the corresponding c + + code read (PVOID64 buffer, int len), now have the following problems:
Question 1, under the c + +, can directly to read into the buffer by pointer, but c # by marshal copies data from an unmanaged memory to managed memory, can step after processing, seriously affected the performance of the system,
Question 2, c + + to compatible with 32-bit applications and the need of 64 drivers, a pointer to a buffer requirement function must be 64, but c # intptr digit lack is determined by the platform, is a 32 bit 32-bit compiler environment, a 64 - bit environment is 64 bit, both digits cannot match,
Above is the two problems, did not know with what method to solve, please tell Daniel to the younger brother to give directions,

CodePudding user response:

The software itself also has a 32-bit and 64 - bit version

CodePudding user response:

1. So do
2. Can a single seal a 64 - bit into application EXE to ZhuanGan dynamic libraries, and then you main process via TCP/IP or HTTP listener and so on with the EXE communications
  •  Tags:  
  • C#
  • Related