由于机器配置的问题,现在只能用VC6,可是需要调用msvcr80.dll中的一个_time64这个函数,应该怎么调用呢?
HMODULE dllMod=LoadLibrary("msvcr80.dll");
if(dllMod==NULL)
{
MessageBox(0,"Error","Error",0);
exit(0);
} FARPROC tFun=GetProcAddress(dllMod,"_time64");
if(tFun==NULL)
{
MessageBox(0,"Error","Error",0);
exit(0);
}我这样写找不到这个dll,而且会出现一个运行时错误
Runtime Error
R6034An application has made an attempt to load the C runtime library incorrectly
Please contact the application's support team for more information这个是不是要从VC6里面设置些什么东西啊

解决方案 »

  1.   

    msvcr80.dll 应该没有直接导出给你函数使用..
    要么升级vc,要么想其他方法实现
      

  2.   

    用的lib,不是没导出,而是不是用名字导出
      

  3.   

    貌似缺少了Microsoft.VC80.CRT.manifest
      

  4.   

    自己拿代码用吧
    /***
    *time64.c - get current system time
    *
    *       Copyright (c) Microsoft Corporation. All rights reserved.
    *
    *Purpose:
    *       defines _time64() - gets the current system time and converts it to
    *       internal (__time64_t) format time.
    *
    *******************************************************************************/#include <cruntime.h>
    #include <time.h>
    #include <ctime.h>
    #include <internal.h>
    #include <windows.h>/*
     * Number of 100 nanosecond units from 1/1/1601 to 1/1/1970
     */
    #define EPOCH_BIAS  116444736000000000i64/*
     * Union to facilitate converting from FILETIME to unsigned __int64
     */
    typedef union {
            unsigned __int64 ft_scalar;
            FILETIME ft_struct;
            } FT;
    /***
    *__time64_t _time64(timeptr) - Get current system time and convert to a
    *       __time64_t value.
    *
    *Purpose:
    *       Gets the current date and time and stores it in internal 64-bit format
    *       (__time64_t). The time is returned and stored via the pointer passed in
    *       timeptr. If timeptr == NULL, the time is only returned, not stored in
    *       *timeptr. The internal (__time64_t) format is the number of seconds
    *       since 00:00:00, Jan 1 1970 (UTC).
    *
    *Entry:
    *       __time64_t *timeptr - pointer to long to store time in.
    *
    *Exit:
    *       returns the current time.
    *
    *Exceptions:
    *
    *******************************************************************************/__time64_t __cdecl _time64 (
            __time64_t *timeptr
            )
    {
            __time64_t tim;
            FT nt_time;        GetSystemTimeAsFileTime( &(nt_time.ft_struct) );        tim = (__time64_t)((nt_time.ft_scalar - EPOCH_BIAS) / 10000000i64);        if (tim > _MAX__TIME64_T)
                    tim = (__time64_t)(-1);        if (timeptr)
                    *timeptr = tim;         /* store time if requested */        return tim;
    }
      

  5.   

    即便是用lib的形式函数的定位也应该是用函数名吧,而且从PE格式上来看,确实能够看到_time64这个函数名啊……
      

  6.   

    直接用depends查看dll看它的名称
      

  7.   

    写个标准DLL就行了。其他语言写的DLL都可以用,同样用VC写的更加没有问题。