[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Re: Valery's Question



Olga Tuzova wrote:
> 
> Dear George,
> 
> As it often happens, the students go faster than their teachers.
> One student (his name is Valery) asked me a question which put me
> into the blind alley. I've never done such things. Would you please
> help him (and me)?
> 
> When running the program below he gets an error message:
> 
> You don't say what to do with [0]  in fizic
> [dllcall [w loadbitmap l :a s |C:\win.95\derc.res|]]
> 
> to fizic
> dllload "user.exe
> windowcreate "root "ddd "ddd 100 100 100 100 []
> make "a dllcall [w findwindow l 0 s [ddd]]
> dllcall [w loadbitmap l :a s C:\\win.95\\derc.res]

Wow, he sure is getting ahead.

make "b dllcall [w loadbitmap l :a s C:\\win.95\\derc.res]

Will resolve the "immediate" error.

Where :b will hold a Windows Handle to the bitmap he loaded.
Logo is complaining that he did not consume the result returned.

Keep in mind that DLLCALL is for folks that really know Windows
"C" programming. DLLCALL also has some limitations. It's odd that
someone that knew enough to do what he did and not be able to
realize the (relatively speaking) small problem.

What he appears to be trying to do is load a bitmap
into a window he just created. But he is mixing apples and
oranges (loadbitmap wants an application instance handle (his :a)
but he is passing a window handle). It's fairly complex "C"
coding to do what he wants and to try to do that from MSWLogo's
weak DLL interface it will be very difficult.

There is a lot he can do and learn from Logo right up through
college. But if he wants to did deeper into windows programming
he may want to try learning Borland Dephi (Object oriented Pascal
Windows Programing) or Microsoft Visual Basic. There are lots of "how
to" books on this stuff. He certainly appears to be on the right
track. But this still may be over his head.

Note also that there are several examples that he could use
as seed to very involved projects like SPRITE.LGO (that one
should keep his mind ticking for a while). And everything he
learns is applicable to windows programming.

Note that I just noticed a bug in SPRITE.LGO due to a command
name change in a recent release.

Add this to the logo library as the file name BITLOADSIZE on
Win95/NT or call it BITLOADS on all other platforms.

to bitloadsize :name
bitload :name
output bitsize :name
end
bury "bitloadsize

He can also study Brians books that get quite involved with
A.I. etc. But he appears to be a graphics person like myself :-)
and I think the SPRITE example will get his mind really cranking.
Note that the mouse can interact with the sprites !!!

> dllfree
> end
> 
> Thank you,
> Olga.

Hope you don't mind my posting the reply, it's an interesting
situation.

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home