netserv
01-30-2015, 11:49 AM
Hi Jean Luc !
I have a small problem with the API, in my dll.
when i want to pass a switch event, calling back the switch routine, i get an error message from hardware connect. "there was an error.... in FastTimer"
Maybe i do not have a correct entry point for the switch routine. But i think not. The message comes from your Hardare Connect routine, I guess.
Probably there are invalid parameters passed. I realized this in C++ (visual studio) All seems to work fine with hardware connect, except this.
I think it could be a question of parameter transfer, maybe there is a different notation for Pascal necessary?
at startup I get the procedure address as documented with:
SW_PROC = proc;
then i call SW_PROC inside the fastTimer routine as below:
int __stdcall FastTimer(void)
{
int inptCodeNr;
int inptValue;
int inptType;
devicelib::funcs::USB_Poll(&inptType, &inptCodeNr, &inptValue);
if (inCodeNr)
{
// got new data
if (inptType==MOD_DIGITAL)
{
// send data to switch input routine
SW_PROC(inCodeNr,inValue); // <----- here is the problem
}
}
}
Question: is the 'int' parameter in this case expected as signed or as unsigned?
So this is C++, maybe Pascal expects parameter passing in a different way.....
Also tried to pass constants, same effect.
any idea?
Guenther
http://a320.at
I have a small problem with the API, in my dll.
when i want to pass a switch event, calling back the switch routine, i get an error message from hardware connect. "there was an error.... in FastTimer"
Maybe i do not have a correct entry point for the switch routine. But i think not. The message comes from your Hardare Connect routine, I guess.
Probably there are invalid parameters passed. I realized this in C++ (visual studio) All seems to work fine with hardware connect, except this.
I think it could be a question of parameter transfer, maybe there is a different notation for Pascal necessary?
at startup I get the procedure address as documented with:
SW_PROC = proc;
then i call SW_PROC inside the fastTimer routine as below:
int __stdcall FastTimer(void)
{
int inptCodeNr;
int inptValue;
int inptType;
devicelib::funcs::USB_Poll(&inptType, &inptCodeNr, &inptValue);
if (inCodeNr)
{
// got new data
if (inptType==MOD_DIGITAL)
{
// send data to switch input routine
SW_PROC(inCodeNr,inValue); // <----- here is the problem
}
}
}
Question: is the 'int' parameter in this case expected as signed or as unsigned?
So this is C++, maybe Pascal expects parameter passing in a different way.....
Also tried to pass constants, same effect.
any idea?
Guenther
http://a320.at