Problem with mixed VB and C# projects

i have used a VB project to declare some P/Invoke function calls (because i have problems if i declare them in C#) inside my C# solution. The VB signature is as follows:

     Declare Function Decode Lib "RG_DECODE32.DLL" Alias "decode" (ByVal pString As String) As Integer

From C# i have to call the function in the following way:

            if (OracleInterop.Decode(ref temp) == 0)

If i don't use the "ref" keyword for the parameter the compiler throws an error "Argument 1 must be passed with the 'ref' keyword". If i use it, R# flags an error "Argument is 'ref' while parameter is declared as 'value'".

Who is wrong, the compiler or R# ???

Regards
Klaus

1 comment

Hello Klaus,

I've logged a bug-report: http://youtrack.jetbrains.net/issue/RSRP-262761
and we'll look into this problem. Thank you for reporting!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Declare Function Decode Lib "RG_DECODE32.DLL" Alias "decode"
(ByVal pString As String) As Integer



0

Please sign in to leave a comment.