Thread: Strange warning from MSVC 6

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    Strange warning from MSVC 6

    d:\msvc 6 projects\dxenginedll\cdxaudio.h(87) : warning C4251: 'Sounds' : class 'std::vector<class CDXSoundSegment,class std::allocator<class CDXSoundSegment> >' needs to have dll-interface to be used by clients of class 'CDXSoundEmitter'
    What does this mean? CDXSoundEmitter is a class that wraps access to IDirectMusicSegment8 and IDirectMusicSegmentState8 interfaces.

    A sound emitter is the method I use to bypass separate audio paths. Each sound emitter controls the entire sound system. Ideally you would have one sound emitter for sound fx and one for digital music if need be. So a sound emitter contains a vector of CDXSoundSegments which represent the actual sounds and their associated data.

    What is MSVC trying to tell me here?
    I'm using this code to compile the DLL.

    DllCheck.h
    Code:
    #ifndef DllCheck_H
    #define DllCheck_H
    
    #ifdef _INSIDEDLL
    #define XTREME_DLL_DECL  __declspec(dllexport)
    #else
    #define XTREME_DLL_DECL __declspec(dllimport)
    #endif
    
    #endif
    Test.h
    Code:
    #ifndef Test_H
    #define Test_H
    
    #include "DllCheck.h"
    
    class XTREME_DLL_DECL Test
    {
    };
    
    #endif
    Then when I create the DLL and import library, I simply set the preprocessor options to define _INSIDEDLL and the XTREME_DLL_DECL becomes the export version. For the application using the class, it will not define this and therefore the XTREME_DLL_DECL becomes the import version.

    Then to use the import library you simply add it to the link section, include the right headers, and it works just like any other library.

    I'm switching the editor in MFC to use the actual engine view instead of a GDI one. It's easier and I don't have to mess around with GDI, DC's, etc, etc.

    The graphics engine will Initialize Direct3D in two ways. It can use either fullscreen or windowed mode and it also allows you to create a window for it. You simply set a boolean flag and it will use the HWND you supply it as the window handle and it won't create one for you. This allows me to specify any window I want which is quite nice for making editors. The InitD3D function also returns a pointer to a valid IDirect3DDevice9 so I can also draw inside of the window w/o using the engine to do so. I had to alter the render loop setup to get it to work and mess with the WndProc a bit, but it seems to be ok.

    This warning bothers me though.

    Using D3D to render for the editor is so nice because the map makers and level editors get a first-hand look at what everything will look like as they are creating them. Communicating to the engine from MFC is simple as well. So I get the benefits of a nice MFC GUI with a D3D renderer window.

    For scrolling I intercept the WM_SCROLL messages and tell the appropriate class in the engine to scroll the view and by what amounts. The actual window doesn't do any scrolling.
    Last edited by VirtualAce; 03-26-2006 at 04:52 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM