sanko2480
June 25th, 2007, 10:39 PM
Hi there! I have download a source code to use Midi Functions the code is for an OCX control called midiio_2k.
Now i want to upgrade the version to be compiled with VS C++ 2005. I open the project and VS ask me to upgrade i choose "yes to all" and works fine but when i try to generate i get the error:
Error 15 error C2668: 'pow' : ambiguous call to overloaded function
And also some warnings....
Because i started to learn VC++ (...i am a VB.net Programer) i need to fix that error can you compile the OCX for me and check the error and warnings or how to fix the problem
Error code:
Error 15 error C2668: 'pow' : ambiguous call to overloaded function
long backupdecimal;
short mByte;
long nRemainder;
long nDecimal2;
backupdecimal = nDecimal;
for (mByte = 7; mByte >= 0; mByte--) { // count backwards
nRemainder=(long)(pow(0x10,mByte)); // 0x10000000, 0x1000000, 0x100000, ..., 0x10, 0x1, 0x0
nDecimal2 = nDecimal /nRemainder; // integer portion, fraction is stripped
if (nDecimal2 >= 1) {
csResult = csResult + _hex1(nDecimal2);
nDecimal = nDecimal -(long)(pow(0x10,mByte)) *nDecimal2;
} else if (nDecimal2 == 0 && csResult != "") {
csResult = csResult + "0"; // add trailing zeros
}
}
Thanks!
Now i want to upgrade the version to be compiled with VS C++ 2005. I open the project and VS ask me to upgrade i choose "yes to all" and works fine but when i try to generate i get the error:
Error 15 error C2668: 'pow' : ambiguous call to overloaded function
And also some warnings....
Because i started to learn VC++ (...i am a VB.net Programer) i need to fix that error can you compile the OCX for me and check the error and warnings or how to fix the problem
Error code:
Error 15 error C2668: 'pow' : ambiguous call to overloaded function
long backupdecimal;
short mByte;
long nRemainder;
long nDecimal2;
backupdecimal = nDecimal;
for (mByte = 7; mByte >= 0; mByte--) { // count backwards
nRemainder=(long)(pow(0x10,mByte)); // 0x10000000, 0x1000000, 0x100000, ..., 0x10, 0x1, 0x0
nDecimal2 = nDecimal /nRemainder; // integer portion, fraction is stripped
if (nDecimal2 >= 1) {
csResult = csResult + _hex1(nDecimal2);
nDecimal = nDecimal -(long)(pow(0x10,mByte)) *nDecimal2;
} else if (nDecimal2 == 0 && csResult != "") {
csResult = csResult + "0"; // add trailing zeros
}
}
Thanks!