Click to See Complete Forum and Search --> : Compile and Update Source Code


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!

Krishnaa
June 26th, 2007, 08:10 AM
Try

nRemainder=(long)(pow((int)0x10,(int)mByte));

sanko2480
June 27th, 2007, 05:40 PM
Try

nRemainder=(long)(pow((int)0x10,(int)mByte));


The error persist...

Here is the source code maybe you can check

http://www.lobosoft.com.ar/ocx32.rar

Thanks!

Krishnaa
June 28th, 2007, 05:32 AM
Okay, pow has only double/float type first argument, try this,


nRemainder=(long)(pow((double)0x10,mByte));