Click here to Skip to main content
15,891,316 members

how to call function in c# written in c++ dll

Member 7909353 asked:

Open original thread
I have xyz.dll and two header file xyz.hpp and ErrorCode.h
In xyz.hpp
C++
#define  FC3_PR_VERSION   "Version" 
typedef void *  FC3_t 
typedef FC3_t  FC3Template_t  
typedef FC3_t  FC3Encode_t  
typedef FC3_t  FC3Match_t  
typedef void DRMAPI  ProgressCallBack_t
(int nPercentCompleted, void *const pUserData) 

abcErrorCode_t FC3Initialize (const char *szReserved) 
abcErrorCode_t FC3Uninitialize (void) 
abcErrorCode_t FC3CreateTemplate (FC3Template_t *const pTemplateHandle) 
abcErrorCode_t FC3CreateEncoder (FC3Encode_t *const pEncodeHandle) 
abcErrorCode_t FC3Encode (const FC3Encode_t hEncodeHandle, const BITMAPINFOHEADER *const pBitmapData, const size_t nBitmapSize, const FC3Template_t hTemplate) 
abcErrorCode_t FC3CreateMatcher (FC3Match_t *const pMatchHandle) 
abcErrorCode_t FC3DestroyHandle (FC3_t *const pHandle)
abcErrorCode_t FC3Match (const FC3Match_t hMatchHandle, const FC3Template_t hTemplate1, const FC3Template_t hTemplate2, double *const pdScore)  

and in ErrorCode.h
C++
#define FPC_SUCCESS   0
#define  FPC_ERROR_INITIALIZED   -1 
#define  FPC_ERROR_NOT_INITIALIZED   -2 
#define  FPC_ERROR_NO_LICENCE   -3 
#define  FPC_ERROR_NO_CB_ONEND   -4 
#define  FPC_ERROR_NO_CB_ONERROR   -5 
#define  FPC_ERROR_CODING_LOGGED   -6 
#define  FPC_ERROR_BITMAP_PTR   -10 
#define  FPC_ERROR_BITMAP_COMPRESSION   -31 
#define  FPC_ERROR_BITMAP_HEADERSIZE   -32 
#define  FPC_ERROR_BITMAP_UNEXPECTED_FILEHEADER   -36 

typedef long abcErrorCode_t 

I want to call these functions in c#(help me).
Tags: C#, Visual Studio (Visual Studio 2008)

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900