472,783 Members | 950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 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 1974
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{

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.