VB C++ DirectX and COM 
Author Message
 VB C++ DirectX and COM

I am working in VB and another team are working in C++. How can I use a pure COM
pointer created within their DLL?

The pointers are IDirectDraw7, and two IDirectDrawSurface7 pointers for the
primary back buffer. As soon as I try and use them in VB (in place of DirectDraw7
and DirectDrawSurface7) the program crashes.

There seems to be a type mismatch between the pointer provided by the C++
interface of DirectDraw7 and the VB interface of DirectDraw7. I need to use the
instance of DirectDraw7 from the DLL but I want to use it

In the code extract below dd comes from the DLL. The program stops at ->.

        Dim SurfaceDescription As DDSURFACEDESC2

        SurfaceDescription.lFlags = DDSD_CAPS
        SurfaceDescription.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN

        FindMediaDir FileName

->           Set m_Surface = dd.CreateSurfaceFromFile(FileName, SurfaceDescription)

So the dd is an IDirectDraw7 pointer created in C++ which I want to use in VB.



Fri, 08 Aug 2003 04:26:23 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB C++ DirectX and COM

2. Using VB COM Objects in Visual C++ 5

3. C++ COM obj in VB

4. Using events in VB from a C++ COM object

5. COM/COM+ in VB or C++

6. error after closing c++ com used by vb

7. VB call C++ COM.

8. VB & C++ COM Components Talking

9. Call C++ Routines in VB COM

10. Querying COM Interfaces From VB Like You Can In C++

11. Calling a C++ COM object from a VB program

12. com clarification please c++/vb

 

 
Powered by phpBB® Forum Software