I'm having trouble having multiple DirectX objects.

I have one in my main program that controls the blting.

I also have one in a referanced ActiveX DLL, that loads and stores all the surfaces.

The problem is, when i try to load surfaces from the ActiveX DLL, i get an automation error on CreateSurfaceFromFile. but i don;t get it in the main program.

Any ideas?