hi.
i m under mingw32 / XP and i do not arrive to talk with vm116 (that works with demo software).
Led showing discussion stays muted…
I m suspecting an error in my way to talk to K8062D.DLL.
It returns me following infos on t:
Opening returns 2
and setchannelcount 33
Here is my code,any suggestion ?
yours,
extern "C"
{
//VELLEMAN dmx K8062D
typedef int (CALLBACK * LP_VellemanStartDevice) (void);
typedef int (CALLBACK * LP_VellemanSetData)(int VellemanChannel, int VellemanData);
typedef int (CALLBACK * LP_VellemanSetChannelCount)(int VellemanCount);
typedef int (CALLBACK * LP_VellemanStopDevice)(void);
}
//pointeur vers velleman dmx
LP_VellemanStartDevice lp_VellemanStartDevice;
LP_VellemanSetData lp_VellemanSetData;
LP_VellemanSetChannelCount lp_VellemanSetChannelCount;
LP_VellemanStopDevice lp_VellemanStopDevice;
unsigned char DmxBlock[512];
int dmxvelleman_backup[512];
LoadingLib()
{
hLib = LoadLibrary("K8062D.dll");
if (hLib == NULL)
{ set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to load DLL\n%s\nFeednack HLib: %s\n", allegro_error,hLib);
; return(0);
}
lp_VellemanStartDevice = (LP_VellemanStartDevice) GetProcAddress(hLib, "StartDevice");
if (lp_VellemanStartDevice == NULL)
{ set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to open Velleman K8062D GetProcAdress\n%s\nFeedback: %d\n", allegro_error,lp_VellemanStartDevice );
}
lp_VellemanSetData = (LP_VellemanSetData) GetProcAddress(hLib, "SetData");
if (lp_VellemanSetData == NULL)
{ set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to open Velleman K8062D SetData GetProcAdress\n%s\nFeedback: %d\n", allegro_error,lp_VellemanSetData );
}
lp_VellemanSetChannelCount = (LP_VellemanSetChannelCount) GetProcAddress(hLib, "SetChannelCount");
if (lp_VellemanSetChannelCount == NULL)
{ set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to open Velleman K8062D SetChannelCount GetProcAdress\n%s\nFeedback: %d\n", allegro_error,lp_VellemanSetChannelCount );
}
lp_VellemanStopDevice = (LP_VellemanStopDevice) GetProcAddress(hLib, "StopDevice");
if (lp_VellemanStopDevice == NULL)
{ set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to close Velleman K8062D GetProcAdress\n%s\nFeedback: %d\n", allegro_error,lp_VellemanStopDevice );
}
return(0);
}
int OpenInterface()
{
if (lp_VellemanStartDevice != NULL)
{
int iRet = lp_VellemanStartDevice();
if (iRet != 1)
{
set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to open interface, is it PLUGGED ?\n%s\nFeedback : %d\n", allegro_error, iRet);
QuitMidi();return(0);
}
}
if (lp_VellemanSetChannelCount != NULL)
{
int iRet = lp_VellemanSetChannelCount(512);
if (iRet != 1)
{
set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("Impossible to set max chan to interface\n%s\nFeedback : %d\n", allegro_error, iRet);
QuitMidi();return(0);
}
}
return(0);
}
int CloseInterface()
{
if (lp_VellemanStopDevice != NULL)
{
lp_VellemanStopDevice();
}
return(0);
}
int DmxVelleman_SendData()
{
for(int ixx=0;ixx<512;ixx++)
{
if((int)DmxBlock[ixx]!=dmxvelleman_backup[ixx])
{
lp_VellemanSetData(ixx,(int)DmxBlock[ixx]);
dmxvelleman_backup[ixx]=(int)DmxBlock[ixx];
}
}
return(0);
}