none
Error_9_Since 'ASOCKETLib1.SnmpTrapClass' has the ComImport attribute, 'ASOCKETLib1.SnmpTrapClass.ASOCKETLib1.ISnmpTrap.Community.get' must be extern or abstract RRS feed

  • Question

  • Hi All,

    I am getting this sub line error :

     [DispId(0x66)]
     string ASOCKETLib1.ISnmpTrap.Community

    {

    [return: MarshalAs(UnmanagedType.BStr)]

    [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]

    get;

    [param: In, MarshalAs(UnmanagedType.BStr)]

    [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]

    set;

    }

    what about this error .Please Reply


    Thanks Surendra Reddy

    • Moved by Lisa Zhu Wednesday, August 8, 2012 10:32 AM CLR related (From:Visual C# General)
    Tuesday, August 7, 2012 7:49 AM

Answers

  • Hi Surend,

    Welcome to the MSDN Forum.

    Is it a compile error, right? I try to reproduce this by this code:

            [DispId(0x66)]
            string Community
            {
    
                [return: MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                get;
    
                [param: In, MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                set;
    
            }

    without success, anyway, based on this article: http://msdn.microsoft.com/en-us/library/a8hbk8dy(v=vs.90).aspx  

    Please try this code:

            [DispId(0x66)]
            string ASOCKETLib1.ISnmpTrap.Community
            {
    
                [return: MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                extern get;
    
                [param: In, MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                extern set;
    
            }

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 9, 2012 12:50 AM
    Moderator

All replies

  • Hi Surendra ,

    Thank you for visiting the MSDN forum. I’m afraid that it is not the  correct forum about this issue. I am moving your question to the most related forum .

    You will get better support and may have more luck getting answers here .

    Thanks for your understanding.

    Regards,



    Lisa Zhu [MSFT]
    MSDN Community Support | Feedback to us




    • Edited by Lisa Zhu Wednesday, August 8, 2012 10:30 AM
    Wednesday, August 8, 2012 10:28 AM
  • Hi Surend,

    Welcome to the MSDN Forum.

    Is it a compile error, right? I try to reproduce this by this code:

            [DispId(0x66)]
            string Community
            {
    
                [return: MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                get;
    
                [param: In, MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                set;
    
            }

    without success, anyway, based on this article: http://msdn.microsoft.com/en-us/library/a8hbk8dy(v=vs.90).aspx  

    Please try this code:

            [DispId(0x66)]
            string ASOCKETLib1.ISnmpTrap.Community
            {
    
                [return: MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                extern get;
    
                [param: In, MarshalAs(UnmanagedType.BStr)]
                [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x66)]
                extern set;
    
            }

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 9, 2012 12:50 AM
    Moderator