C++ 编译Polar软件平台在VS2013中不起作用

C++ 编译Polar软件平台在VS2013中不起作用,c++,visual-studio,C++,Visual Studio,我正在做一个项目,需要用IRda从极性心率设备读取数据。Polar有一个通信dll和一些我从他们的网站下载的示例源代码。它说它是用VSV6.0编译的。我没有那个编译器,VS2013会抛出很多编译错误 这组文件包括:hrmcom.dll、hrmcom.h、hrmcom.lib、HRMComRSCS.h 我正在寻找一种在VS6.0模式下编译源代码的方法。最新的VS有可能吗?我不是一个从零开始使用交付的dll和/或lib的优秀程序员。它只有关于接口的文档和使用上述文件的示例源代码。我搜索了类似的Q,但

我正在做一个项目,需要用IRda从极性心率设备读取数据。Polar有一个通信dll和一些我从他们的网站下载的示例源代码。它说它是用VSV6.0编译的。我没有那个编译器,VS2013会抛出很多编译错误

这组文件包括:hrmcom.dll、hrmcom.h、hrmcom.lib、HRMComRSCS.h

我正在寻找一种在VS6.0模式下编译源代码的方法。最新的VS有可能吗?我不是一个从零开始使用交付的dll和/或lib的优秀程序员。它只有关于接口的文档和使用上述文件的示例源代码。我搜索了类似的Q,但没有一个版本可以追溯到现在

有什么建议吗?我是不是走到了死胡同

编辑: 下面是示例源代码

void fnPolarSampleConnection (HWND hWnd)
{
POLAR_SSET_GENERAL  psg;
POLAR_SSET_MONITORINFO  psmi;
POLAR_EXERCISEFILE  pef;
int             iSamplingRate, i, iTotal, iHR, iSpeed;
TCHAR               tcFile[MAX_PATH];

if (!fnHRMCom_ResetIRCommunication (0))
{
    // Resetting IR connection was not successful
    break;
}

if (!fnHRMCom_StartIRCommunication (HRMCOM_PARAM_IRDA, ”IR”))
{
    // Port couldn't be opened, stop connection thread
    fnHRMCom_EndIRCommunication (FALSE);
    break;
}

// Fill general information
ZeroMemory (&psg, sizeof(psg));

psg.iSize          = sizeof (psg);
psg.iConnection    = HRMCOM_CONNECTION_IR;
psg.bConnectionDlg = TRUE;
psg.hOwnerWnd      = hWnd;  // Owner window handle

// Reset monitor information
ZeroMemory (&psmi, sizeof(psmi));

// Read monitor info from HR monitor
if (!fnHRMCom_ReadMonitorInfo (&psg, &psmi))
{
    // Reading failed, close connection
    fnHRMCom_EndIRCommunication (FALSE);
    break;
}

for (i = 0; i < psmi. iTotalFiles; i++)
 {
 if (!fnHRMCom_ReadExerciseFile (hDlg, i, FALSE))
 {
// Save analyzed file as HRM
ZeroMemory (&szFile, sizeof (szFile));
strcpy (szFile, ”c:\\temp\\exercise.hrm”);

if (!fnHRMCom_SaveExerciseHRM (hDlg, szFile, 0))
{
            // Saving failed...
}

// Read sampling (recording) rate
iSamplingRate = fnHRMCom_GetRecParam (REC_SAMPLING_RATE);

// Read total number of samples
iTotal = fnHRMCom_GetNbrOfHRMSamples ();

// Get all heart rate and speed values
for (i = 0; i < iTotal; i++)
{
    iHR = fnHRMCom_GetHRMSamples (CC_HRATE, i);
    iSpeed = fnHRMCom_GetHRMSamples (CC_SPEED,i);
}

if (1 == fnHRMCom_GetRecParam (REC_EURO_US_UNITS))
{
    // Speed in mph, altitude in feet
}
else
{
    // Speed in km/h, altitude in meters
}
}
}

// Set HR monitor to watch mode
 fnHRMCom_SendMonitorToWatchMode (&psg);

// End IR communication
fnHRMCom_EndIRCommunication (FALSE);
 }
void fnpolarsample连接(HWND-HWND)
{
POLAR_SSET_GENERAL psg;
极地监测信息psmi;
POLAR_练习文件pef;
int iSamplingRate,i,iTotal,iHR,iSpeed;
TCHAR tcFile[MAX_PATH];
如果(!fnHRMCom_ResetIRCommunication(0))
{
//重置IR连接未成功
打破
}
if(!fnHRMCom_StartIRCommunication(HRMCOM参数IRDA,“IR”))
{
//无法打开端口,请停止连接线程
fnHRMCom_终端通信(错误);
打破
}
//填写一般信息
零内存(&psg,sizeof(psg));
psg.iSize=sizeof(psg);
psg.i连接=HRMCOM\u连接\u IR;
psg.bConnectionDlg=TRUE;
psg.hOwnerWnd=hWnd;//所有者窗口句柄
//重置监视器信息
零内存(&psmi,sizeof(psmi));
//从HR监视器读取监视器信息
如果(!fnHRMCom_ReadMonitorInfo(&psg,&psmi))
{
//读取失败,请关闭连接
fnHRMCom_终端通信(错误);
打破
}
对于(i=0;i
编译器对break语句有问题(这些语句是否应该返回?) 它在secondif中使用的字符串“IR”有问题。这应该是一个LPTSTR tcPort变量(例如“COM1:”),但对于IR,它没有常量或任何东西。 我目前无法运行编译器,但我会尽快这样做,我有时间

我已经感谢你迄今为止的答复

下面是我能够编译的代码。我扔掉了一些我认为对代码的运行不重要的东西

#include <windows.h>
#include "hrmcom.h"

void main(HWND hWnd)
{
POLAR_SSET_GENERAL  psg;
POLAR_SSET_MONITORINFO  psmi;

int             iSamplingRate, i, iTotal, iHR, iSpeed;


if (!fnHRMCom_ResetIRCommunication(0))
{
    // Resetting IR connection was not successful
    return;
}

if (!fnHRMCom_StartIRCommunication(HRMCOM_PARAM_IRDA, "IR"))
{
    // Port couldn't be opened, stop connection thread
    fnHRMCom_EndIRCommunication(FALSE);
    return;
}

// Fill general information
ZeroMemory(&psg, sizeof(psg));

psg.iSize = sizeof (psg);
psg.iConnection = HRMCOM_CONNECTION_IR;
psg.bConnectionDlg = TRUE;
psg.hOwnerWnd = hWnd;   // Owner window handle

// Reset monitor information
ZeroMemory(&psmi, sizeof(psmi));

// Read monitor info from HR monitor
if (!fnHRMCom_ReadMonitorInfo(&psg, &psmi))
{
    // Reading failed, close connection
    fnHRMCom_EndIRCommunication(FALSE);
    return;
}

for (i = 0; i < psmi.iTotalFiles; i++)
{
    if (!fnHRMCom_ReadExerciseFile(hWnd, i, FALSE))
    {
        // Read sampling (recording) rate
        iSamplingRate = fnHRMCom_GetRecParam(REC_SAMPLING_RATE);

        // Read total number of samples
        iTotal = fnHRMCom_GetNbrOfHRMSamples();

        // Get all heart rate and speed values
        for (i = 0; i < iTotal; i++)
        {
            iHR = fnHRMCom_GetHRMSamples(CC_HRATE, i);
            iSpeed = fnHRMCom_GetHRMSamples(CC_SPEED, i);
        }

        if (1 == fnHRMCom_GetRecParam(REC_EURO_US_UNITS))
        {
            // Speed in mph, altitude in feet
        }
        else
        {
            // Speed in km/h, altitude in meters
        }
    }
}

// Set HR monitor to watch mode
fnHRMCom_SendMonitorToWatchMode(&psg);

// End IR communication
fnHRMCom_EndIRCommunication(FALSE);
}
#包括
#包括“hrmcom.h”
空干管(HWND HWND)
{
POLAR_SSET_GENERAL psg;
极地监测信息psmi;
int iSamplingRate,i,iTotal,iHR,iSpeed;
如果(!fnHRMCom_ResetIRCommunication(0))
{
//重置IR连接未成功
返回;
}
if(!fnHRMCom_StartIRCommunication(HRMCOM参数IRDA,“IR”))
{
//无法打开端口,请停止连接线程
fnHRMCom_终端通信(错误);
返回;
}
//填写一般信息
零内存(&psg,sizeof(psg));
psg.iSize=sizeof(psg);
psg.i连接=HRMCOM\u连接\u IR;
psg.bConnectionDlg=TRUE;
psg.hOwnerWnd=hWnd;//所有者窗口句柄
//重置监视器信息
零内存(&psmi,sizeof(psmi));
//从HR监视器读取监视器信息
如果(!fnHRMCom_ReadMonitorInfo(&psg,&psmi))
{
//读取失败,请关闭连接
fnHRMCom_终端通信(错误);
返回;
}
对于(i=0;i

我想知道这个项目需要如何编译它现在是一个控制台程序,但似乎是用一个父HWND调用对话窗口。我现在感到困惑。为了使它工作,我需要更改fnPolarSampleConnection的名称。这可能是一个需要合并到windows主应用程序中的函数吗?

否,您不能设置VS2013 ba回到90年代。也许我们可以帮你解决这些错误。vs6是中世纪的,最好先用vs 2003编译这个项目,然后跳到2013年。从那时起,语言发生了很多变化,你必须留下来逐个修复。显示前50行左右的错误消息。我编辑d上面的问题。我现在手头只有源文件。还有我记得的最明显的错误。当我在自己的计算机上时,我将尝试编译并向您显示错误消息行。我添加了我得到的错误行