Results 1 to 4 of 4

Thread: Whats the VB version of C# extern? <Resolved>

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Whats the VB version of C# extern? <Resolved>

    How do you translate this to VB?

    [DllImport("shell32.Dll")]
    public static extern System.Int32 Shell_NotifyIcon(NotifyCommand cmd, ref NotifyIconData data);


    Here is what I have but I don't know what the VB version of extern is?

    <DllImport("shell32.Dll")> _
    Public Shared External Function Shell_NotifyIcon(ByVal cmd As NotifyCommand, ByRef data As NotifyIconData) As Int32
    Last edited by Edneeis; Dec 19th, 2002 at 01:10 PM.

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    <DllImport("shell32.Dll")> _
    Public Shared External Function Shell_NotifyIcon(ByVal cmd As NotifyCommand, ByRef data As NotifyIconData) As Int32
    I think its External.
    Dont gain the world and lose your soul

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    How do you translate this to VB?

    [DllImport("shell32.Dll")]
    public static extern System.Int32 Shell_NotifyIcon(NotifyCommand cmd, ref NotifyIconData data);
    Here, this should work, you use the Declare Function together to get the same effect as static extern:

    Public Declare Function Shell_NotifyIcon(cmd As NotifyCommand, data As NotifyIconData) As System.Int32

    (you might have to add byref or byval for the arguements)

  4. #4

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually that is what I tried next, the Declare function but you can't have a Shared Declare function. It turns out that you don't need Extern in Vb. You can just use the DLLImports attribute or Declare (if you don't want it shared). Also I forgot to close the function the first time I tried DLlImports because I thought it was like a delegate with just a signature, but itstead its just a blank function.

    Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width