ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Sick of VB6 ! (Sdk)
Sick of VB6 ! // Sdkx@x.com (xelag)Nov 20, 1998, 10:08pm
Just to say I'll have to find another programming language that has
GUI support. VB6 can't read aw_string and crashes, sometimes unexpectedly crashes on aw_int, in both cases with an ACCESS VIOLATION in aw.dll... Can't spend more efforts on this rubbish language. And my bot was getting so nice: walking, dancing, flying, travelling by foot to new destinations... I could cry. I tried compiling the 1st SDK example in C with VC++6, within 15 minutes I had the Speaker bot running and HEARING, a new experience for me. But GUI support is lacking there, and I really want that too. Help! Canopus, how's Delphi? I havent programmed in Pascal since Turbo times under DOS, that's years ago. Does object Pascal support dlls in C? I have now Delphi 2, it's been given away for free. Desperately seeking.... XelaG walter knupeNov 20, 1998, 10:33pm
maybe its the right time to look into c++ ?
just if you wonder, its possible to write a GUI bot using c++ in VC5.0, so 6.0 should work too.. this is what [Daniel] is. Walter XelaG schrieb in Nachricht <36560038.28775246 at news.activeworlds.com>... >Just to say I'll have to find another programming language that has >GUI support. VB6 can't read aw_string and crashes, sometimes >unexpectedly crashes on aw_int, in both cases with an ACCESS VIOLATION >in aw.dll... Can't spend more efforts on this rubbish language. And my >bot was getting so nice: walking, dancing, flying, travelling by foot >to new destinations... I could cry. > >I tried compiling the 1st SDK example in C with VC++6, within 15 >minutes I had the Speaker bot running and HEARING, a new experience >for me. But GUI support is lacking there, and I really want that too. > >Help! Canopus, how's Delphi? I havent programmed in Pascal since >Turbo times under DOS, that's years ago. Does object Pascal support >dlls in C? I have now Delphi 2, it's been given away for free. > >Desperately seeking.... > >XelaG canopusNov 20, 1998, 10:55pm
Delphi uses Object Pascal, and so is object-oriented, like C++. It has a
graphics user interface, with lots of built-in forms and controls, like VB6. Unlike some versions of C, even, Delphi's compiler links the aw.dll into the AWAPI (now updated to Build 9) smoothly and automatically. Check and see how quickly the Delphi versions of Sample 1 and 2 came out compared to other languages. I have the 5 construction bot applications that I came to the SDK to do finished: I'm just waiting for Beta to be over so I can use them. [View Quote] > Just to say I'll have to find another programming language that has > GUI support. VB6 can't read aw_string and crashes, sometimes > unexpectedly crashes on aw_int, in both cases with an ACCESS VIOLATION > in aw.dll... Can't spend more efforts on this rubbish language. And my > bot was getting so nice: walking, dancing, flying, travelling by foot > to new destinations... I could cry. > > I tried compiling the 1st SDK example in C with VC++6, within 15 > minutes I had the Speaker bot running and HEARING, a new experience > for me. But GUI support is lacking there, and I really want that too. > > Help! Canopus, how's Delphi? I havent programmed in Pascal since > Turbo times under DOS, that's years ago. Does object Pascal support > dlls in C? I have now Delphi 2, it's been given away for free. > > Desperately seeking.... > > XelaG x@x.com (xelag)Nov 21, 1998, 12:34am
Hi Canopus,
I'll give Delphi 2.0 a try. I need some help, though, to get started. I have your akSample2eForm.pas and akAWAPI.pas (build 9), but don't really know how to start. I've been through the code, understand most of it at first glance, and have a few remarks or questions, besides a fundamental one: 1. how do you build this project in Delphi for this to work (I know how to make a form and position buttons etc, thats about it in Delphi). In akAWAPI: 2. why do you have to declare the apis twice? 3. you have a PInteger type in function aw_data (a : AW_ATTRIBUTE; length : PInteger) : PChar; cdecl; is this intentional? 4. what does 'const' mean in, for instance, function aw_create (const domain : PChar; port : Integer; instance : PAWhInst) : Integer; cdecl; can't it be just 'domain: PChar'? I couln't find this in the Delphi help, only the syntax 'const xxx = yyy'. Any help or suggestions, also about books to read, is welcome! My e-mail is decastro at cable.a2000.nl, just in case its not appropriate to answer to the ng. Thanx, XelaG On Fri, 20 Nov 1998 19:55:42 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] >Delphi uses Object Pascal, and so is object-oriented, like C++. It has a >graphics user interface, with lots of built-in forms and controls, like >VB6. Unlike some versions of C, even, Delphi's compiler links the aw.dll >into the AWAPI (now updated to Build 9) smoothly and automatically. Check >and see how quickly the Delphi versions of Sample 1 and 2 came out >compared to other languages. I have the 5 construction bot applications >that I came to the SDK to do finished: I'm just waiting for Beta to be >over so I can use them. > [View Quote] x@x.com (xelag)Nov 21, 1998, 12:35am
Walter, i'll try Delphi first :o)
On Sat, 21 Nov 1998 01:33:45 +0100, "Walter Knupe" <wak at faber.ping.de> [View Quote] >maybe its the right time to look into c++ ? > >just if you wonder, its possible to write a GUI bot using c++ in VC5.0, so >6.0 should work too.. this is what [Daniel] is. > >Walter > >XelaG schrieb in Nachricht <36560038.28775246 at news.activeworlds.com>... > canopusNov 21, 1998, 1:55am
There's other useful Delphi information in the earlier Delphi threads,
especially the instructions on how to build your own Form from the Delphi version of Sample 1 and the comments following the Delphi version of Sample 2. The declaration part is for support of the other declarations; the implementation part is a peculiarity imposed by the way the DLL is linked in (a little more info there too). Other than mentioning it in your Uses clauses and looking up the correct call format, you don't have to worry about the AWAPI unit. There's a predefined PointerToInteger type in Delphi called PInteger. Delphi 2 has these constant parameters, I think: it's a way to tell the compiler that the value passed will not be changed during the procedure (more efficient code, at least with arrays, sets, etc.). The best Delphi books are those by Marco Cantu, in my opinion. He even has a section on connecting to DLL's, which is helpful in understanding our situation. [View Quote] > Hi Canopus, > > I'll give Delphi 2.0 a try. I need some help, though, to get started. > I have your akSample2eForm.pas and akAWAPI.pas (build 9), but don't > really know how to start. I've been through the code, understand most > of it at first glance, and have a few remarks or questions, besides a > fundamental one: > > 1. how do you build this project in Delphi for this to work (I know > how to make a form and position buttons etc, thats about it in > Delphi). > > In akAWAPI: > > 2. why do you have to declare the apis twice? > > 3. you have a PInteger type in > function aw_data (a : AW_ATTRIBUTE; length : PInteger) : PChar; > cdecl; > is this intentional? > > 4. what does 'const' mean in, for instance, > function aw_create (const domain : PChar; port : Integer; instance : > PAWhInst) : Integer; cdecl; > can't it be just 'domain: PChar'? I couln't find this in the Delphi > help, only the syntax 'const xxx = yyy'. > > Any help or suggestions, also about books to read, is welcome! My > e-mail is decastro at cable.a2000.nl, just in case its not appropriate to > answer to the ng. > > Thanx, XelaG > > On Fri, 20 Nov 1998 19:55:42 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] x@x.com (xelag)Nov 21, 1998, 3:13am
Got it working for your akSample2eForm.pas, Canopus. Took me a few
hours, wasted time trying to use your pas file as is. I still can't figure out how to change the name of Unit1. Form1 I can rename through the properties. I moved Stop := False from Form.Create to just before the loop, otherwise I coudn't repeat Button1Click and keep the bots there! Can one add units without forms? I suppose public procedures etc are reachable from all units. I definitely nead a Delphi Tutorial and a good book. None included in the free distribution, but lots of online help. I coudn't find any code example yet, except for your code. I need to learn quite fast how to read/write to file, to INI files, how to manage arrays, and lots more... XelaG x@x.com (xelag)Nov 21, 1998, 3:28am
Thanks, I didn't read your answer till after I posted my "Got it
working" bit... On Fri, 20 Nov 1998 22:55:53 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] >There's other useful Delphi information in the earlier Delphi threads, >especially the instructions on how to build your own Form from the Delphi >version of Sample 1 and the comments following the Delphi version of Sample >2. > >The declaration part is for support of the other declarations; the >implementation part is a peculiarity imposed by the way the DLL is linked in >(a little more info there too). Other than mentioning it in your Uses clauses >and looking up the correct call format, you don't have to worry about the >AWAPI unit. > >There's a predefined PointerToInteger type in Delphi called PInteger. > >Delphi 2 has these constant parameters, I think: it's a way to tell the >compiler that the value passed will not be changed during the procedure (more >efficient code, at least with arrays, sets, etc.). > >The best Delphi books are those by Marco Cantu, in my opinion. He even has a >section on connecting to DLL's, which is helpful in understanding our >situation. x@x.com (xelag)Nov 21, 1998, 3:36am
>The declaration part is for support of the other declarations; the
>implementation part is a peculiarity imposed by the way the DLL is linked in >(a little more info there too). Other than mentioning it in your Uses clauses >and looking up the correct call format, you don't have to worry about the >AWAPI unit. Does this mean that the dll is actually linked when building the programme? or is it an equivalent of the aw.lib file which is linked? canopusNov 21, 1998, 2:25pm
Also, before you try to do a version of Sample 2 that will work (the invisible
bot will be in some location other than Beta 1N !W--if you can tolerate the notion that bots, like earthquakes, can have a location even though they don't have a body), read the replies to Lucio's 11/6/98 thread about aw_query. [View Quote] > Hi Canopus, > > I'll give Delphi 2.0 a try. I need some help, though, to get started. > I have your akSample2eForm.pas and akAWAPI.pas (build 9), but don't > really know how to start. I've been through the code, understand most > of it at first glance, and have a few remarks or questions, besides a > fundamental one: > > 1. how do you build this project in Delphi for this to work (I know > how to make a form and position buttons etc, thats about it in > Delphi). > > In akAWAPI: > > 2. why do you have to declare the apis twice? > > 3. you have a PInteger type in > function aw_data (a : AW_ATTRIBUTE; length : PInteger) : PChar; > cdecl; > is this intentional? > > 4. what does 'const' mean in, for instance, > function aw_create (const domain : PChar; port : Integer; instance : > PAWhInst) : Integer; cdecl; > can't it be just 'domain: PChar'? I couln't find this in the Delphi > help, only the syntax 'const xxx = yyy'. > > Any help or suggestions, also about books to read, is welcome! My > e-mail is decastro at cable.a2000.nl, just in case its not appropriate to > answer to the ng. > > Thanx, XelaG > > On Fri, 20 Nov 1998 19:55:42 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] canopusNov 21, 1998, 2:52pm
I believe that the Delphi linker uses the 'external' statements in the
implementation section of the AWAPI unit to set up tables in the executable file. When the *.exe is loaded, the aw.dll is loaded first, so that these tables can be filled with the addresses of the aw.dll functions already in memory. This 'dynamic' linking occurs when you are building your program, along with the 'static' linking of compiled code from the Delphi units (libraries) likewise mentioned in your Uses clause. [View Quote] > > Does this mean that the dll is actually linked when building the > programme? or is it an equivalent of the aw.lib file which is linked? canopusNov 21, 1998, 5:17pm
Yes, Stop:= False should be in Button1.Click. I wrote Sample2e in a rush
just to test your old (VB) results with a multiple bot program--one loop was enough to see that the Delphi AWAPI translation of aw.h worked, at least. :) There have been several people trying to learn Delphi (if not Pascal) and the SDK at the same time; they suggested explaining how to move the information from my attached *.pas file to the Unit1 Form1 that they see when they start up Delphi, so I added a note giving explicit instructions to the first Delphi thread. Didn't think people might start at the last Delphi thread and work backwords! By the way, I've found that putting the two panels side by side in a long horizontal form fits the program neatly above the AW Browser when I shrink it. Delphi will automatically position your opening form wherever it was onscreen when you compiled the program. Yes, you can edit and compile units that have no Form file. This is very handy, just like the equivalent VB modules, for universally useful procedures. Global procedures are those declared in the interface section as 'public' form methods, or outside the form declaration (like CellBegin in Sample 2). In Delphi 2 you have a DataModule for databases that puts them on a separate unit you can access from any form; there's a DBGrid control that is great for recording data about avatars or objects you meet, and you can create and initialize it in the included DBDesktop accessory--and the DB records are visible even at design time. Look and see if there's a file with Delphi 2 called VB2Delphi or something like that: it came along with Delphi 1, to help VB programmers make the move to Pascal. Most versions of Delphi come with a lot of examples; only the source for Delphi itself was restricted to Delphi Pro editions. [View Quote] > Got it working for your akSample2eForm.pas, Canopus. Took me a few > hours, wasted time trying to use your pas file as is. I still can't > figure out how to change the name of Unit1. Form1 I can rename through > the properties. > > I moved Stop := False from Form.Create to just before the loop, > otherwise I coudn't repeat Button1Click and keep the bots there! > > Can one add units without forms? I suppose public procedures etc are > reachable from all units. > > I definitely nead a Delphi Tutorial and a good book. None included in > the free distribution, but lots of online help. I coudn't find any > code example yet, except for your code. I need to learn quite fast how > to read/write to file, to INI files, how to manage arrays, and lots > more... > > XelaG x@x.com (xelag)Nov 21, 1998, 7:22pm
None on my copy of Delphi 2.0. PCPlus claims its the full version. If
you still have the help file, my e-mail is decastro at cable.a2000.nl. ;o) On Sat, 21 Nov 1998 14:17:35 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] >Look and see if there's a file with Delphi 2 called VB2Delphi or something >like that: it came along with Delphi 1, to help VB programmers make the >move to Pascal. Most versions of Delphi come with a lot of examples; only >the source for Delphi itself was restricted to Delphi Pro editions. canopusNov 21, 1998, 11:28pm
There's lots of good source code in the magazines *Delphi Informant* and
*Visual Programmer*. There are Delphi sites on the web, with posted code. Still have my copy of Cantu's *Delphi 2* book, but not the Delphi 2 files anymore, sorry. :( It'd be worth your while looking for that book on the bargain shelves, as his Delphi 4 book just came out. [View Quote] > None on my copy of Delphi 2.0. PCPlus claims its the full version. If > you still have the help file, my e-mail is decastro at cable.a2000.nl. > > ;o) > > On Sat, 21 Nov 1998 14:17:35 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] leo maukDec 1, 1998, 3:21am
"It's a poor workman that blames his tools."
You need to make sure your Variables are being declared properly. VB has the best GUI going. BB [View Quote] > Just to say I'll have to find another programming language that has > GUI support. VB6 can't read aw_string and crashes, sometimes > unexpectedly crashes on aw_int, in both cases with an ACCESS VIOLATION > in aw.dll... Can't spend more efforts on this rubbish language. And my > bot was getting so nice: walking, dancing, flying, travelling by foot > to new destinations... I could cry. > > I tried compiling the 1st SDK example in C with VC++6, within 15 > minutes I had the Speaker bot running and HEARING, a new experience > for me. But GUI support is lacking there, and I really want that too. > > Help! Canopus, how's Delphi? I havent programmed in Pascal since > Turbo times under DOS, that's years ago. Does object Pascal support > dlls in C? I have now Delphi 2, it's been given away for free. > > Desperately seeking.... > > XelaG x@x.com (xelag)Dec 1, 1998, 2:00pm
Thanks for the tip, BB. I'm not the only one who's had these problems
with VB, and I have asked for help regularly here. I didn't hear your voice then. Maybe you would care to publish your variable declarations? That would be most helpful. XelaG On Tue, 01 Dec 1998 00:21:13 -0500, Leo Mauk <lmauk at netonecom.net> [View Quote] >"It's a poor workman that blames his tools." >You need to make sure your Variables are being declared properly. >VB has the best GUI going. > >BB > > [View Quote] musicatDec 2, 1998, 1:02am
"const" means it's a declared constant or a fixed variable for whatever
feature or mathematical aspect (never changes) of the prog you want to create [View Quote] > Hi Canopus, > > I'll give Delphi 2.0 a try. I need some help, though, to get started. > I have your akSample2eForm.pas and akAWAPI.pas (build 9), but don't > really know how to start. I've been through the code, understand most > of it at first glance, and have a few remarks or questions, besides a > fundamental one: > > 1. how do you build this project in Delphi for this to work (I know > how to make a form and position buttons etc, thats about it in > Delphi). > > In akAWAPI: > > 2. why do you have to declare the apis twice? > > 3. you have a PInteger type in > function aw_data (a : AW_ATTRIBUTE; length : PInteger) : PChar; > cdecl; > is this intentional? > > 4. what does 'const' mean in, for instance, > function aw_create (const domain : PChar; port : Integer; instance : > PAWhInst) : Integer; cdecl; > can't it be just 'domain: PChar'? I couln't find this in the Delphi > help, only the syntax 'const xxx = yyy'. > > Any help or suggestions, also about books to read, is welcome! My > e-mail is decastro at cable.a2000.nl, just in case its not appropriate to > answer to the ng. > > Thanx, XelaG > > On Fri, 20 Nov 1998 19:55:42 -0500, Canopus <aek2 at ix.netcom.com> [View Quote] |