C++/CLR中精确到毫秒的问题

使用C++/CLR写的话报错了,这是这么回事

#include <stdio.h>
#include <sys/timeb.h>
#include <winsock2.h>
#include <iostream>
#include "stdafx.h"
using namespace std;

void main()
{
    struct timeb tb;
    ftime(&tb);
    cout << tb.time * 1000 + tb.millitm << endl;
    system("pause");
}

图片说明

将#include "stdafx.h"移到第一行就行了