To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 22182
Subject: 
Re: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Thu, 5 Feb 2004 11:22:15 GMT
Viewed: 
4475 times
  
In lugnet.robotics, Ralph Hempel wrote:
All,

I've been messing with the tower API and have discovered
what I think is an error in the docs...

Fisrt off, the API help file tells us to open

  "\.\LEGOTOWERx"

In fact, the file name must look like this:

  "\\.\LEGOTOWERx"

Even worse, the filename actually only works on Win2K, WinNT,
and WinXP. Win98 and WinME won't open this filename at all
as they think you are looking for a UNC mapped path.

Can anyone else confirm these observations?

Ralph

Right with \\.\...., but at least with Win98SE the port is correctly found.
Great to here you Ralph.


Subject: 
RE: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Thu, 5 Feb 2004 12:58:55 GMT
Reply-To: 
<rhempel@SAYNOTOSPAMbmts.com>
Viewed: 
4521 times
  
Even worse, the filename actually only works on Win2K, WinNT,
and WinXP. Win98 and WinME won't open this filename at all
as they think you are looking for a UNC mapped path.

Can anyone else confirm these observations?

Ralph

Right with \\.\...., but at least with Win98SE the port is correctly found.
Great to here you Ralph.

Claude,

I've written a little C program that tries to open "\\.\LEGOTOWER1" and
on otherwise identical computers (except one is running Win98SE and the
othre runs Win2K) only the Win2K machine can open the file.

Of course, the LEGO tools work on both machines. I suspect that the
LEGO guys are opening the private filename returned by the API
for the tower instead of the special "\\.\LEGOTOWER1" filename.

I've uninstalled and re-installed the tower drivers on the Win98 machine
just in case, and it still doesn't work :-(

I'll keep digging.

Ralph


Subject: 
Re: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Thu, 5 Feb 2004 15:36:06 GMT
Viewed: 
4703 times
  
In lugnet.robotics, Ralph Hempel wrote:
Even worse, the filename actually only works on Win2K, WinNT,
and WinXP. Win98 and WinME won't open this filename at all
as they think you are looking for a UNC mapped path.

Can anyone else confirm these observations?

Ralph

Right with \\.\...., but at least with Win98SE the port is correctly found.
Great to here you Ralph.

Claude,

I've written a little C program that tries to open "\\.\LEGOTOWER1" and
on otherwise identical computers (except one is running Win98SE and the
othre runs Win2K) only the Win2K machine can open the file.

Of course, the LEGO tools work on both machines. I suspect that the
LEGO guys are opening the private filename returned by the API
for the tower instead of the special "\\.\LEGOTOWER1" filename.

I've uninstalled and re-installed the tower drivers on the Win98 machine
just in case, and it still doesn't work :-(

I'll keep digging.

Ralph

Ralph,

I retried it with a Delphi-program that I wrote some time ago. This opens
"\\.\LEGOTOWER1" without any problem:
  ...
  const DEFAULT_PORT_NAME = '\\.\LEGOTOWER1';
  ...
  function USB_Open():Longint;stdcall;
  var hFh:Longint;
  begin
    hFh:=CreateFile(DEFAULT_PORT_NAME,GENERIC_READ or
GENERIC_WRITE,0,nil,OPEN_EXISTING,0,0);
    result:=hFh;
  end;

So keep on digging ;-)

Salut, Claude


Subject: 
Re: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Thu, 5 Feb 2004 16:33:51 GMT
Viewed: 
4947 times
  
In lugnet.robotics, Ralph Hempel wrote:

I've written a little C program that tries to open "\\.\LEGOTOWER1" and
on otherwise identical computers (except one is running Win98SE and the
othre runs Win2K) only the Win2K machine can open the file.

Of course, the LEGO tools work on both machines. I suspect that the
LEGO guys are opening the private filename returned by the API
for the tower instead of the special "\\.\LEGOTOWER1" filename.

I've uninstalled and re-installed the tower drivers on the Win98 machine
just in case, and it still doesn't work :-(

I'll keep digging.

Did you escape the backslashes in the C string?

  CreateFile("\\\\.\\LEGOTOWER1", GENERIC_READ | GENERIC_WRITE,
     0, 0, OPEN_EXISTING, 0, 0);

Just a thought... it's easy to forget sometimes.

Mark


Subject: 
RE: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Thu, 5 Feb 2004 16:58:20 GMT
Reply-To: 
<rhempel@bmtsSTOPSPAM.com>
Viewed: 
5126 times
  
Did you escape the backslashes in the C string?

  CreateFile("\\\\.\\LEGOTOWER1", GENERIC_READ | GENERIC_WRITE,
     0, 0, OPEN_EXISTING, 0, 0);

Just a thought... it's easy to forget sometimes.

Yes, I escaped the characters. The identical code works on the Win2K machine
and does not work on the win98SE machine with identical LEGO drivers installed.

Hmmmm

Ralph


Subject: 
Re: LEGO Tower API and Filenames
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.pbforth
Date: 
Fri, 6 Feb 2004 03:20:28 GMT
Viewed: 
5428 times
  
In lugnet.robotics, Ralph Hempel wrote:
Did you escape the backslashes in the C string?

  CreateFile("\\\\.\\LEGOTOWER1", GENERIC_READ | GENERIC_WRITE,
     0, 0, OPEN_EXISTING, 0, 0);

Just a thought... it's easy to forget sometimes.

Yes, I escaped the characters. The identical code works on the Win2K machine
and does not work on the win98SE machine with identical LEGO drivers installed.

One other thing you could try is to physically disconnect and then reconnect the
USB tower from the system.  I've found that (on Win98 at least) the driver
sometimes freezes up and won't open until after I do that little dance.

Also, you could try running my MSGMON program (complete with source code) to see
if it works for you.  I use pretty much that same CreateFile() call that Mark
quoted earlier in this thread.

  http://www.drvegetable.com/download/samplecode/msgmon.zip

Hope this helps!

- Chris.


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR