בס"ד
שלום
אני מנסה להפעיל כרטיס AT89C5131A דרך USB (המידע מhttp://www.galium.co.il/vbe)
לקחתי קובץ מקור מיקמתי קובץ AtUsbHid.h וAtUsbHid.dll
אבל בזמן הקימפול אני מקבל הודעה הבא
1>------ Build started: Project: usb1, Configuration: Debug Win32 ------
1>Compiling...
1>usb1.cpp
1>c:\usb1\usb1\usb1\atusbhid.h(127) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\usb1\usb1\usb1\Debug\BuildLog.htm"
1>usb1 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
מהיא הסיבה???אולי אתם יודעים???
תודה רז
זה הקובץ המקור
#include <stdafx.h>
#include <stdio.h>
#include <windows.h>
#include "AtUsbHid.h"
void main(void)
{
int i;
HINSTANCE hLib = NULL; // Handle to AtUsbHid.dll
if (initializationUSB(hLib)) // Initialization all the USB communication.
printf("USB HID device is opened.\n");
else
{
printf("Error While opening device.\n");
Sleep(2000);
return;
}
for(i=0;i<10;i++)
{
outUSB(1,0xAA); //Send data to the USB port
outUSB(2,0xF0);
Sleep(200); // Delay function in mS.
outUSB(1,0x55);
outUSB(2,0xF);
Sleep(200);
}
for(i=0;i<10;i++)
{
printf("P0=%X\n",inUSB(0)); //Get data from the USB port.
printf("P3=%X\n\n",inUSB(3));
Sleep(1000);
system("cls"); //Clean screen.
}
closeUSB(hLib); //Close all the USB communication.
}