打印

求vc++6.0高手,生成dll报错

[复制链接]
1373|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
无名小类|  楼主 | 2013-1-27 21:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
学习生成dll获取电脑名称的例子使用时,vc++6.0报错怎么处理,求指教,编译通过但是生成dll时候报错。
个人是用其他软件官方发布的程序,程序应该问题不大,不知道是软件原因还是什么,求高手。
代码:/* include extcode.h which contains the prototypes for the LabVIEW functions */
#include "extcode.h"
#include <stdio.h>
#include <windows.h>


BOOL WINAPI DllMain (HANDLE hDLL, DWORD dwReason, LPVOID lpReserved)
        {
                return TRUE;
        }


/* This functions gets the computer name and returns it to LabVIEW */
__declspec (dllexport) void MachineName(void *LVHandle)
        {
        char computerName[MAX_COMPUTERNAME_LENGTH+1];
        int  compNameLength = MAX_COMPUTERNAME_LENGTH+1;

        /* Get computer name */
        GetComputerName(computerName, &compNameLength);
        /* Size LabVIEW handle to the correct size */
        DSSetHandleSize(LVHandle, compNameLength + 5);
        /* Copy the string size to the LabVIEW handle */
        **(int32 **)LVHandle = compNameLength ;
        /* Copy the string to the LabVIEW handle */
        sprintf((*(char **)LVHandle)+4,"%s",computerName);
        }


错误提示信息为:--------------------Configuration: getcomname - Win32 Debug--------------------
Linking...
  Creating library Debug/getcomname.lib and object Debug/getcomname.exp
hostname.obj : error LNK2001: unresolved external symbol _DSSetHandleSize
Debug/getcomname.dll : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

getcomname.rar

986.5 KB

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

21

帖子

0

粉丝