<p>Wifi support on Vista is fine, but <a href="http://msdn.microsoft.com/en-us/library/bb204766.aspx" rel="nofollow noreferrer">Native Wifi on XP</a> is half baked. <a href="http://msdn.microsoft.com/en-us/library/aa504121.aspx" rel="nofollow noreferrer">NDIS 802.11 Wireless LAN Miniport Drivers</a> only gets you part of the way there (e.g. network scanning). From what I've read (and tried), the 802.11 NDIS drivers on XP will <em>not</em> allow you to configure a wireless connection. You have to use the Native Wifi API in order to do this. (Please, correct me if I'm wrong here.) Applications like <a href="http://www.metageek.net/products/inssider" rel="nofollow noreferrer">InSSIDer</a> have helped me to understand the APIs, but InSSIDer is just a scanner and is not designed to configure Wifi networks.</p>

<p>So, the question is: where can I find some code examples (C# or C++) that deal with the configuration of Wifi networks on XP -- e.g. profile creation and connection management?</p>

<p>I should note that this is a XP Embedded application on a closed system where we can't use the built-in Wireless Zero Configuration (WZC). We have to build all Wifi management functionality into our .NET application.</p>

<p>Yes, I've Googled myself blue. It seems that someone should have a solution to this problem, but I can't find it. That's why I'm asking here.</p>

<p>Thanks.</p>

[{'answer_id': 31687, 'author': 'tuxedo', 'author_id': 3286, 'author_profile': 'https://Stackoverflow.com/users/3286', 'pm_score': 3, 'selected': False, 'text': '<p>Well, in one sense, you\'re lucky, \'cause Fortran doesn\'t have much in the way of subtle flow-of-control constructs or inheritance or the like.  On the other, it\'s got some truly amazing gotchas, like the arithmetically-calculated branch-to-numeric-label stuff, the implicitly-typed variables which don\'t require declaration, the lack of true keywords.</p>\n\n<p>I don\'t know about the "performance enhancing improvements".  I\'d guess most of them are probably ineffective, as a couple of decades of compiler technology have made most hinting unnecessary.  Unfortunately, you\'ll probably have to leave things the way they are, unless you\'re planning to do a massive rewrite.</p>\n\n<p>Anyway, the core scientific calculation code should be fairly readable.  Any programming language using infix arithmetic would be good preparation for reading Fortran\'s arithmetic and assignment code.</p>\n'}, {'answer_id': 32221, 'author': 'dagorym', 'author_id': 171, 'author_profile': 'https://Stackoverflow.com/users/171', 'pm_score': 3, 'selected': False, 'text': "<p>As someone with experience in both FORTRAN (77 flavor although it has been a while since I used it seriously) and C/C++ the item to watch out for that immediately jumps to mind are arrays.  FORTRAN arrays start with an index of 1 instead of 0 as they do in C/C++/Java.  Also, memory arrangement is reversed.  So incrementing the first index gives you sequential memory locations.</p>\n\n<p>My wife still uses FORTRAN regularly and has some C++ code she needs to work with now that I'm about to start helping her with.  As issues come up during her conversion I'll try to point them out.  Maybe they will help.</p>\n"}, {'answer_id': 54139, 'author': 'dagorym', 'author_id': 171, 'author_profile': 'https://Stackoverflow.com/users/171', 'pm_score': 1, 'selected': False, 'text': "<p>Here's another one that has bit me from time to time.  When you are working on FORTRAN code make sure you skip all six initial columns.  Every once and a while, I'll only get the code indented five spaces and nothing works.  At first glance everything seems okay and then I finally realize that all the lines are starting in column 6 instead of column 7.</p>\n\n<p>For anyone not familiar with FORTRAN, the first 5 columns are for line numbers (=labels), the 6th column is for a continuation character in case you have a line longer than 80 characters (just put something here and the compiler knows that this line is actually part of the one before it) and code always starts in column 7.</p>\n"}, {'answer_id': 67624, 'author': 'user7116', 'author_id': 7116, 'author_profile': 'https://Stackoverflow.com/users/7116', 'pm_score': 7, 'selected': True, 'text': '<p>You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school.</p>\n\n<p>Common FORTRAN-isms I deal with, that hurt readability are:</p>\n\n<ul>\n<li>Common blocks</li>\n<li>Implicit variables</li>\n<li>Two or three DO loops with shared CONTINUE statements</li>\n<li>GOTO\'s in place of DO loops</li>\n<li>Arithmetic IF statements</li>\n<li>Computed GOTO\'s</li>\n<li>Equivalence REAL/INTEGER/other in some common block</li>\n</ul>\n\n<p>Strategies for solving these involve:</p>\n\n<ol>\n<li>Get <a href="http://www.polyhedron.com/spag0html" rel="noreferrer">Spag / plusFORT</a>, worth the money, it solves a lot of them automatically and Bug Free(tm)</li>\n<li>Move to Fortran 90 if at all possible, if not move to free-format Fortran 77</li>\n<li>Add IMPLICIT NONE to each subroutine and then fix every compile error, time consuming but ultimately necessary, some programs can do this for you automatically (or you can script it)</li>\n<li>Moving all COMMON blocks to MODULEs, low hanging fruit, worth it</li>\n<li>Convert arithmetic IF statements to IF..ELSEIF..ELSE blocks</li>\n<li>Convert computed GOTOs to SELECT CASE blocks</li>\n<li><p>Convert all DO loops to the newer F90 syntax</p>\n\n<pre><code>myloop: do ii = 1, nloops\n    ! do something\nenddo myloop\n</code></pre></li>\n<li><p>Convert equivalenced common block members to either ALLOCATABLE memory allocated in a module, or to their true character routines if it is Hollerith being stored in a REAL</p></li>\n</ol>\n\n<p>If you had more specific questions as to how to accomplish some readability tasks, I can give advice. I have a code base of a few hundred thousand lines of Fortran which was written over the span of 40 years that I am in some way responsible for, so I\'ve probably run across any "problems" you may have found.</p>\n'}, {'answer_id': 80955, 'author': 'Paulus', 'author_id': 14209, 'author_profile': 'https://Stackoverflow.com/users/14209', 'pm_score': 3, 'selected': False, 'text': '<p>Could you explain what you have to do in maintaining the code? Do you really have to modify the code? If you can get away by modifying just the interface to that code instead of the code itself, that would be the best. </p>\n\n<p>The inherent problem when dealing with a large scientific code (not just FORTRAN) is that the underlying mathematics and the implementation are both complex. Almost by default, the implementation <em>has to</em> include code optimization, in order to run within reasonable time frame. This is compounded by the fact that a lot of code in this field is created by scientists / engineers that are expert in their field, but not in software development. Let\'s just say that "easy to understand" is not the first priority to them (I was one of them, still learning to be a better software developer). </p>\n\n<p>Due to the nature of the problem, I don\'t think a general question and answer is enough to be helpful. I suggest you post a series of specific questions with code snippet attached. Perhaps starting with the one that gives you the most headache?</p>\n'}, {'answer_id': 116716, 'author': 'SumoRunner', 'author_id': 18975, 'author_profile': 'https://Stackoverflow.com/users/18975', 'pm_score': 5, 'selected': False, 'text': '<p>There\'s something in the original question that I would caution about. You say the code is rife with "performance enhancing improvements". Since Fortran problems are generally of a scientific and mathematical nature, do not assume these performance tricks are there to improve the compilation. It\'s probably not about the language. In Fortran, the solution is seldom about efficiency of the code itself but of the underlying mathematics to solve the end problem. The tricks may make the compilation slower, may even make the logic appear messy, but the intent is to make the solution faster. Unless you know exactly what it is doing and why, leave it alone.</p>\n\n<p>Even simple refactoring, like changing dumb looking variable names can be a big pitfall. Historically standard mathematical equations in a given field of science will have used a particular shorthand since the days of Maxwell. So to see an array named B(:) in electromagnetics tells all Emag engineers exactly what is being solved for. Change that at your peril. Moral, get to know the standard nomenclature of the science before renaming too.</p>\n'}, {'answer_id': 168565, 'author': 'jaredor', 'author_id': 24893, 'author_profile': 'https://Stackoverflow.com/users/24893', 'pm_score': 5, 'selected': False, 'text': '<h2>Legacy Fortran Soapbox</h2>\n<p>I helped maintain/improve a legacy Fortran code base for quite a while and for the most part think <strong>sixlettervariables</strong> is on the money. That advice though, tends to the technical; a tougher row to hoe is in implementing &quot;good practices&quot;.</p>\n<ul>\n<li>Establish a required coding style and coding guidelines.</li>\n<li>Require a code review (of more than just the coder!) for anything submitted to the code base. (Version control should be tied to this process.)</li>\n<li>Start building and running unit tests; ditto benchmark or regression tests.</li>\n</ul>\n<p>These might sound like obvious things these days, but at the risk of over-generalizing, I claim that most Fortran code shops have an entrenched culture, some started before the term &quot;software engineering&quot; even existed, and that over time what comes to dominate is &quot;Get it done now&quot;. (This is not unique to Fortran shops by any means.)</p>\n<h2>Embracing Gotchas</h2>\n<p>But what to do with an already existing, grotty old legacy code base? I agree with Joel Spolsky on rewriting, <a href="http://www.joelonsoftware.com/articles/fog0000000069.html" rel="nofollow noreferrer" title="Things You Should Never Do, Part I">don\'t</a>. However, in my opinion <strong>sixlettervariables</strong> does point to the allowable exception: <em>Use software tools to transition to better Fortran constructs.</em> A lot can be caught/corrected by code analyzers (<a href="http://www.forcheck.nl/" rel="nofollow noreferrer" title="FORCHECK, or FORCHK">FORCHECK</a>) and code rewriters (<a href="http://www.polyhedron.com/pf-plusfort0html" rel="nofollow noreferrer" title="plusFORT is a Fortran code toolset">plusFORT</a>). If you have to do it by hand, make sure you have a pressing reason. (I wish I had on hand a reference to the number of software bugs that came from fixing software bugs, it is humbling. I think some such statistic is in <a href="https://rads.stackoverflow.com/amzn/click/com/0131774298" rel="nofollow noreferrer" rel="nofollow noreferrer">Expert C Programming</a>.)</p>\n<p>Probably the best offense in winning the game of Fortran gotchas is having the best defense: Knowing the language fairly well. To further that end, I recommend ... books!</p>\n<h2>Fortran Dead Tree Library</h2>\n<p>I have had only modest success as a &quot;QA nag&quot; over the years, but I have found that education does work, some times inadvertently, and that one of the most influential things is a reference book that someone has on hand. I love and highly recommend</p>\n<p><strong><a href="https://www.google.com/books/edition/FORTRAN_90_95_for_Scientists_and_Enginee/pJphoAEACAAJ" rel="nofollow noreferrer" title="Best Fortran 77/90/95 textbook">Fortran 90/95 for Scientists and Engineers</a></strong>, by Stephen J. Chapman</p>\n<p>The book is even good with Fortran 77 in that it specifically identifies the constructs that shouldn\'t be used and gives the better alternatives. However, it is actually a textbook and can run out of steam when you really want to know the nitty-gritty of Fortran 95, which is why I recommend</p>\n<p><strong><a href="https://rads.stackoverflow.com/amzn/click/com/0198505582" rel="nofollow noreferrer" rel="nofollow noreferrer">Fortran 90/95 Explained</a></strong>, by Michael Metcalf &amp; John K. Reid</p>\n<p>as your go-to reference (sic) for Fortran 95. Be warned that it is not the most lucid writing, but the veil will lift when you really want to get the most out of a new Fortran 95 feature.</p>\n<p>For focusing on the issues of going from Fortran 77 to Fortran 90, I enjoyed</p>\n<p><strong><a href="http://portal.acm.org/citation.cfm?id=162262" rel="nofollow noreferrer">Migrating to Fortran 90</a></strong>, by Jim Kerrigan</p>\n<p>but the book is now out-of-print. (I just don\'t understand O\'Reilly\'s use of <a href="http://safari.oreilly.com/" rel="nofollow noreferrer">Safari</a>, why isn\'t every one of their out-of-print books available?)</p>\n<p>Lastly, as to the heir to the wonderful, wonderful classic, <a href="https://rads.stackoverflow.com/amzn/click/com/020103669X" rel="nofollow noreferrer" rel="nofollow noreferrer">Software Tools</a>, I nominate</p>\n<p><strong><a href="https://rads.stackoverflow.com/amzn/click/com/0824708024" rel="nofollow noreferrer" rel="nofollow noreferrer" title="Classical FORTRAN is also on Google Books">Classical FORTRAN</a></strong>, by Michael Kupferschmid</p>\n<p>This book not only shows what one can do with &quot;only&quot; Fortran 77, but it also talks about some of the more subtle issues that arise (e.g., should or should not one use the EXTERNAL declaration). This book doesn\'t exactly cover the same space as &quot;Software Tools&quot; but they are two of the three Fortran programming books that I would tag as &quot;fun&quot;.... (<a href="http://www.seas.gwu.edu/~kaufman1/FortranColoringBook/ColoringBkCover.html" rel="nofollow noreferrer" title="The Fortran Coloring Book">here\'s the third</a>).</p>\n<h2>Miscellaneous Advice that applies to <em>almost</em> every Fortran compiler</h2>\n<ul>\n<li>There is a compiler option to enforce IMPLICIT NONE behavior, which you can use to identify problem routines without modifying them with the IMPLICIT NONE declaration first. This piece of advice won\'t seem meaningful until after the first time a build bombs because of an IMPLICIT NONE command inserted into a legacy routine. (What? Your code review didn\'t catch this? ;-)</li>\n<li>There is a compiler option for array bounds checking, which can be useful when debugging Fortran 77 code.</li>\n<li>Fortran 90 compilers should be able to compile almost all Fortran 77 code and even older Fortran code. Turn on the reporting options on your Fortran 90 compiler, run your legacy code through it and you will have a decent start on syntax checking. Some commercial Fortran 77 compilers are actually Fortran 90 compilers that are running in Fortran 77 mode, so this might be relatively trivial option twiddling for whatever build scripts you have.</li>\n</ul>\n'}, {'answer_id': 309026, 'author': 'jsfain', 'author_id': 39466, 'author_profile': 'https://Stackoverflow.com/users/39466', 'pm_score': 2, 'selected': False, 'text': "<p>I loved FORTRAN, I used to teach and code in it. Just wanted to throw that in. Haven't touched it in years.<br>\nI started out in COBOL, when I moved to FORTRAN I felt I was freed. Everything is relative, yeah?\nI'd second what has been said above - recognise that this is a PROCEDURAL language - no subtelties - so take it as you see it.<br>\nProbably frustrate you to start with.</p>\n"}, {'answer_id': 8818294, 'author': 'J . A. Maruhn', 'author_id': 1143047, 'author_profile': 'https://Stackoverflow.com/users/1143047', 'pm_score': 3, 'selected': False, 'text': "<p>I have used Fortran starting with the '66 version since 1967 (on an IBM 7090 with 32k words of memory). I then used PL/1 for some time, but later went back to Fortran 95 because it is ideally suited for the matrix/complex-number problems we have. I would like to add to the considerations that much of the convoluted structure of old codes is simply due to the small amount of memory available, forcing such thing like reusing a few lines of code via computed or assigned <code>GOTO</code>s. Another problem is optimization by defining auxiliary variables for every repeated subexpression - compilers simply did not optimize for that. In addition, it was not allowed to write <code>DO i=1,n+1</code>; you had to write <code>n1=n+1</code>; <code>DO i=1,n1</code>. In consequence old codes are overwhelmed with superfluous variables. When I rewrote a code in Fortran 95, only 10% of the variables survived. If you want to make the code more legible, I highly recommend looking for variables that can easily be eliminated.</p>\n\n<p>Another thing I might mention is that for many years complex arithmetic and multidimensional arrays were highly inefficient. That is why you often find code rewritten to do complex calculations using only real variables, and matrices addressed with a single linear index.</p>\n"}, {'answer_id': 23568316, 'author': 'Phil Perry', 'author_id': 2433987, 'author_profile': 'https://Stackoverflow.com/users/2433987', 'pm_score': 2, 'selected': False, 'text': '<p>I started on Fortran IV (WATFIV) on punch cards, and my early working years were VS FORTRAN v1 (IBM, Fortran 77 level). Lots of good advice in this thread. </p>\n\n<p>I would add that you have to distinguish between things done to get the beast to run at all, versus things that "optimize" the code, versus things that are more readable and maintainable. I can remember dealing with VAX overlays in trying to get DOE simulation code to run on IBM with virtual memory (they had to be removed and the whole thing turned into one address space). </p>\n\n<p>I would certainly start by carefully restructuring FORTRAN IV control structures to at least FORTRAN 77 level, with proper indentation and commenting. Try to get rid of primitive control structures like ASSIGN and COMPUTED GOTO and arithmetic IF, and of course, as many GOTOs as you can (using IF-THEN-ELSE-ENDIF). Definitely use IMPLICIT NONE in every routine, to force you to properly declare all variables (you wouldn\'t believe how many bugs I caught in other people\'s code -- typos in variable names). Watch out for "premature optimizations" that you\'re better off letting the compiler handle by itself.</p>\n\n<p>If this code is to continue to live and be maintainable, you owe it to yourself and your successors to make it readable and understandable. <em>Just be certain of what you are doing as you change the code!</em> FORTRAN has lots of peculiar constructs that can easily trip up someone coming from the C side of the programming world. Remember than FORTRAN dates back to the mid-late \'50s, when there was no such thing as a science of language and compiler design, just <em>ad hoc</em> hacking together of something (sorry, Dr. B!).</p>\n'}]
['https://Stackoverflow.com/questions/31673', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2514/']