Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I have a API which is written in MFC dll.
I want to use it in my c# application.

Kindly help me to declare the API in c#

This is the API
BOOL __stdcall SearchMAC(LPCTSTR strIP,CString &strMac)

I need to read the MAC address of Electronic board
Posted

See the P/Invoke tutorial[^].
 
Share this answer
 
You need to use Platform Invoke via the DLLImport attribute.
See here http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx[^] for an overview, and here: http://msdn.microsoft.com/en-us/library/ac7ay120(v=vs.110).aspx[^] for a list of datatype conversions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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