|
-
Dec 19th, 2002, 04:06 AM
#1
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.
-
Dec 19th, 2002, 11:05 AM
#2
Frenzied Member
<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
-
Dec 19th, 2002, 12:50 PM
#3
PowerPoster
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)
-
Dec 19th, 2002, 01:10 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|