468,249 Members | 1,469 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Callbacks and Managed Code

I am trying to wrap a very old dll from Epson with a Managed Dll.
Their declaration for the callback is this:

typedef int (WINAPI* DLL_BiSetStatusBackFunction)(int, int (CALLBACK EXPORT
*pStatusCB)(DWORD dwStatus));

but when I compile it, I get the following errors:

Error 1 error C2143: syntax error : missing ')' before
'*' c:\lennys\alvordtech\posprinter\posprinter\POSPrin ter.h 48
Error 2 error C2143: syntax error : missing ',' before
'*' c:\lennys\alvordtech\posprinter\posprinter\POSPrin ter.h 48
Warning 3 warning C4229: anachronism used : modifiers on data are
ignored c:\lennys\alvordtech\posprinter\posprinter\POSPrin ter.h 48
Error 4 error C2059: syntax error :
')' c:\lennys\alvordtech\posprinter\posprinter\POSPrin ter.h 48
Error 5 error C2091: function returns
function c:\lennys\alvordtech\posprinter\posprinter\POSPrin ter.h 48

Obviously, the syntax has changed.
All of the non-callback functions are declared as follows:

typedef int (WINAPI* DLL_BiOpenMonPrinter)(int, LPSTR);
typedef int (WINAPI* DLL_BiSetMonInterval)(int, WORD, WORD);

These work fine when I use LoadLibrary and GetProcAddress.
Does anyone know the proper syntax for the callback?

Steve
Microsoft Certified Partner
Jul 11 '06 #1
2 1759
Steve,

You may want to consider posting your question to the C++ language
newsgroup microsoft.public.dotnet.languages.vc instead.

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 11 '06 #2
I will do that, thanks.
--
Steve
Microsoft Certified Partner
"Mattias Sjögren" wrote:
Steve,

You may want to consider posting your question to the C++ language
newsgroup microsoft.public.dotnet.languages.vc instead.

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by vijaya | last post: by
1 post views Thread by vijaya | last post: by
11 posts views Thread by Fabien Penso | last post: by
5 posts views Thread by WAkthar | last post: by
2 posts views Thread by Spyder | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.