We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Directory Structures: Windows : E:\Windows (Windows system) KeilBin : E:\Keil\C51\bin AGDIDebug : E:\...\Debug Hello : E:\...\Hello (This is a uvision project)
AGDI needs connection code between interface and target hardware. Since PC connects the target through parallel ports, I choose WinIo that enables direct I/O under Windows2000/XP. It's required that WinIo.dll/sys/vxd be in the same directory as the executable program using them. So I put them in the Windows & KeilBin & AGDIDebug & Hello directories.
InitTarget() in AGDI.cpp calls InitializeWinIo() in WinIo. When I press F5 in VC6, uvision2 is opened. Then I press Ctrl+F5 in uvision2. However, InitializeWinIo() failed ( it returns false ) which means WinIo.sys cannot be found.
I'm sure the WinIo.dll has been loaded (::LoadLibrary() returns non-zero). How can uvision2 find WinIo.sys?
Please Help!
"How can uvision2 find WinIo.sys?"
Surely, it can't? It is up to your AGDI code to find WinIo for it?!
Have you tried a simple test program that verifies that your code can correctly initialise WinIO - independently of uVision?
It works when putting WinIo.dll/sys/vxd in E:\Keil\uv2\. InitTarget() read/write ecr register, status register, control register is fine. However, it has trouble when r/w epp data register. Don't know why, since my test program using WinIo works fine.
It's much better now after debugging. :)