ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   api call routines (https://www.excelbanter.com/excel-programming/272181-api-call-routines.html)

Bill Lunney

api call routines
 
So when you say you're using DLL's I'm assuming you have something like

Public Function Declare ......

instead of instatiation of a COM object with

CreateObject etc.

That being the case....

The problem with DLL's is they execute 'in proces's. This means the DLL is
brought into the memory space occupied by the Excel process and anything
which goes wrong within the DLL will cause the whole process (Excel
included) to crash & burn. Ok that's the theory of DLL's over, this is just
an explanation of why it's bringing down Excel incase you didn't know.

There's not a lot you can do when calling a DLL. It's a black box and
resource allocation/cleanup etc. will all be handled by it.

I would invest some time in nailing down what circumstances causes the crash
then try to have a think about a workaround. I'd also check to see if there
are any initialisation procedures etc. you have to call prior to execution
of the function.

This is more advanced but another way would be to wrap the call to the DLL
within a COM object itself. A kind of broker object. This would be a COM
exe. That way if the DLL itself crashed it's only going to bring down the
broker and as you instantiate a new one for each call Excel will just carry
on as normal. This would be my choice.


--

Regards,


Bill Lunney
www.billlunney.com

"anthony" wrote in message
...
Hi there

I am using third party DLL files to link my spreadsheets to a cash

register
to download sales files.
The system works fine except that my spreadsheets crash quite often. It
seems that it is loading the DLL files into memory but it is not releasing
it from memory when it has finished.

Is there a command I can use to free the DLL file from memory.

Thank you

Anthony





Tom Ogilvy

api call routines
 
I don't know if this is applicable or not, but it is something you could try
to see if it unloads the DLL and if unloading the DLL makes a difference.


http://support.microsoft.com/default...b;en-us;129514
PRB: Loading and Unloading DLLs in the Design Environment

Code in Excel always runs in design mode.

Regards,
Tom Ogilvy



"anthony" wrote in message
...
Hi there

I am using third party DLL files to link my spreadsheets to a cash

register
to download sales files.
The system works fine except that my spreadsheets crash quite often. It
seems that it is loading the DLL files into memory but it is not releasing
it from memory when it has finished.

Is there a command I can use to free the DLL file from memory.

Thank you

Anthony





anthony

api call routines
 
Hi there

I am using third party DLL files to link my spreadsheets to a cash register
to download sales files.
The system works fine except that my spreadsheets crash quite often. It
seems that it is loading the DLL files into memory but it is not releasing
it from memory when it has finished.

Is there a command I can use to free the DLL file from memory.

Thank you

Anthony




All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com