#167490 - 2006-09-12 11:05 AM
use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
Hi, I will write a program which use a dll file. Here are 2 lines, which I want to write in kix..
call rxfuncadd "hllapi", "saahlapi", "hllapisrv" rc=hllapi("Connect",A)
How can I make this in kix? Thanks and best regards from Germany
|
Top
|
|
|
|
#167492 - 2006-09-12 11:15 AM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
>>-RXFUNCADD(name,module-+------------+-)---------------------->< '-,procedure-'
Registers the function name, making it available to REXX procedures. A return value 0 signifies successful registration. A return value 1 signifies that the function is already registered.
rxfuncadd('SysCls','rexxutil', 'SysCls') -> 0 /* if not already registered */ -> 1 /* if already registered */
I know that I can use a dll with CreateObject. But I don't know how I can use the functions etc...
|
Top
|
|
|
|
#167494 - 2006-09-12 11:49 AM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
Is there no other way to get a dll work ?
Thanks Dirk
|
Top
|
|
|
|
#167497 - 2006-09-13 08:38 PM
Re: use of a dll
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
Top
|
|
|
|
#167498 - 2006-09-15 08:36 AM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
Thx for the Link! I have the Problem, that why u know you must call HBullock.AdminObjects ? I use PE_Explorer to watch the dll and there is no such information.
I watched also my dlls and there is no Funktion for Register or Unregister the dll. So when I want register the dll with RegSvr32 there is a fault. Is this a sign that the dll didn't support COM Automation?
Thanks for help
|
Top
|
|
|
|
#167499 - 2006-09-16 01:50 AM
Re: use of a dll
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Please post your test code.
did you register the DLL? REGSVR32 HABobjects.DLL
I wrote the DLL. The following code works on my computer. Code:
break on $iRC=SETOPTION('WrapAtEOL','on') $HABObject = createobject("HBullock.AdminObjects") if vartypename($HABObject) <> "Object" ? "Not an object ("HBullock.AdminObjects"): " + @serror endif ;Docs: ; ;You need to pass 4 parameters: ; 1. The name of the library from which you want to import the function. ; 2. The name of the function (as exported by the library). ; 3. The number and types of the arguments the function expects as input. ; 4. The type of the value returned by the function. ; ;Parameters 3 and 4 follow: ; I: value is an integer (int) ; N: value is a number (long) ; F: value is a floating point number (float) ; D: value is a double precision number (double) ; C: value is a char (char) ; P: value is a pointer (to a string, structure, etc) ; ;Parameter 4 could also be V for void ; ;$GetProcessID = $HABObject.Win32API ("kernel32", "GetCurrentProcessId", "", "I" ) ; kernel32 is name of library ; GetCurrentProcessId is name of function ; There are no input paramters ; The function returns an integer
;This works great. ;------------------ $GetProcessID = $HABObject.Win32API ("kernel32", "GetCurrentProcessId", "", "I" ) ? "Win32API call: " + @serror ? vartypename($GetProcessID) $pid = $GetProcessID.Call ? "pid = " + $pid ?
Edited by Howard Bullock (2006-09-16 01:53 AM)
|
Top
|
|
|
|
#167500 - 2006-09-18 07:59 AM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
Your DLL really works fine. My Problem is, that you call "HBullock.AdminObjects" But from where I know that I must call exactly this? There is no Funktion which is named HBullock.AdminObjects. And I dind't know what i must call in my dll. But my DLL haven't the functions for Registration.
Regards and thanks Dirk
|
Top
|
|
|
|
#167501 - 2006-09-18 08:26 PM
Re: use of a dll
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This is simply a COM library.
I do not call"HBullock.AdminObjects". It is a name not a method. I use the name to access the COM object by name.
Beyond that explanation you will have to be more specific as I do not understand what you are attempting to do or how you are are coding the test.
|
Top
|
|
|
|
#167505 - 2006-09-19 08:23 AM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
Ok you make with CreateObject a Reference to the Object called "HBullock.AdminObjects". My Problem is, that I dind't know, why you call exactly this HBullock must be the serverclassname and AdminObjects the Typclass? But from where you know that u must exactly call this? The name is different, also when I watch the dll with PE Explorer there is nothing to see with HBullock.
The Problem is, that I must know, if it is possible to let my dll run with kix...
|
Top
|
|
|
|
#167507 - 2006-09-20 02:29 PM
Re: use of a dll
|
guenni
Fresh Scripter
Registered: 2006-09-12
Posts: 9
|
I will use a ehllapi.dll to make a 3270 session. In RExx it is no Problem to use the dll. But I don't know if it is possible to use this also with kix.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|