Silverfrost Forums

Welcome to our forums

runtime error in DLL containing ClearWin code

9 Dec 2008 9:29 #4083

I am calling a DLL (compiled with FTN95, contains a lot of calculations) from an Excel spreadsheet, and this works fine. However, I decided to display a window at the start of the main fortran routine, with info about the version, contact, author, etc., using a fomat window.

When the spreadsheet is loaded, the first call to the DLL works fine, displaying the window and doing the calculations. However, the second call shows a runtime error window, with the following message:

unable to register class SalfordDialog.

Pressing OK then closes the spreadsheet.

Any idea what is wrong with this approach?

Roger

9 Dec 2008 10:03 #4084

I do not know why this happens but you may be able to avoid the problem by finding a way to call the Windows API function LoadLibrary in order to keep salflibc.dll loaded. You should also call FreeLibrary afterwards.

9 Dec 2008 10:19 #4085

Done what you suggested, and it is running correctly now.

Many thanks for your help

Roger

Please login to reply.