Callbacks and Managed Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spyder

    #1

    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_BiSetStatus BackFunction)(i nt, int (CALLBACK EXPORT
    *pStatusCB)(DWO RD dwStatus));

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

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

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

    typedef int (WINAPI* DLL_BiOpenMonPr inter)(int, LPSTR);
    typedef int (WINAPI* DLL_BiSetMonInt erval)(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
  • Mattias Sjögren

    #2
    Re: Callbacks and Managed Code

    Steve,

    You may want to consider posting your question to the C++ language
    newsgroup microsoft.publi c.dotnet.langua ges.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.

    Comment

    • Spyder

      #3
      Re: Callbacks and Managed Code

      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.publi c.dotnet.langua ges.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.
      >

      Comment

      Working...