KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

lack of binary support in GUI end of KF .net
Goto page Previous  1, 2
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 3:36 pm    Post subject: Reply with quote

ja, was thinking same
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 9:03 pm    Post subject: Reply with quote

Streams are amazingly cool things ... you can read a text file with the same code used to parse a byte-array or any other stream.

You know Jooel - I implemented the base class Stream. But found that almost all the base members are overriden in the derived classes (like MemoryStream and FileStream) ...

I can define all the members only once, in Stream - and I tested things and everything works ... but you got your FileStream members there.

I can either remove your members and let them default back to the Stream - or - I could specify all your members as "overrides" base members - and keep them ... actually, this is just like the way dotnet has it. Just thats it more work down-the-road with the other streamers.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 9:14 pm    Post subject: Reply with quote

well, the most I'm considered about the internal stream pointer.
as that's what you need to pass to the image object, for example.

so, that is something that must be same for all streamers, right?

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 9:35 pm    Post subject: Reply with quote

yeah, I have worked out a custom "mechanism" for pulling-out the internal streamer (or any object for that matter) using an interface I call "IConnect" (you may have seen that) ... but ... the issue I'm trying to sort out is ...

There is this base class called "Stream" that has all these members defined, with the view that they are to be overridden by the derived class - not sure why Microsoft did this - other than to treat all the streams polymorphically or "the same" ... if so, why didn't they just let the base class handle the base members - why did they override all the members in the derived class.

It's kinda like the Control class ... every Control doesn't "re-implement" properties like Left, Top, Width etc. They did this with steamers though (or so it would seem).

I'm tempted right now to just leave things as overridden - which means I will have to into your code and add the "overrides" attributes to each of your members - then, Inherit your FileStream from Stream.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 9:38 pm    Post subject: Reply with quote

hmmm, think I know why they did it - because unlike buttons and textboxes and "controls" ... buttons and textboxes do indeed share a common "framework" called "control" whereas streamers prolly are quite different from one-another, under the covers.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 10:20 pm    Post subject: Reply with quote

you don't need to touch my code as my code does not implement and doesn't have to implement the basic stream.
I thought about that before and decided that instead of doing huge amounts of overriding or anything, I skipped the implements totally.

so again, I don't see any issues mixing them.
the only issue is when your controls need to use them.
this iConnect sounds little overshoot if it's anything more than just a call to a member of a class.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Jan 26, 2006 9:48 am    Post subject: Reply with quote

Quote:
Inherited FileStream from Stream class.


so, you went and did the inherit?
k, can I see the resulting code?

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jan 26, 2006 12:43 pm    Post subject: Reply with quote

You able to do something with this stuff yet ?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jan 26, 2006 4:36 pm    Post subject: Reply with quote

Was playing with making a little HEX DUMP proggy ....

Code:

Break On

$System = CreateObject("Kixforms.System")

If Not $file
 ?"usage: @SCRIPTNAME $file=<filename>"?
 exit
Endif

If Not Exist($file)
 ?"file $file not found"?
 exit
Endif

$Stream = $System.File.OpenRead($file)

$i = 0

For $j = 0 To $Stream.Length - 1

 If ($i mod 16) = 0
  ? SUBSTR("000000",1,6-len(CStr($i))) + CStr($i)
 Endif

 $byte = RIGHT(DecToHex($Stream.ReadByte),2)

 If Len($Byte) = 1
  $byte = "0" + $byte
 Endif

 " " + $byte

 $i = $i + 1

Next

Exit 0
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Jan 26, 2006 9:22 pm    Post subject: Reply with quote

what is this openread?
it's a shortcut but to which class?
to basic stream?

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jan 26, 2006 9:45 pm    Post subject: Reply with quote

OpenRead is a member of File that returns a FileStream on the opened file.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Fri Jan 27, 2006 10:54 am    Post subject: Reply with quote

k, went and checked:
Quote:

Remarks
This method is equivalent to
FileStream(String, FileMode.Open, FileAccess.Read, FileShare.Read)


so, it's a shortcut for filestream, not yours but the one MS made.

k.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group