<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Will GetLastError ever work properly in VFP8.0?</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx</link><description>For this post: GetLastError: how does it work with DECLARE DLL ? , I received this question: 
 
 I was sent here by someone from UT regarding a problem I'm having with GetLastError API call. It always returns 0 even if I enter a bogus password to LogonUser</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title> Calvin Hsia s WebLog Will GetLastError ever work properly in VFP8 0 | Insomnia Cure</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#9742024</link><pubDate>Sat, 13 Jun 2009 08:19:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9742024</guid><dc:creator> Calvin Hsia s WebLog Will GetLastError ever work properly in VFP8 0 | Insomnia Cure</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://insomniacuresite.info/story.php?id=2168"&gt;http://insomniacuresite.info/story.php?id=2168&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9742024" width="1" height="1"&gt;</description></item><item><title> Calvin Hsia s WebLog Will GetLastError ever work properly in VFP8 0 | Paid Surveys</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#9653762</link><pubDate>Fri, 29 May 2009 19:13:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9653762</guid><dc:creator> Calvin Hsia s WebLog Will GetLastError ever work properly in VFP8 0 | Paid Surveys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://paidsurveyshub.info/story.php?title=calvin-hsia-s-weblog-will-getlasterror-ever-work-properly-in-vfp8-0"&gt;http://paidsurveyshub.info/story.php?title=calvin-hsia-s-weblog-will-getlasterror-ever-work-properly-in-vfp8-0&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9653762" width="1" height="1"&gt;</description></item><item><title>re: Will GetLastError ever work properly in VFP8.0?</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#589863</link><pubDate>Thu, 04 May 2006 16:30:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:589863</guid><dc:creator>Rodd Harris</dc:creator><description>Hello again Calvin,&lt;br&gt;&lt;br&gt;Okay, i ran the code you had listed and was able to determine why my code wasn't working. &amp;nbsp;It still doesn't make sense to me, but I found it just the same.&lt;br&gt;&lt;br&gt;If I run the exact code that I posted but replace this line:&lt;br&gt;&lt;br&gt;cPass = inputbox(&amp;quot;Password:&amp;quot;)&lt;br&gt;&lt;br&gt;with this one:&lt;br&gt;&lt;br&gt;cPass = &amp;quot;12345&amp;quot;&lt;br&gt;&lt;br&gt;Then I get the proper results. &amp;nbsp;What confuses me though is that inputbox runs BEFORE the LongonUser function but it seems like running the InputBox function before LogonUser causes the results of LogonUser to be wiped out.&lt;br&gt;&lt;br&gt;Any ideas on why this is happening?&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=589863" width="1" height="1"&gt;</description></item><item><title>What API calls reset GetLastError between Declare DLL calls in VFP8?</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#589349</link><pubDate>Wed, 03 May 2006 21:32:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:589349</guid><dc:creator>Calvin Hsia's WebLog</dc:creator><description>I received a comment on this post: Will GetLastError ever work properly in VFP8.0?. &amp;amp;amp;nbsp;I was consistently...&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=589349" width="1" height="1"&gt;</description></item><item><title>re: Will GetLastError ever work properly in VFP8.0?</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#589147</link><pubDate>Wed, 03 May 2006 17:40:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:589147</guid><dc:creator>Rodd Harris</dc:creator><description>Calvin,&lt;br&gt;&lt;br&gt;Thanks for taking time to answer my question ... and I appologize for not posting any code for you .&lt;br&gt;&lt;br&gt;I'm a little stumped though as to how you got things to work in VFP 8.&lt;br&gt;&lt;br&gt;Here is the code I'm running. &amp;nbsp;I've tried this both from a command window as well as from a prg executed from the command window:&lt;br&gt;&lt;br&gt;DECLARE integer GetLastError IN kernel32&lt;br&gt;DECLARE integer CloseHandle IN kernel32 integer hObject&lt;br&gt;DECLARE integer LogonUser IN advapi32 string lpzUser, string lpzDomain, string lpzPass, integer dwLogonType, integer dwLogonProvider, integer @phToken&lt;br&gt;&lt;br&gt;&lt;br&gt;nToken = 0&lt;br&gt;cPass = INPUTBOX(&amp;quot;Password:&amp;quot;)&lt;br&gt;&lt;br&gt;IF LogonUser(&amp;quot;username&amp;quot;,&amp;quot;domain&amp;quot;,cPass,3,0,@nToken) = 0&lt;br&gt; &amp;nbsp; lnResult = GetLastError()&lt;br&gt; &amp;nbsp; = MESSAGEBOX(lnResult)&lt;br&gt;ELSE&lt;br&gt; &amp;nbsp; = MESSAGEBOX(&amp;quot;Success!!&amp;quot;)&lt;br&gt; &amp;nbsp; = CloseHandle(nToken)&lt;br&gt;ENDIF&lt;br&gt;&lt;br&gt;RELEASE ALL&lt;br&gt;CLEAR DLLS&lt;br&gt;&lt;br&gt;RETURN&lt;br&gt;&lt;br&gt;&lt;br&gt;When I run this code with a valid password, great! &amp;nbsp;However, if I run with an invalid password, I consistently get a 0 in lnResult.&lt;br&gt;&lt;br&gt;Is there something I'm doing wrong? &amp;nbsp;I don't see anything that should be clearing the value of GetLastError before I'm storing it. &amp;nbsp;For the most part, the code you posted and what I'm doing are almost identical.&lt;br&gt;&lt;br&gt;Any ideas?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=589147" width="1" height="1"&gt;</description></item><item><title>DECLARE DLL performance questions</title><link>http://blogs.msdn.com/b/calvin_hsia/archive/2006/03/10/549096.aspx#582483</link><pubDate>Tue, 25 Apr 2006 01:14:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:582483</guid><dc:creator>Calvin Hsia's WebLog</dc:creator><description>I was writing a sample about DECLARE DLL to show some of its features which I implemented about 12 years...&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=582483" width="1" height="1"&gt;</description></item></channel></rss>