Hi Ricky,
> DLLInstance = LoadLibrary(CA2W(AVR309DLL)))
>
[quoted text clipped - 8 lines]
> I have tried to use afxloadlibrary and afxfreelibrary, but the
> problem still occurs.
What happens when you call FreeLibrary directly without ever
calling DoSetDataPortDirection?
Are you sure that you use the correct calling convention and
parameters when you call that function? Did you get a header
from the dll manufacturer or do you build the dll yourself?
It might be a bug in the dll as well. When the last FreeLibrary
is called DllMain of that dll is called.
--
SvenC
Ricky Chong - 29 Feb 2008 16:22 GMT
SvenC,
I have called the freelibrary after loadlibrary, the system return the error
message too.
I use the data conversion function CA2W(avr309dll) in the loadlibrary. I 'm
not sure it's correct or not, but the function can be called. And after the
function is finished, error will occurs.
I find the header file from internet, the orginal source code doesn't
include the header file. I have try it in visual basic, it's worked.
And I find that after I run the loadlibrary, the system windows in the
bottom of the screen show the avr309.dll with the symbol "!". Does it mean
that the dll is not loaded correctly?
Thank you,
Ricky
> Hi Ricky,
>
[quoted text clipped - 23 lines]
> --
> SvenC