Page 2 of 2 <12
Topic Options
#50039 - 2000-06-14 10:35 AM Re: OLE in KiX
creutz Offline
Fresh Scripter

Registered: 2000-06-14
Posts: 32
Loc: Helsinki, Finland
sorry what is kixtart.library and where do i get it?

it is not for GUI but for the APIs and functions behind that OLE is needed

thanks anyhow everybody for supplying fine examples

Top
#50040 - 2000-06-14 02:18 PM Re: OLE in KiX
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
creutz:

kixtart.library is just something that I've been tinkering with. I use it to get at those nasty Windows api's that can come in handy every now and then !

It's quite easy to build your own if you've got any Visual Basic skills !

I've learned one thing so far - working with KiX OLE functions is painful - for two reasons:

1) The KiX OLE functions themselves are crude and do not lend themselves easily to natural, intuitive code flow. When one has to code a function call like this:

olecallfunc($hnd, "function", "sss", "str1","str2", "str3" )

Well - you get the idea !

2) KiX OLE is lacking in terms of the number of variable (variant) types supported. I've had difficulty converting even the easiest examples of WSH scripts into KiX !

Shawn.

Top
#50041 - 2000-06-14 04:04 PM Re: OLE in KiX
creutz Offline
Fresh Scripter

Registered: 2000-06-14
Posts: 32
Loc: Helsinki, Finland
Yes I know that KIX OLE is a little stiff yet but Mr Ruud is hopefully working on that.
But about your KixLib, You wouldnŽt like to share the library and/or the vb source for that with your fellow "bulletiniers" .
hm Perhaps not, OK IŽll try it myself
thanx anyhow

Top
#50042 - 2000-06-14 05:20 PM Re: OLE in KiX
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
creutz:

I'd love to share it - that was the whole intent of this excerise from day one !

I decided to write it in C++ because I wanted a library (DLL) that could be easily "inserted" (copied) into the KiX distribution package and wouldn't need a bazillion megs of VB runtime library support.

I wrote kixtart.library with MFC support and statically linked it with the DLL. Even though the library supports a handfull of functions (api calls) the full-blown version DLL size is 139,264 bytes (not bad) and no other dependencies. With dynamically linked MFC, the DLL would be invisible ( ok, maybe not invisible but real small).

Adding functions to the library will only consume incremental space from now on !

Don't know how you feel about C++ but I reckon that developing a KiX support library in Visual Basic will generate a lot of push-back from the KiX community.

I'd be more than happy to send it to you or discuss this further if you really want to roll-your-own with VB !

Shawn.

Top
#50043 - 2000-06-15 01:51 AM Re: OLE in KiX
Anonymous
Unregistered


Shawn,

I'm just starting out with C++ but I'm a heavy user of KIX. I'd love to opportunity to take a look at your library.

Most of the things I have had to shell out for are:

XCACLS
SUBINACL
SHOWACLS
MUNGE
XCOPY
NET FILE

I'd really like to do some of these things within KIX without having to shell out all the time parse the output to a text file and then scan the text file then pass the results to another shell command.

Hope this all makes sense.

Hope to hear from you soon.

------------------
David Gray
IT Professional
Brisbane Australia

Top
#50044 - 2000-06-15 09:35 AM Re: OLE in KiX
creutz Offline
Fresh Scripter

Registered: 2000-06-14
Posts: 32
Loc: Helsinki, Finland
Shawn,

My C++ knowledge is zero, thats why I use VB but as a heavy user I realize the overhead VB gives, therefore C++ is the correct answer for the "official" kixtart API library DLL. But for my personal use its VB.

What functions I would like to have in the DLL is ofcause all the APIs .
Sorry just joking. Administrative functions is what we(kix administrators) need, as DGray said
1, XCACLS (file/directory permissions)
2, User management (Add/Del/Mod/PWD)

One last thing, you donŽt have to send me your C++ code as i probably would understand a lot, but tell me which APIs you have used to get the machine memory, and if you have other administrative APIs in use.

tia
Creutz

Top
#50045 - 2000-06-15 02:59 PM Re: OLE in KiX
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Creutz:

I'll do better than that, I'll give you the VB source code:

[file: KixLib32.cls]

code:

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Class1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Public Function GetPhysicalMemory() As Integer

Dim Status As MEMORYSTATUS

Call GlobalMemoryStatus(Status)

GetPhysicalMemory = Status.dwTotalPhys

End Function


[file: KixLib32.bas]

code:

Attribute VB_Name = "Module1"
Public Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
Public Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)

Public Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Public Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)


Simply create a new "ActiveX DLL" project, slamdunk these files into Visual Studio and your off to the races !

Let me know if you have download formatting issues or if you just want me to send you these files via email.

I'll also email you the kixlib32.dll component and you can try it out yourself !

Shawn.

Top
#50046 - 2000-06-16 10:09 AM Re: OLE in KiX
creutz Offline
Fresh Scripter

Registered: 2000-06-14
Posts: 32
Loc: Helsinki, Finland
Shawn,
if possible, please send me kixlib32.dll, I would be greatful
tia

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.038 seconds in which 0.02 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org