logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SCO/RCO for all modules

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Senalaya



Joined: 29 Dec 2004
Posts: 82
Location: Germany

PostPosted: Thu Jan 20, 2005 15:42    Post subject: SCO/RCO for all modules Reply with quote

After looking through the sources, I came to the idea, that it would be great if the SCO/RCO hook could be used by more modules than just the ODBC module.

I'd like to propose the following:
- include the scorcohook.* into the NWNXdll
- rename SQLSCO / SQLRCO to NWNXSCO / NWNXRCO.
- extend the CNWNXBase class with OnSCO() / OnRCO() methods.
- use the same syntax for the database name as for the stringvar name. (i.e. NWNX!ODBC or NWNX!ODBC!FETCHMODE, etc)
- the 'key' variable could then even be used for the SQL statement in case of ODBC.
- NWNXSCO / NWNXRCO then calls OnSCO() / OnRCO() for the module class. (about the same way as the Payload function does)

Discuss Razz

Edit: Updated some of the ideas.
Back to top
View user's profile Send private message
dragonsong



Joined: 08 Jan 2005
Posts: 19
Location: Salinas, CA

PostPosted: Fri Jan 21, 2005 7:05    Post subject: Reply with quote

It would make very easy work for NWNX-Leto, at the least, so of course it has my vote. Wink

I think for it to be of broad utility, though, the arguments in the events would have to be very generic - probably a pointer (memory) and an int (size); mind you, that's the opinion of a Delphi programmer thinking of porting the call over to a DLL in a completely foreign environment, and I could surely make do with something more structured. (My happy observation of NWNX thus far is very little attachment to MSVC libs, though.)
_________________
- dragonsong
Back to top
View user's profile Send private message Visit poster's website
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Jan 21, 2005 10:11    Post subject: Reply with quote

These are good ideas indeed. I want the dust to settle down a bit before making major changes to the codebase again, but I have no objections if someone else wants to try it out locally. When the current ODBC2 module is more stable, we can merge the changes back in.

dragonsong, what do you mean with "more structured" ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dragonsong



Joined: 08 Jan 2005
Posts: 19
Location: Salinas, CA

PostPosted: Sat Jan 22, 2005 7:38    Post subject: Reply with quote

Well, whenever I have two classes talking to one another about some chunk of memory, I just have them pass a TMemoryStream back and forth, in Delphi. I think I've come to rely heavily on classes in the Delphi model, and my C has never been too strong. Using a pointer and an int almost seems "crude" to me, but I've become spoiled by a single-vendor environment. Very Happy

I agree about letting the dust settle. Out of curiosity, I might take you up on a local build. (Though it's bound to be a patchwork build at best.)
_________________
- dragonsong
Back to top
View user's profile Send private message Visit poster's website
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Sat Jan 22, 2005 11:01    Post subject: Reply with quote

Heh.. using a memory stream and a pointer is almost similar to me Smile . I just had a look in the documentation about that class. As far as I understand it, that stream allocates a part of the memory and you can store memory in there. In this case we can not do that as much objects are created by NWN. And storing those object everytime in a stream buffer costs to much time.

Only passing a pointer is a bit easier than first creating a stream object and then pass that on. We have written NWNX with speed and simplicity in mind.
Back to top
View user's profile Send private message Visit poster's website
dragonsong



Joined: 08 Jan 2005
Posts: 19
Location: Salinas, CA

PostPosted: Sun Jan 23, 2005 0:14    Post subject: Reply with quote

Yes, and I think that's probably why Delphi still isn't considered quite as fast as C, since most Delphi programmers are wont to throw around objects, in the interest of simpler (I guess I wanted to use the word "more structured") code. But I have all respect for doing it the "hard" (fast, efficient) way, at the low level. Smile
_________________
- dragonsong
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group