Re: Help! How do I get the SSID of my connection?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



[top posting fixed]

MikeD wrote:
"applebag" <applebag@xxxxxxxxx> wrote in message
news:1143665427.410178.12130@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Larry Lard wrote:
applebag wrote:
As teh topic says, I would liek to programatically get the current SSID
(any any extra information on the connection if available) from within
VB6.

From my searches so far (I'm exhausted) I've thinking WMI is the only
way. I have been unable to find any code I can use in VB6 however. I
did find this, but I'm not very good at converting vbscript to vb6. If
someone can get this converted and working, I would appreciate it.
(Assuming it'll work in VB6.) Of any other good code will do.

Here is the vbscript:

Put it in a module which *doesn't* have Option Explicit set. Remove the
On Error Resume Next line. Voila, it compiles. I get an automation
error when I call Function SSID, but that's presumable because I
haven't got a wireless network here. What do you get?

Thanks Larry!

I feel like a real newbie for not thinking for that. It works great! =)


Now put Option Explicit back into the module and declare your variables. VB
will tell you what variables aren't declared.

You should ALWAYS use Option Explicit. Removing it to fix a "problem" is
only going to result in *real* bugs. The problem you're encountering isn't
with Option Explicit. It's that you're not explicitly declaring variables
(which is what Option Explicit protects against).

No offense to Larry, but IMO that was absolutely TERRIBLE advice.


Sorry, I must have missed the post where you gave him the source fixed
up to declare all the variables.

--
Larry Lard
Replies to group please

.



Relevant Pages

  • Re: Help! How do I get the SSID of my connection?
    ... Now put Option Explicit back into the module and declare your variables. ... Larry Lard wrote: ... I have been unable to find any code I can use in VB6 however. ...
    (microsoft.public.vb.general.discussion)
  • Re: Goto code
    ... "Option Explicit" is a directive to the compiler that tells it that you as the ... programmer are going to declare your variables. ... Dim lCtr as long ... I like to leave the cursor in the cell that I just changed. ...
    (microsoft.public.excel.misc)
  • Re: Goto code
    ... "Dave Peterson" wrote: ... "Option Explicit" is a directive to the compiler that tells it that you as the ... programmer are going to declare your variables. ... I like to leave the cursor in the cell that I just changed. ...
    (microsoft.public.excel.misc)
  • Re: Filter Switches vs Calculations?
    ... going to declare your variables. ... Dim lCtr as long ... Without that "option explicit" the top, excel will just figure you know what ... And I think most people who spend anytime writing macros have this option turned ...
    (microsoft.public.excel.misc)
  • Re: oolean variable being changed, but not by code
    ... Option Explicit only affects the module it is in, ... A Public varialbe declared in a Form module is visible only within the Form. ... I never declare a varialbe any higher than at a form level. ... and the two .mda code librarys ...
    (microsoft.public.access.modulesdaovba)