<?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 Re: Using a Fortan DLL in VB that has a STOP command in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803090#M38763</link>
    <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I am also working with a program that was written in Fortran and we recently completed conversion to a DLL.&lt;BR /&gt;&lt;BR /&gt;The program is littered with STOP statements and we need to remove them so that we can exit the program gracefully with error information being provided to the user. We can make changes to the source code to accommodate this change.&lt;BR /&gt;&lt;BR /&gt;The only catch to this is a lot of the STOP statements are in functions and I need a way to catch an error in the function and pass an error code back to the calling routine.&lt;BR /&gt;&lt;BR /&gt;Would it possible to use the RESULT variable when calling the function?&lt;BR /&gt;&lt;BR /&gt;What would I do in the case of a logical function? how would I pass an error code value back from this?&lt;BR /&gt;&lt;BR /&gt;Any help is greatly appreciated</description>
    <pubDate>Mon, 18 Apr 2005 22:52:40 GMT</pubDate>
    <dc:creator>themadcapz</dc:creator>
    <dc:date>2005-04-18T22:52:40Z</dc:date>
    <item>
      <title>Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803057#M38730</link>
      <description>I am looking for a suggestion on how to handle the following problem.  My dll file is running older Fortran code that on a error goes to an error handling subroutine that uses the STOP function to end the program.  This inturn closes my VB application.  I would like the VB application to stay open so i can read my error file and report it.  Thanks</description>
      <pubDate>Tue, 21 Jan 2003 05:05:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803057#M38730</guid>
      <dc:creator>alanbcole</dc:creator>
      <dc:date>2003-01-21T05:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803058#M38731</link>
      <description>There's nothing you can do about this that I can think of (other than to remove the STOP, which doesn't belong in a DLL anyway.)&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 21 Jan 2003 05:40:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803058#M38731</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2003-01-21T05:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803059#M38732</link>
      <description>The reason the stop was there originally(wasn't alway's a DLL)was that the error routine could be call many times when was only needed once.  I have found that it could get stuck in a infinite loop.  I am stuck as to how to handle this.  The original code was purchased code for my company and i was told that i could not change the code itself.  Any ideas would be appreciated.</description>
      <pubDate>Tue, 21 Jan 2003 05:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803059#M38732</guid>
      <dc:creator>alanbcole</dc:creator>
      <dc:date>2003-01-21T05:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803060#M38733</link>
      <description>You have no choice - you have to remove the STOP.  There is &lt;B&gt;nothing&lt;/B&gt; you can do in the VB code that I know of to prevent the program from exiting.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 21 Jan 2003 08:43:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803060#M38733</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2003-01-21T08:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803061#M38734</link>
      <description>You could try wrapping your DLL in some C++ with all calls protected by ter...catch blocks, but I'm not sure even that would work, since the STOP would probably take down your wrapper DLL, which would take down your application. According to the documentation STOP 'terminates program execution' - just like you hit Alt+F4</description>
      <pubDate>Wed, 22 Jan 2003 01:10:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803061#M38734</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-22T01:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803062#M38735</link>
      <description>"I would like the VB application to stay open so i can read my error file and report it. "&lt;BR /&gt;&lt;BR /&gt;... why not just always start a second application, read the file and report it if there are errors ? (e.g. starting both applications from a batch file) Or write an application which will kick off your VB process, wait for termination, and then read and process any error file.&lt;BR /&gt;&lt;BR /&gt;David Jones</description>
      <pubDate>Wed, 22 Jan 2003 02:08:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803062#M38735</guid>
      <dc:creator>david_jones</dc:creator>
      <dc:date>2003-01-22T02:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803063#M38736</link>
      <description>I would change the Fortran code, so that it doesn't change what it is really trying to do when you hit the STOP line.  Set up a return flag, and then Return instead of stopping.  Essentially ending the processing in the .dll in a graceful way under your control.  In effect, doing the same thing this program did before it was a .dll.&lt;BR /&gt;&lt;BR /&gt;When you were told not to change the Fortran code, hopefully this wouldn't be considered a prohibitive change.  Unless you are working for a pointy-haired boss, in which case you should spend a lot of money trying to resolve this problem and never quite getting there.  After all, you must have had to make similar, non-substantive changes to get this to be a .dll callable from VB.</description>
      <pubDate>Wed, 22 Jan 2003 03:32:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803063#M38736</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-22T03:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803064#M38737</link>
      <description>Agreed. As a curiosity, how typically is a STOP statement implemented in Windows? Given that the Fortran standard is unlikely to even acknowledge Windows, is there any chance that CVF(/IVF) could warn of the presence of a STOP in a DLL? That way the STOP could be replaced by a RaiseException(EXCEPTION_NONCONTINUABLE_EXCEPTION,...), say, which can be handled and logged by the DLL using C++/SEH?&lt;BR /&gt;&lt;BR /&gt;Ciao,&lt;BR /&gt;Gerry T.</description>
      <pubDate>Thu, 23 Jan 2003 20:38:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803064#M38737</guid>
      <dc:creator>gfthomas8</dc:creator>
      <dc:date>2003-01-23T20:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803065#M38738</link>
      <description>Probably it's just a wrapper around ExitProcess.</description>
      <pubDate>Thu, 23 Jan 2003 21:13:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803065#M38738</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2003-01-23T21:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803066#M38739</link>
      <description>I don't think CVF has any way of knowing the code is in a DLL.  I believe ExitProcess is indeed what is used.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 23 Jan 2003 22:30:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803066#M38739</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2003-01-23T22:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803067#M38740</link>
      <description>Steve, I thought Gerry meant that if you were compileing a DLL with CVF/IVF, then the compiler could warn you, and suggest (implement?) alternatives...</description>
      <pubDate>Thu, 23 Jan 2003 22:48:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803067#M38740</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-23T22:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803068#M38741</link>
      <description>Well, there's _DLL symbol automagically !DEC$DEFINEd for one...&lt;BR /&gt;&lt;BR /&gt;But personally, I don't like the idea; sounds too picky and partial warning to me. It's as if "Warning: don't use POINTER-valued functions because they're prone to memory leaks". There's a thousand things where a careless programmer could err -- I don't think it's 100% compiler's business to spot each and every. &lt;BR /&gt;&lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 23 Jan 2003 23:57:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803068#M38741</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2003-01-23T23:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803069#M38742</link>
      <description>Jugoslav,&lt;BR /&gt;&lt;BR /&gt;True in the majority of cases, but can you really think of a legit use for STOP in a DLL?&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Fri, 24 Jan 2003 00:09:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803069#M38742</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-24T00:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803070#M38743</link>
      <description>Well, probably no; but, to extend my point, can you think of legit use for:&lt;BR /&gt;&lt;BR /&gt;EXIT()&lt;BR /&gt;ExitProcess()&lt;BR /&gt;TerminateProcess()&lt;BR /&gt;ExitThread()&lt;BR /&gt;TerminateThread()&lt;BR /&gt;PAUSE&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;as well... I assure you I'm able to write more horrid things than calling that from a dll, but I don't expect from the compiler to tell me I'm an idiot :-). &lt;BR /&gt;&lt;BR /&gt;Jugoslav</description>
      <pubDate>Fri, 24 Jan 2003 00:36:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803070#M38743</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2003-01-24T00:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803071#M38744</link>
      <description>Alan:&lt;BR /&gt;&lt;BR /&gt;Here's an outline of how to get rid of a STOP in a CVF DLL. It works, but use it at your peril.&lt;BR /&gt;&lt;BR /&gt;The idea is to replace the STOP in your CVF DLL source by a less heavy-handed action that doesn't kill your VB client. You do this, not by changing the DLL source (say the file StopIt.f90 contains the STOP), but rather its corresponding asm (StopIt.asm) which you edit (to get rid of the STOP, replacing it with a RaiseException API call), recompile with ML.EXE (Microsoft assembler 6.11d) and whose output (StopIt.obj without the STOP) you add to your project. Now rebuild your DLL in the usual way and you'll be off to the races, eventually...&lt;BR /&gt;&lt;BR /&gt;Some tips:&lt;BR /&gt;-Try this on a test DLL;&lt;BR /&gt;-In Settings/Fortran/Listing Files, check asm and source;&lt;BR /&gt;-When you have StopIt.asm add it to the project _and_ remove StopIt.f90 since you're done with it and it's unchanged from the original;&lt;BR /&gt;-In StopIt.asm, the STOP is _for_stop_core: change it to _RaiseException and stick in a 'use kernel32' if it's not already present. Replace the STOP assembly statements with those appropriate to RaiseException;&lt;BR /&gt;-Recompile StopIt.asm using ML from the command line,&lt;BR /&gt;eg, ml /c /Cp /coff /Zm StopIt.asm;&lt;BR /&gt;-When you've regenerated StopIt.obj (sans STOP), add it to your project. Rebuild your DLL;&lt;BR /&gt;-In raising an exception, it falls through the cracks to VB which at least has the Err object, whereas Fortran has nothing other than STOP, for error handling;&lt;BR /&gt;-If the exception you raise is not handled by VB's Err object, then make it so via&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://archive.devx.com/premier/mgznarch/vbpj/1999/05may99/bb0599.pdf" target="_blank"&gt;http://archive.devx.com/premier/mgznarch/vbpj/1999/05may99/bb0599.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-If all this seems daunting, it's not;&lt;BR /&gt;-Good luck.&lt;BR /&gt;&lt;BR /&gt;BTW, the only thing worse than a STOP in a CVF DLL (that hasn't allocated a console) is a PAUSE. Try it to test your reflexes (but save your data beforehand).&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Gerry T.</description>
      <pubDate>Sat, 25 Jan 2003 00:41:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803071#M38744</guid>
      <dc:creator>gfthomas8</dc:creator>
      <dc:date>2003-01-25T00:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803072#M38745</link>
      <description>Gerry...wow! ;o)&lt;BR /&gt;&lt;BR /&gt;Seems like it'd be easier to just edit the code, especially if you have it to hand!&lt;BR /&gt;&lt;BR /&gt;Incidently, can you get at _control87 / _status87 / _clear87 from VB? You could handle just about anything in FORTRAN then (with the right compiler options)</description>
      <pubDate>Sat, 25 Jan 2003 01:00:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803072#M38745</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-25T01:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803073#M38746</link>
      <description>&amp;gt; Seems like it'd be easier to just edit the code,&lt;BR /&gt;&amp;gt; especially if you have it to hand!&lt;BR /&gt;&lt;BR /&gt;I agree. But sometimes one has to apply desperate measures. BTW, you can use the same strategy to statically link CVF to VB. See&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://archive.devx.com/upload/free/features/vbpj/1999/11nov99/jc1199/jc1199.asp" target="_blank"&gt;http://archive.devx.com/upload/free/features/vbpj/1999/11nov99/jc1199/jc1199.asp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; Incidently, can you get at _control87 / _status87 /&lt;BR /&gt;&amp;gt; _clear87 from VB? You could handle just about&lt;BR /&gt;&amp;gt; anything in FORTRAN then (with the right compiler&lt;BR /&gt;&amp;gt; options)&lt;BR /&gt;&lt;BR /&gt;I had this in a C/C++ DLL but the code is long frozen and not readily accessible to me. Lately I use CVF to export these functions for VB use and if I get time this week I'll post the details.&lt;BR /&gt;&lt;BR /&gt;Ciao,&lt;BR /&gt;Gerry T.&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jan 2003 20:19:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803073#M38746</guid>
      <dc:creator>gfthomas8</dc:creator>
      <dc:date>2003-01-27T20:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803074#M38747</link>
      <description>Gerry,&lt;BR /&gt;&lt;BR /&gt;That would be cool. My interest is more from a mixed language point of view though. Our current error handling set-up is something of a bastardisation!&lt;BR /&gt;&lt;BR /&gt;I don't think we have the correct FORTRAN compiler options, because a direct call from C++ can result in an exception that is handled in the C++ layer, but if the FORTRAN nests, or recurses, FP errors aren't thrown back to the C++ properly (i.e. aren't thrown back at all). This often results in Infinities and NaNs propagating around the system, which generally bolloxs everything :)</description>
      <pubDate>Mon, 27 Jan 2003 20:45:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803074#M38747</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2003-01-27T20:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803075#M38748</link>
      <description>&amp;gt; &lt;BR /&gt;&amp;gt; Incidently, can you get at _control87 / _status87 /&lt;BR /&gt;&amp;gt; _clear87 from VB? You could handle just about&lt;BR /&gt;&amp;gt; anything in FORTRAN then (with the right compiler&lt;BR /&gt;&amp;gt; options)&lt;BR /&gt;&lt;BR /&gt;Dan:&lt;BR /&gt;&lt;BR /&gt;Here's how. Add a MyCVFDLL.def file to your CVF project and in it put:&lt;BR /&gt;&lt;BR /&gt;;DEF file&lt;BR /&gt;LIBRARY for MyCVFDLL&lt;BR /&gt;&lt;BR /&gt;EXPORTS&lt;BR /&gt;;	Function		Ordinal&lt;BR /&gt;;       --------		-------&lt;BR /&gt;;F95 exports (list these here)&lt;BR /&gt;&lt;BR /&gt;;C exports&lt;BR /&gt;	Clearfpu		@6&lt;BR /&gt;	fpClass			@7&lt;BR /&gt;	fpNaN			@8&lt;BR /&gt;	fpFinite		@9&lt;BR /&gt;	Statusfpu		@10&lt;BR /&gt;	SetControlfpu		@11&lt;BR /&gt;	GetControlfpu		@12&lt;BR /&gt;&lt;BR /&gt;(Note: the symbol and its ordinal @? are separated by a tab stop).&lt;BR /&gt;&lt;BR /&gt;Add the following .c file to your project:&lt;BR /&gt;&lt;BR /&gt;#include &lt;WINDOWS.H&gt;&lt;BR /&gt;#include &lt;FLOAT.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;OLE2.H&gt;&lt;BR /&gt;#ifdef _WIN32&lt;BR /&gt;#define CCONV __stdcall&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;int CCONV SetControlfpu(unsigned int nu, unsigned int mask)&lt;BR /&gt;{&lt;BR /&gt;	unsigned int j;&lt;BR /&gt;	// Set fp control word &lt;BR /&gt;	j= _control87( nu, mask);&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV GetControlfpu(void)&lt;BR /&gt;{&lt;BR /&gt;	unsigned int j;&lt;BR /&gt;	// Get current fp control word&lt;BR /&gt;    j = _control87(0, 0);&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV Clearfpu(void)&lt;BR /&gt;{&lt;BR /&gt;	unsigned int j;&lt;BR /&gt;	// Get and clear fp status word&lt;BR /&gt;    j = _clear87();&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV Statusfpu(void)&lt;BR /&gt;{&lt;BR /&gt;	unsigned int j;&lt;BR /&gt;	// Get fp status word&lt;BR /&gt;	j= _status87();&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV fpClass(double x)&lt;BR /&gt;{&lt;BR /&gt;	int j;&lt;BR /&gt;	// Get status word of the fp class of x&lt;BR /&gt;	j = _fpclass(x);&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV fpNaN(double x)&lt;BR /&gt;{&lt;BR /&gt;	int j;&lt;BR /&gt;	// Check if x is NaN - returns &amp;gt;0 if TRUE &lt;BR /&gt;	j = _isnan(x);&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int CCONV fpFinite(double x)&lt;BR /&gt;{&lt;BR /&gt;	int j;&lt;BR /&gt;	// Check if x is finite (including zero) - returns &amp;gt;0 if TRUE&lt;BR /&gt;	j = _finite(x);&lt;BR /&gt;	return (j);&lt;BR /&gt;}&lt;BR /&gt; etc, etc,...&lt;BR /&gt;&lt;BR /&gt;Compile the dll and view its dependencies to see the exports. Look in the VC++ docs for usage of these exports from VB.&lt;BR /&gt;&lt;BR /&gt;To use the functions in fortran, supply an interface for for each function: eg,&lt;BR /&gt;&lt;BR /&gt;interface &lt;BR /&gt;integer(4) function Clearfp [C, ALIAS:'__clearfp'] ()&lt;BR /&gt;end function Clearfp&lt;BR /&gt;end interface&lt;BR /&gt;&lt;BR /&gt;integer(4) status&lt;BR /&gt;&lt;BR /&gt;status = Clearfp()&lt;BR /&gt;&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;As far as mixed language exception handling goes, I follow the CVF docs and samples, but I do the error handling in Fortran not C/C++. Works fine.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Gerry T.&lt;/OLE2.H&gt;&lt;/STDIO.H&gt;&lt;/FLOAT.H&gt;&lt;/WINDOWS.H&gt;</description>
      <pubDate>Thu, 06 Feb 2003 04:24:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803075#M38748</guid>
      <dc:creator>gfthomas8</dc:creator>
      <dc:date>2003-02-06T04:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Fortan DLL in VB that has a STOP command</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803076#M38749</link>
      <description>very easily (sorry steve)&lt;BR /&gt;&lt;BR /&gt;replace the stop by&lt;BR /&gt;i=0&lt;BR /&gt;i=i/0&lt;BR /&gt;&lt;BR /&gt;and put an &lt;BR /&gt;on error resume next &lt;BR /&gt;before your call to the dll&lt;BR /&gt;and test for an integer div by zero after.&lt;BR /&gt;&lt;BR /&gt;Works like charm.</description>
      <pubDate>Sat, 15 Feb 2003 07:55:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-a-Fortan-DLL-in-VB-that-has-a-STOP-command/m-p/803076#M38749</guid>
      <dc:creator>billaustralia</dc:creator>
      <dc:date>2003-02-15T07:55:07Z</dc:date>
    </item>
  </channel>
</rss>

