>>Dan,
>>
>< snip >
>The GetLastError may help you to find a problem.
>
>GetLastError() returned 0.
Did you delare GetLastError before the error? It's poinless do deeclare it after because it clears error code. Also, it has to be run right after the API function call that returns error because error code could be reset by following explicit or implicit API calls.
--sb--