problem compiling Managed Sink Wrapper for SMTP



(I've already posted wthis question to microsoft.public.inetserver.iis.smtp_nntp, but i think that perhaps this is a more approprite group for me to get a response.)
 
 
Our team needs to recieve SMTP mail from within a C# app, so we took the approach described in the MSDN article "Writing Managed Sinks for SMTP and Transport Events" at
http://msdn.microsoft.com/library/default.asp?url="">
After downloading the sample code and building the interop assembly as described in the article, we then went to build the C# code for the managed wrapper.  Unfortunaltely this resulted in compiler errors due to some datatype mismatches in the calls from the wrapper class to the interop DLL.

For example, the one of the wrapper classes (MailMsgPropertyBagWrapper.cs, line 245) includes the following call:
hr = propBag.GetProperty(propId, 1, ref size, buffer);
where buffer is declared as an IntPtr.  This line generates the following compiler error:   
The best overloaded method match for 'Microsoft.Exchange.Transport.EventInterop.IMailMsgPropertyBag.GetProperty(uint, uint, out uint, out byte)' has some invalid arguments:
Argument '3': cannot convert from 'ref uint' to 'out uint'
Argument '4': cannot convert from 'System.IntPtr' to 'out byte'
There are about 20 similar errors generated when I compile the wrapper code.

Why is the wrapper using the wrong parameter types here?  Is there something wrong with the interop dll, or the wrapper code?  All we're tryhing to do is compile code downloaded from MSDN and we've followed the instructions step by step, so we dont understand why this isnt working.

Is there anywhere I can just download a compiled managed wrapper assembly and not have to deal with building it myself?  Is there an easier way to recieve SMTP mail within a C# app?

Any help or advice would be appreciated.

Thanks,
    Joel.


Relevant Pages

  • problem compiling Managed Sink Wrapper for SMTP
    ... Unfortunaltely this resulted in compiler errors due to some datatype mismatches in the calls from the wrapper class to the interop DLL. ... 'Microsoft.Exchange.Transport.EventInterop.IMailMsgPropertyBag.GetProperty(uint, uint, out uint, out byte)' has some invalid arguments: ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • Re: back online again...
    ... I'd then have the compiler automatically fill in "dummy" ... dynamically compiled code uses this convention as if it were ... a custom prolog and epilog or wrapper function for calling SysV ... internal C functions and the SysV calling convention for external C ...
    (alt.lang.asm)
  • repost: problem compiling Managed Sink Wrapper for SMTP
    ... (I'm sorry to keep posting this question, but I only just figured out that I ... Unfortunaltely this resulted in compiler errors due to some ... datatype mismatches in the calls from the wrapper class to the interop DLL. ...
    (microsoft.public.exchange2000.development)
  • problem compiling Managed Sink Wrapper for SMTP
    ... (I've already posted wthis question to a couple of other newsgroups but have ... Our team needs to recieve SMTP mail from within a C# app, ... Unfortunaltely this resulted in compiler errors due to some ... datatype mismatches in the calls from the wrapper class to the interop DLL. ...
    (microsoft.public.exchange2000.development)
  • Re: vectorized computation in C++ such as those in Matlab (Matlab to C++)?
    ... but you can write wrapper ... functions which let you as user view things as vector operations. ... the compiler is assigned the task of picking exactly which variant ...
    (comp.soft-sys.matlab)