473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 2018
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vijaya | last post by:
I've to invoke a unmanaged dll fucntion in C# which uses a callback fucntion.The unmanaged dll fucntion returns a pointer to a structure to its callback fucntion.The user should collect those...
1
by: vijaya | last post by:
I've to invoke a unmanaged dll fucntion in C# which uses a callback fucntion.The unmanaged dll fucntion returns a pointer to a structure to its callback fucntion.The user should collect those...
23
by: Brian | last post by:
I am very new to C# programming and have run into a problem. I apologize for the repost of this article. For some reason, my news reader attached it to an existing thread. First off, I have...
11
by: Fabien Penso | last post by:
Hi. I am trying to make this work but I got a weird behavior. I got a very basic system, I call a unmanaged "dllimported" function and give it a structure of callback functions. Sometimes,...
5
by: WAkthar | last post by:
Hi, can anyone show me how to be able to pass the name of method to a dll function which will call this method when something inside the dll calling function happens. Is this called a callback?...
1
by: anders | last post by:
I call from managed C++ a DCOM server interface method that takes a callback interface as parameter. I cannot figure out how to implement such a callback object in managed C++. The callback...
2
by: Spyder | last post by:
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...
6
by: per9000 | last post by:
An interesting/annoying problem. I created a small example to provoke an exception I keep getting. Basically I have a C-struct (Container) with a function-pointer in it. I perform repeated calls...
15
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast...
8
by: DavidT | last post by:
Hello, at first, exuse if the following question is simple to solve, but i normaly coding with C# and now have to use C++/CLI for one project. My Problem is that i have to use a native c++ sdk...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.