阅读:1695回复:2
为何这段程序不能编译。
在INSTALLSHIELD 6.2中,有函数TEXT()??
function addpd() PRINTER_INFO_2 pi2; DRIVER_INFO_3 di3; HWND hPrinter; char* Environment=_TEXT("Windows NT x86"); char lpDriverPath[MAX_PATH]; char lpBuffer[MAX_PATH]; char lpDataFilePath[MAX_PATH]; char lpConfigFilePath[MAX_PATH]; char lpDependecy[MAX_PATH]; int uSize=0; BOOL b=GetPrinterDriver Directory(NULL,Environment,1,(LPBYTE)lpBuffer,MAX_PATH,&uSize); begin lstrcpy(_TEXT(lpDriverPath),_TEXT(lpBuffer)); lstrcat(_TEXT(lpDriverPath),_TEXT("\\VPrinter.dll")); lstrcpy(_TEXT(lpDataFilePath),_TEXT(lpBuffer)); lstrcat(_TEXT(lpDataFilePath),_TEXT("\\vprinter.GPD")); lstrcpy(_TEXT(lpConfigFilePath),_TEXT(lpBuffer)); lstrcat(_TEXT(lpConfigFilePath),_TEXT("\\TVPproc.dll")); memset(lpDependecy,0,sizeof(lpDependecy)); lstrcat(lpDependecy,_TEXT("stdnames.gpd\0VPRintER.INF\0\0")); ZeroMemory(&di3, sizeof(DRIVER_INFO_3)); di3.cVersion = 4; di3.pName =_TEXT("wookin Virtual Printer");//HP LaserJet III di3.pEnvironment = Environment; di3.pDriverPath = lpDriverPath; di3.pDataFile =lpDataFilePath; di3.pConfigFile =lpConfigFilePath; di3.pDependentFiles = lpDependecy; di3.pHelpFile = NULL; di3.pMonitorName = NULL; di3.pDefaultDataType = _TEXT("RAW"); b=AddPrinterDriver(NULL, 3, (LPBYTE)&di3); ZeroMemory(&pi2, sizeof(PRintER_INFO_2)); pi2.pServerName=NULL; pi2.pPrinterName = _TEXT("xxx1"); pi2.pPortName = _TEXT("LPT1:"); pi2.pDriverName = _TEXT("Virtual Printer"); //Çý¶¯Ò»¶¨Òª´æÔڲſÉÒÔ pi2.pPrintProcessor = _TEXT("WinPrint"); pi2.pDatatype = _TEXT("RAW"); pi2.AveragePPM = 400; hPrinter = AddPrinter(NULL, 2, (LPBYTE)&pi2); int dwerr=GetLastError(); ClosePrinter(hPrinter); end |
|
最新喜欢:![]() |
沙发#
发布于:2004-04-12 09:47
你用vc写个dll,再用installshield来调用你的函数,问题不就解决了么?
|
|
|
板凳#
发布于:2004-04-12 09:49
memset(lpDependecy,0,sizeof(lpDependecy));
lstrcat(lpDependecy,_TEXT(\"stdnames.gpd 这里你不能这么做。 你要直接付值给 di3.pDependentFiles = \"file1.dll\\\\0file2.gpd\\\\0file3.ini\\\\0\\\\0\"; |
|
|