<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Identical Code (Doesn't throw errors in either) - Works in VB, Doesn't in .NET in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416417#M11196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd take a look at the System.Diagnostics.Process.Start static method, that way you wouldn't have to hardwire for a particular browser.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dotnetperls.com/process-start-examples-vbnet"&gt;http://dotnetperls.com/process-start-examples-vbnet&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Apr 2010 18:39:48 GMT</pubDate>
    <dc:creator>KirkKuykendall</dc:creator>
    <dc:date>2010-04-15T18:39:48Z</dc:date>
    <item>
      <title>Identical Code (Doesn't throw errors in either) - Works in VB, Doesn't in .NET</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416415#M11194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ran across a great ArcScript that opens an .exe from inside ArcMap, which is exactly what I needed. The example says to create a UI button, drop the code into a module, and then call the subroutine in the OnClick event. POOF! Works like a charm. I'm excited, but I need to get this into a .dll, because I have to deploy it on many, many machines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I go to vs2005. I create a new Class Library, add the proper references, let the wizard generate the necessary information and so on and so on. Then I add the code, which looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Const SW_SHOW = 1 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Const SW_SHOWMAXIMIZED = 3 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ByVal hwnd As Long, _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ByVal lpOperation As String, _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ByVal lpFile As String, _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ByVal lpParameters As String, _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ByVal lpDirectory As String, _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ByVal nShowCmd As Long) As Long &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub RunMozillaFirefox() &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim RetVal As Long &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error Resume Next &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RetVal = ShellExecute(0, "open", "C:\Program Files\Mozilla Firefox\firefox.exe", "www.google.com", _ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"", SW_SHOWMAXIMIZED) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and call RunMozillaFirefox in the OnClick subroutine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I go to ArcMap, hit "Tools --&amp;gt; Customize --&amp;gt; Commands&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My command is there! Now I'm getting really excited.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I drag the command onto a toolbar, click on it, and... nothing. nada. zero, zip, zilch.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody tell me why this code works when its placed in a module, but not when its compiled as part of a .dll?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Justin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 16:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416415#M11194</guid>
      <dc:creator>JustinRiggs</dc:creator>
      <dc:date>2010-04-15T16:35:09Z</dc:date>
    </item>
    <item>
      <title>Identical Code (Doesn't throw errors in either) - Works in VB, Doesn't in .NET</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416416#M11195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One possibility is your Declare statement for the API call.&amp;nbsp; In VB6/VBA, a Long is a 32-bit integer.&amp;nbsp; In VB.NET, a Long is a 64-bit integer.&amp;nbsp; You should change the Declare statement to use Integer or Int32 instead of Long.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 17:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416416#M11195</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-04-15T17:20:30Z</dc:date>
    </item>
    <item>
      <title>Identical Code (Doesn't throw errors in either) - Works in VB, Doesn't in .NET</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416417#M11196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd take a look at the System.Diagnostics.Process.Start static method, that way you wouldn't have to hardwire for a particular browser.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dotnetperls.com/process-start-examples-vbnet"&gt;http://dotnetperls.com/process-start-examples-vbnet&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 18:39:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416417#M11196</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-04-15T18:39:48Z</dc:date>
    </item>
    <item>
      <title>Ding! Ding! Ding!</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416418#M11197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil, you're a life saver. That worked a charm. Thanks much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 18:57:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416418#M11197</guid>
      <dc:creator>JustinRiggs</dc:creator>
      <dc:date>2010-04-15T18:57:01Z</dc:date>
    </item>
    <item>
      <title>Good advice...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416419#M11198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kirk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the advice on that. I'm not actually using Firefox - that was just the code from the ArcScript example. I'm opening an application (or several, actually - like Word, Excel, and then my custom app). I'll check out the method anyway. I need to start learning how to use the documentation better anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Justin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 18:59:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/identical-code-doesn-t-throw-errors-in-either/m-p/416419#M11198</guid>
      <dc:creator>JustinRiggs</dc:creator>
      <dc:date>2010-04-15T18:59:26Z</dc:date>
    </item>
  </channel>
</rss>

