⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hostname.c

📁 this vi is use dll of labview
💻 C
字号:
/* 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);
	}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -