Click here to Skip to main content
13,189,811 members (58,162 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i have one dll Apms.dll which is not supported to WPF (.net).

So i need to write a wrapper in C++ and use it in WPF appln.

iam new to wrapper creation . i have some API calls for Apms.dll .They are

RETCOND API1090 ApmsApiSrvConnect
( LPTSTR szServerName, LPDWORD dwClientNbr,
LPDWORD dwReserved );

Return code is of




can anybody help me in writing this Wrapper for the Api method in C++ and connect with my WPF application?
Posted 17-Apr-13 2:24am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to look into the use of P/Invoke[^] for accessing C style DLL functions from .NET applications.
Espen Harlinn 17-Apr-13 10:40am
Right, or use C++/Cli :-D
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Using a mixed mode C++/CLI DLL might be an easy way to provide a .NET friendlier interface for calling code in APms.dll. However if you only have a few functions to call, then the P/Invoke approach would be a better choice.

Typically, if P/Invoke is sufficient then you should go with it. On the other hand, if the DLL is relatively complex to use, wrapper might also help to simplify the use of its function.

I guess that Apms.dll is external to your company and that you only have the DLL (and its library for linking).

Because, if you have the full source code, you might consider compiling the DLL in mixed mode and have the .NET wrapper in the same DLL,

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171016.2 | Last Updated 17 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100