[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2002
  • Last Modified:

Generic c++ problems during compile

I am new(er) to c++ and I am having problems compiling inv vs 2005.  My code is below along with the genric error messsages from the complier.  

CODE
-------------
// This is the main DLL file.

#define WIN32_LEAN_AND_MEAN

#include "windows.h"
#include "stdio.h"
#include "stdafx.h"
#include "KC0Mapper.h"
#include "VdjPlugin.h"
#include "vdjDevice.h"

// Mapper class
class KC0DefaultMapper : public IVdjPluginDevice
{
      public:
      KC0DefaultMapper();

      HRESULT __stdcall GetDeviceType(int *type);
      HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
      HRESULT __stdcall OnSlider(int chan,int slider,int absvalue,int relvalue);

};

// Set device type
HRESULT KC0DefaultMapper::GetDeviceType(int *type) {
*type = PLUGINDEVICE_TOTALCONTROL;
return(PLUGINDEVICE_TOTALCONTROL);
}

// Return information about plugin
HRESULT KC0DefaultMapper::OnGetPluginInfo(TVdjPluginInfo *infos)
{
static char st[128];

infos->PluginName = ".";
infos->Author = ".";
infos->Description = ".";
infos->Flag = 0;

infos->Bitmap = LoadBitmap(hInstance,MAKEINTRESOURCE(100));

return S_OK;
}


ERRORS (lots)
--------------------------
------ Build started: Project: TotalControl, Configuration: Debug Win32 ------
Compiling...
TotalControl.cpp
VdjPlugin.h(47) : error C2146: syntax error : missing ';' before identifier 'Bitmap'
VdjPlugin.h(47) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(47) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(48) : error C2146: syntax error : missing ';' before identifier 'Flag'
VdjPlugin.h(48) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(48) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(65) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(65) : error C2433: 'IVdjPlugin::HRESULT' : 'virtual' not permitted on data declarations
VdjPlugin.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(65) : warning C4183: 'OnLoad': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(66) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(66) : error C2433: 'IVdjPlugin::HRESULT' : 'virtual' not permitted on data declarations
VdjPlugin.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(66) : warning C4183: 'OnGetPluginInfo': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(67) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(67) : error C2433: 'IVdjPlugin::ULONG' : 'virtual' not permitted on data declarations
VdjPlugin.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(67) : warning C4183: 'Release': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(71) : error C2059: syntax error : '__stdcall'
VdjPlugin.h(71) : error C2091: function returns function
VdjPlugin.h(71) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(71) : warning C4183: 'HRESULT': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(72) : error C2059: syntax error : '__stdcall'
VdjPlugin.h(72) : error C2091: function returns function
VdjPlugin.h(72) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(72) : error C2556: 'int (__cdecl *IVdjPlugin::HRESULT(void))(char *,void *)' : overloaded function differs only by return type from 'int (__cdecl *IVdjPlugin::HRESULT(void))(char *,int)'
VdjPlugin.h(71) : see declaration of 'IVdjPlugin::HRESULT'
VdjPlugin.h(72) : error C2371: 'IVdjPlugin::HRESULT' : redefinition; different basic types
VdjPlugin.h(71) : see declaration of 'IVdjPlugin::HRESULT'
VdjPlugin.h(72) : warning C4183: 'HRESULT': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(77) : error C2059: syntax error : '__stdcall'
VdjPlugin.h(77) : error C2091: function returns function
VdjPlugin.h(77) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(77) : error C2556: 'int (__cdecl *IVdjPlugin::HRESULT(void))(void *,int,int,char *,int)' : overloaded function differs only by return type from 'int (__cdecl *IVdjPlugin::HRESULT(void))(char *,int)'
VdjPlugin.h(71) : see declaration of 'IVdjPlugin::HRESULT'
VdjPlugin.h(77) : warning C4183: 'HRESULT': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(79) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(79) : error C2433: 'IVdjPlugin::HRESULT' : 'virtual' not permitted on data declarations
VdjPlugin.h(79) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(79) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(79) : warning C4183: 'OnParameter': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(84) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(84) : error C2433: 'IVdjPlugin::HRESULT' : 'virtual' not permitted on data declarations
VdjPlugin.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(84) : error C2061: syntax error : identifier 'HWND'
VdjPlugin.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(84) : warning C4183: 'OnGetUserInterface': missing return type; assumed to be a member function returning 'int'
VdjPlugin.h(85) : error C2146: syntax error : missing ';' before identifier 'hInstance'
VdjPlugin.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(66) : error C2065: 'E_NOTIMPL' : undeclared identifier
VdjPlugin.h(94) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(94) : error C2146: syntax error : missing ';' before identifier 'CLSID_VdjPlugin'
VdjPlugin.h(94) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(94) : error C2078: too many initializers
VdjPlugin.h(106) : error C2143: syntax error : missing ';' before '__stdcall'
VdjPlugin.h(106) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(106) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
VdjPlugin.h(106) : error C2143: syntax error : missing ',' before '&'
VdjPlugin.h(106) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(18) : error C2143: syntax error : missing ';' before '__stdcall'
.\TotalControl.cpp(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(18) : warning C4183: 'GetDeviceType': missing return type; assumed to be a member function returning 'int'
.\TotalControl.cpp(19) : error C2143: syntax error : missing ';' before '__stdcall'
.\TotalControl.cpp(19) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(19) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(19) : warning C4183: 'OnGetPluginInfo': missing return type; assumed to be a member function returning 'int'
.\TotalControl.cpp(20) : error C2143: syntax error : missing ';' before '__stdcall'
.\TotalControl.cpp(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(20) : warning C4183: 'OnSlider': missing return type; assumed to be a member function returning 'int'
.\TotalControl.cpp(25) : error C2143: syntax error : missing ';' before 'KC0DefaultMapper::GetDeviceType'
.\TotalControl.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(25) : error C2086: 'int HRESULT' : redefinition
        VdjPlugin.h(106) : see declaration of 'HRESULT'
.\TotalControl.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(31) : error C2143: syntax error : missing ';' before 'KC0DefaultMapper::OnGetPluginInfo'
.\TotalControl.cpp(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(31) : error C2086: 'int HRESULT' : redefinition
        VdjPlugin.h(106) : see declaration of 'HRESULT'
.\TotalControl.cpp(32) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\TotalControl.cpp(38) : error C2039: 'Flag' : is not a member of 'TVdjPluginInfo'
        VdjPlugin.h(43) : see declaration of 'TVdjPluginInfo'
.\TotalControl.cpp(40) : error C2039: 'Bitmap' : is not a member of 'TVdjPluginInfo'
        VdjPlugin.h(43) : see declaration of 'TVdjPluginInfo'
.\TotalControl.cpp(40) : error C2065: 'hInstance' : undeclared identifier
.\TotalControl.cpp(40) : error C3861: 'LoadBitmap': identifier not found
.\TotalControl.cpp(40) : error C3861: 'MAKEINTRESOURCE': identifier not found
.\TotalControl.cpp(42) : error C2065: 'S_OK' : undeclared identifier
Build log was saved at "file://Debug\BuildLog.htm"
TotalControl - 129 error(s), 23 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
0
makman111
Asked:
makman111
  • 13
  • 5
  • 3
  • +1
1 Solution
 
makman111Author Commented:
Forgot to add the header file vDJPlugin.h

VDJPLUGIN.h
-------------------------------
//////////////////////////////////////////////////////////////////////////
//
// VirtualDJ / Cue
// Plugin SDK
// (c)Atomix Productions 2007
//
//////////////////////////////////////////////////////////////////////////
//
// This file defines the basic functions that are used in all plugins.
// It defines the functions and variables needed to:
// - load and unload a plugin
// - give the infos about the plugin (name, picture, etc)
// - get the parameters automatically saved and restored between loads
// - interact with VirtualDJ (ask queries or send commands)
// - implement a custom interface
//
// Other functions specific to particular types of plugin can be found
// in their respective header file
//
//////////////////////////////////////////////////////////////////////////


#ifndef VdjPluginH
#define VdjPluginH

//////////////////////////////////////////////////////////////////////////
// Platform specific defines for compatibility Mac/Windows
#if defined (MAC)
#define VDJ_EXPORT            __attribute__ ((visibility ("default")))
#define VDJ_BITMAP            char *
#define VDJ_HINSTANCE      void *
#else
#define VDJ_EXPORT            __declspec( dllexport )
#define VDJ_BITMAP            HBITMAP
#define VDJ_HINSTANCE      HINSTANCE
#endif


//////////////////////////////////////////////////////////////////////////
// Standard structures and defines

struct TVdjPluginInfo
{
      char *PluginName;
      char *Author;
      char *Description;
      VDJ_BITMAP Bitmap;
      DWORD Flag;
};

#define VDJPARAM_BUTTON      0
#define VDJPARAM_SLIDER      1
#define VDJPARAM_SWITCH      2
#define VDJPARAM_STRING      3
#define VDJPARAM_CUSTOM      4
#define VDJPARAM_RADIO      5

//////////////////////////////////////////////////////////////////////////
// Base class

class IVdjPlugin
{
public:
      // Initialization
      virtual HRESULT __stdcall OnLoad() {return 0;}
      virtual HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos) {return E_NOTIMPL;}
      virtual ULONG __stdcall Release() {delete this;return 0;}
      virtual ~IVdjPlugin() {}

      // callback functions to communicate with VirtualDJ
      HRESULT (__stdcall *SendCommand)(char *command,int deck); // send a command to VirtualDJ
      HRESULT (__stdcall *GetInfo)(char *query,void *result); // get infos from VirtualDJ

      // parameters stuff
      // call DeclareParameter() for all your variables during OnLoad()
      // if type=VDJPARAM_CUSTOM or VDJPARAM_STRING, defaultvalue must be set to sizeof(*parameter)
      HRESULT (__stdcall *DeclareParameter)(void *parameter,int type,int id,char *name,int defaultvalue);
      // OnParameter will be called each time a parameter is changed from within VirtualDJ
      virtual HRESULT __stdcall OnParameter(int id) {return 0;}

      // Custom user-interface
      // Create a Window using CreateWindow() or CreateDialog(), and send back the HWND.
      // If you return E_NOTIMPL, the default interface will be used.
      virtual HRESULT __stdcall OnGetUserInterface(HWND *hWnd) {return E_NOTIMPL;}
      VDJ_HINSTANCE hInstance;
      int Width,Height;
};

//////////////////////////////////////////////////////////////////////////
// GUID definitions

#ifndef VDJCLASSGUID_DEFINED
#define VDJCLASSGUID_DEFINED
static const GUID CLSID_VdjPlugin = { 0x2e1480fe, 0x4ff4, 0x4539, { 0x90, 0xb3, 0x64, 0x5f, 0x5d, 0x86, 0xf9, 0x3b } };
#else
extern static const GUID CLSID_VdjPlugin;
#endif

//////////////////////////////////////////////////////////////////////////
// DLL export function

#ifndef NODLLEXPORT
#ifdef __cplusplus
extern "C" {
#endif
VDJ_EXPORT HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject);
#ifdef __cplusplus
}
#endif
#endif

//////////////////////////////////////////////////////////////////////////

#endif
0
 
jkrCommented:
'infos' e.g is declared nowhere... are you sure this is the complete code?
0
 
makman111Author Commented:
There are other .h files, but this is the nuts and bolts of it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
makman111Author Commented:
//////////////////////////////////////////////////////////////////////////
//
// VirtualDJ / Cue
// Plugin SDK
// (c)Atomix Productions 2006
//
//////////////////////////////////////////////////////////////////////////
//
// This file defines the external-device custom mapper plugins.
// In addition to all the elements supported from the base IVdjPlugin class,
// it defines additional device-specific functions and variables:
//
//////////////////////////////////////////////////////////////////////////


#ifndef VdjDeviceH
#define VdjDeviceH

#include "VdjPlugin.h"

struct TVdjDeckInfo;

//////////////////////////////////////////////////////////////////////////
// VdjDevice plugin class

class IVdjPluginDevice : public IVdjPlugin
{
public:
      // You must implement this function and return the device type for which this
      // plugin has been written.
      virtual HRESULT __stdcall GetDeviceType(int *type)=0;

      // called when device is initialized
      virtual HRESULT __stdcall OnReset() {return 0;}

      // This function is called each time a button is pressed or depressed
      // (return E_NOTIMPL if you want VirtualDJ to use the default mapper)
      virtual HRESULT __stdcall OnButton(int chan,int button,int down) {return 0;}
      // This function is called each time a knob or slider is moved.
      // absvalue is the absolute position of the slider between 0 and 4096 included.
      // relvalue is the relative movement of this slider, on the same scale.
      virtual HRESULT __stdcall OnSlider(int chan,int slider,int absvalue,int relvalue)
      // This function is called on devices that are compatible with low-latency scratch.
      // return S_OK and VirtualDJ will apply a low-latency scratch automatically.
      // return S_FALSE and OnSlider() will be called the regular way.
      {return 0;}

      virtual HRESULT __stdcall OnScratch(int chan,int *value) {return 0;}

      // This function is called once every 100ms, letting you update the LEDs on the device
      virtual HRESULT __stdcall OnTimer() {return 0;} // 100 ms
      // Call these functions to update the LEDs and display on the device.
      HRESULT (__stdcall *SetLed)(int chan,int n,int value);
      HRESULT (__stdcall *SetDigit)(int chan,int n,int value);
      HRESULT (__stdcall *SetText)(int chan,int n,char *value);
      // This structure gives you direct access to common information useful for LED status.
      // You can call GetInfo() if you need other less common datas.
      TVdjDeckInfo *DeckInfo[2];
      // Leds and Digits sends are buffered. If you need to flush the buffer, use this:
      HRESULT (__stdcall *CommitSends)();

      // An alternative to SendCommand, that lets you specify up and down status (for compat. with previous SDK)
      HRESULT (__stdcall *SendAction)(char *action,char *chan,char *param,int down);

      // extension function and variable for specific-device needs
      void *DeviceSpecificVar;
      HRESULT (__stdcall *DeviceSpecificCall)(int cmd,int param1,void *param2);
};

//////////////////////////////////////////////////////////////////////////
// Structures declarations

struct TVdjDeckInfo
{
      int StructSize; // =72 in current version. Might be expanded in the future
      int Position; // position in number of samples since begining
      int Length; // total number of samples in song (1 sample = 1/44100 second)
      int Status;
      int Playing;
      int Bpm;
      int Pitch;
      int PitchReset;
      int PitchMin,PitchMax;
      int Loop;
      int LoopLength;
      int CuePos,CuePos2,CuePos3;
      int BeatLed;
      int BeatLocked;
      int AutoMix;
      int MixNow;
      int Selected;
      int BassKill,MediumKill,HighKill;
};

//////////////////////////////////////////////////////////////////////////
// Common defines

#define PLUGINDEVICE_XP10                  1
#define PLUGINDEVICE_DJCONSOLE            2
#define PLUGINDEVICE_DMC1                  3
#define PLUGINDEVICE_DVINYL                  4
#define PLUGINDEVICE_DAC3                  5
#define PLUGINDEVICE_BCD2000      6
#define PLUGINDEVICE_ICDX                  7
#define PLUGINDEVICE_DMC2                  8
#define PLUGINDEVICE_TOTALCONTROL      9
#define PLUGINDEVICE_ICUE                  10

//////////////////////////////////////////////////////////////////////////
// GUID definitions

#ifndef VDJDEVICEGUID_DEFINED
#define VDJDEVICEGUID_DEFINED
static const GUID IID_IVdjPluginDevice = { 0xc17ed55e, 0x76b2, 0x4fb7, { 0x99, 0x34, 0xbb, 0xb1, 0xaf, 0xcd, 0x8c, 0x7b } };
#else
extern static const GUID IID_IVdjPluginDevice;
#endif

//////////////////////////////////////////////////////////////////////////

#endif
0
 
makman111Author Commented:
//////////////////////////////////////////////////////////////////////////
//
// VirtualDJ / Cue
// Plugin SDK
// (c)Atomix Productions 2006
//
//////////////////////////////////////////////////////////////////////////
//
// This file defines the external-device custom mapper plugins.
// In addition to all the elements supported from the base IVdjPlugin class,
// it defines additional device-specific functions and variables:
//
//////////////////////////////////////////////////////////////////////////


#ifndef VdjDeviceH
#define VdjDeviceH

#include "VdjPlugin.h"

struct TVdjDeckInfo;

//////////////////////////////////////////////////////////////////////////
// VdjDevice plugin class

class IVdjPluginDevice : public IVdjPlugin
{
public:
      // You must implement this function and return the device type for which this
      // plugin has been written.
      virtual HRESULT __stdcall GetDeviceType(int *type)=0;

      // called when device is initialized
      virtual HRESULT __stdcall OnReset() {return 0;}

      // This function is called each time a button is pressed or depressed
      // (return E_NOTIMPL if you want VirtualDJ to use the default mapper)
      virtual HRESULT __stdcall OnButton(int chan,int button,int down) {return 0;}
      // This function is called each time a knob or slider is moved.
      // absvalue is the absolute position of the slider between 0 and 4096 included.
      // relvalue is the relative movement of this slider, on the same scale.
      virtual HRESULT __stdcall OnSlider(int chan,int slider,int absvalue,int relvalue)
      // This function is called on devices that are compatible with low-latency scratch.
      // return S_OK and VirtualDJ will apply a low-latency scratch automatically.
      // return S_FALSE and OnSlider() will be called the regular way.
      {return 0;}

      virtual HRESULT __stdcall OnScratch(int chan,int *value) {return 0;}

      // This function is called once every 100ms, letting you update the LEDs on the device
      virtual HRESULT __stdcall OnTimer() {return 0;} // 100 ms
      // Call these functions to update the LEDs and display on the device.
      HRESULT (__stdcall *SetLed)(int chan,int n,int value);
      HRESULT (__stdcall *SetDigit)(int chan,int n,int value);
      HRESULT (__stdcall *SetText)(int chan,int n,char *value);
      // This structure gives you direct access to common information useful for LED status.
      // You can call GetInfo() if you need other less common datas.
      TVdjDeckInfo *DeckInfo[2];
      // Leds and Digits sends are buffered. If you need to flush the buffer, use this:
      HRESULT (__stdcall *CommitSends)();

      // An alternative to SendCommand, that lets you specify up and down status (for compat. with previous SDK)
      HRESULT (__stdcall *SendAction)(char *action,char *chan,char *param,int down);

      // extension function and variable for specific-device needs
      void *DeviceSpecificVar;
      HRESULT (__stdcall *DeviceSpecificCall)(int cmd,int param1,void *param2);
};

//////////////////////////////////////////////////////////////////////////
// Structures declarations

struct TVdjDeckInfo
{
      int StructSize; // =72 in current version. Might be expanded in the future
      int Position; // position in number of samples since begining
      int Length; // total number of samples in song (1 sample = 1/44100 second)
      int Status;
      int Playing;
      int Bpm;
      int Pitch;
      int PitchReset;
      int PitchMin,PitchMax;
      int Loop;
      int LoopLength;
      int CuePos,CuePos2,CuePos3;
      int BeatLed;
      int BeatLocked;
      int AutoMix;
      int MixNow;
      int Selected;
      int BassKill,MediumKill,HighKill;
};

//////////////////////////////////////////////////////////////////////////
// Common defines

#define PLUGINDEVICE_XP10                  1
#define PLUGINDEVICE_DJCONSOLE            2
#define PLUGINDEVICE_DMC1                  3
#define PLUGINDEVICE_DVINYL                  4
#define PLUGINDEVICE_DAC3                  5
#define PLUGINDEVICE_BCD2000      6
#define PLUGINDEVICE_ICDX                  7
#define PLUGINDEVICE_DMC2                  8
#define PLUGINDEVICE_TOTALCONTROL      9
#define PLUGINDEVICE_ICUE                  10

//////////////////////////////////////////////////////////////////////////
// GUID definitions

#ifndef VDJDEVICEGUID_DEFINED
#define VDJDEVICEGUID_DEFINED
static const GUID IID_IVdjPluginDevice = { 0xc17ed55e, 0x76b2, 0x4fb7, { 0x99, 0x34, 0xbb, 0xb1, 0xaf, 0xcd, 0x8c, 0x7b } };
#else
extern static const GUID IID_IVdjPluginDevice;
#endif

//////////////////////////////////////////////////////////////////////////

#endif
0
 
jkrCommented:
Still no 'infos'...
0
 
makman111Author Commented:
Where are you seeing the infos?
0
 
makman111Author Commented:
Wouldn't that be under

struct TVdjDeckInfo
{
      int StructSize; // =72 in current version. Might be expanded in the future
      int Position; // position in number of samples since begining
      int Length; // total number of samples in song (1 sample = 1/44100 second)
      int Status;
      int Playing;
      int Bpm;
      int Pitch;
      int PitchReset;
      int PitchMin,PitchMax;
      int Loop;
      int LoopLength;
      int CuePos,CuePos2,CuePos3;
      int BeatLed;
      int BeatLocked;
      int AutoMix;
      int MixNow;
      int Selected;
      int BassKill,MediumKill,HighKill;
};
0
 
Infinity08Commented:
>> Still no 'infos'...

It's here :

        HRESULT KC0DefaultMapper::OnGetPluginInfo(TVdjPluginInfo *infos)

Unless you mean something else.


makman111, can you say what line the first error is referring to ?
0
 
itsmeandnobodyelseCommented:
>>>> makman111, can you say what line the first error is referring to ?
It is

      VDJ_BITMAP Bitmap;

in VdjPlugin.h(47) : error C2146: syntax error : missing ';' before identifier 'Bitmap'

That means that VDJ_BITMAP was not recognized as a valid type.

VDJ_BITMAP was defined abaove as

  #define VDJ_BITMAP            HBITMAP

what implies that HBITMAP was not defined. That is strange as the code of the main dll posted has windows.h included as first statement. However, the module compiled (and where the errors ocuur) was named  

    totalcontrol.cpp

and I was not sure that it is the code that was posted in the original question.

I would suggest to remove the

        #define WIN32_LEAN_AND_MEAN

as it may suppress some definitions of WINAPI (though I doubt that HBITMAP was suppressed).

Then, we would need the code of totalcontrol.cpp where most likely windows.h was not included above the plugin headers.

Regards, Alex




 
0
 
makman111Author Commented:
the code for totalcontrol.cpp is in the main post...
0
 
itsmeandnobodyelseCommented:
>>>> #include "stdafx.h"
That seems to be the reason for not recognizing windows.h include.

If using 'Precompiled Header Option'  (PCH) the compiler replaces *ALL* code from the top and including #include "stdafx.h" with the PCH. In your case it means that

#define WIN32_LEAN_AND_MEAN

#include "windows.h"
#include "stdio.h"

simply were ignored, what most likely leads to the above errors.

You either could switch-off PCH for the project or for totalcontrol.cpp *or* put the #include "stdafx.h" as very first statement in all cpp (above #define WIN32_LEAN_AND_MEAN )  *or* put the statements that are now above *into* stdafx.h.

I personally switch off PCH as the benefits of faster compiling often were accompanied by errors and unrecognized dependencies which is better now than with previous versions of VC but still not transparent.

0
 
makman111Author Commented:
That made a big difference.  Now I only get 1 error (see below)

------ Build started: Project: TotalControl, Configuration: Debug Win32 ------
Compiling...
Stdafx.cpp
Compiling...
TotalControl.cpp
.\TotalControl.cpp(3) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
AssemblyInfo.cpp
Generating Code...
TotalControl - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
0
 
Infinity08Commented:
shouldn't that be :

#include <windows.h>
0
 
Infinity08Commented:
Same for <stdio.h> instead of "stdio.h" btw.
0
 
itsmeandnobodyelseCommented:
Infinity is right. Both windows.h and stdio.h must be included via <> and not ""  (the latter means that the compiler tries to find them in the current or in the project include directories).

The error was not detected before as the PCH option simply ignored any statements above #include stdafx.h

>>>> Now I only get 1 error (see below)
You may got more if correcting it ...  as a #include error stopped compilation ....
0
 
makman111Author Commented:
Still getting

.\TotalControl.cpp(4) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

with <windows.h>
0
 
Infinity08Commented:
Can you show the TotalControl.cpp file you have now ?
0
 
makman111Author Commented:
I found windows.h in
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"

the TotalControl.cpp follows:

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <stdio.h>
#include "stdafx.h"
#include "KC0Mapper.h"
#include "VdjPlugin.h"
#include "vdjDevice.h"

// Mapper class
class KC0DefaultMapper : public IVdjPluginDevice
{
      public:
      KC0DefaultMapper();

      HRESULT __stdcall GetDeviceType(int *type);
      HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
      HRESULT __stdcall OnSlider(int chan,int slider,int absvalue,int relvalue);

};

// Set device type
HRESULT KC0DefaultMapper::GetDeviceType(int *type) {
*type = PLUGINDEVICE_TOTALCONTROL;
return(PLUGINDEVICE_TOTALCONTROL);
}

// Return information about plugin
HRESULT KC0DefaultMapper::OnGetPluginInfo(TVdjPluginInfo *infos)
{
static char st[128];

infos->PluginName = ".";
infos->Author = ".";
infos->Description = ".";
infos->Flag = 0;

infos->Bitmap = LoadBitmap(hInstance,MAKEINTRESOURCE(100));

return S_OK;
}
0
 
makman111Author Commented:
Got it - I needed to register the SDK directories with vc++

tools->options->project and solutions->cv++ directoies
0
 
makman111Author Commented:
Moditerator - can you please split points with Infinity08?
0
 
makman111Author Commented:
All:

I have a related question in a new thread if you are interested:

http://www.experts-exchange.com/Programming/Languages/CPP/Q_22879942.html
0
 
Infinity08Commented:
>> Moditerator - can you please split points with Infinity08?

A few hints for the future :

1) You can split points yourself - just make sure to choose for that option when you assign points

2) If you need something done that you can't do yourself (like modify a point assignment), you can post a 0-point request in the Community Support :

        http://www.experts-exchange.com/Community_Support/General/
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 13
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now