How to create extended stored procedure for MS SQL 7.0

Does somebody know how to create extended stored procedures for MS SQL 7.0.
I always get a.v. after exiting my procedures/ Also can't create windows,
send messages, add atoms ect. Seems like user and gdi functions dose not at
all. Thanks!