Powerhouse for Windows question (8.41D)

Richard Sheehan sheerich at isu.edu
Thu Jun 30 12:58:10 CDT 2005


Jody,

In order to receive a value back from a dll called by the do external, 
you must setup the dll to also accept the fields that you will be 
passing back the information.

I wrote an ldap authentication external in C that does something similar.

<PHCODE - kindof >
  ;----------------------------------------------------------------
  PROCEDURE INTERNAL LDAPAUTH                                     
    BEGIN                                                         
      LET UID = TRUN(USERNAME) + EOFC                             
      LET PW = TRUN(DOWNSHIFT(T-PIN)) + EOFC                      
      DO EXTERNAL ldapauth (host,uid,ou,o,o2,pw,result)           
    END                                                           
  ;----------------------------------------------------------------

.
.
.
PROCEDURE DESIGNER LOGN PRECOMMAND FIND NODATA                       
  BEGIN                                                              
    IF USERNAME = '' OR T-PIN = ''                                   
    THEN BEGIN                                                       
      LET MSG = "User Name and Password are Required, Please Retry." 
      DO INTERNAL REDISPLAY-MENU                                     
      END                                                            
    DO INTERNAL CHECK-ACCESS            ; Check for FS Tools access in
;    GET CHECK-PASSWORD OPT              ; Check Id and Password on WW
;    IF NOT ACCESSOK                                                 
;    THEN BEGIN                                                      
    LET RESULT = 9                                                   
    DO INTERNAL LDAPAUTH              ; LDAP Authentification.       
    IF RESULT <> 0                                                   
    THEN BEGIN                                                       
      LET MSG = &                                                    
        "Sorry. You have entered an invalid ID or Password, Please Ret
.
.
.

</PHCODE>
<C Code kinda>
#include "./include/ldap.h"

void ldapauth(char *t_host,
              char *t_uid,
              char *t_ou,
              char *t_o,
              char *t_pw,
              int  *t_result)

{
.
.
.
//  If everything is OK
  *t_result = 0;
  return;
 }
</C Code>

Of course, there is only so much available memory for the DO EXTERNAL 
process, Bob Deskin can fill you in on any of those specifics; but in 
general you could use a similar approach.  You could even modify the 
fields that your a passing to the DLL directly.  But that may not be 
desired.

Richard Sheehan
IT Programmer Analyst
208-282-4427
Student Services, College of Technology
Idaho State University
Pocatello, ID  83209-8380



Jody Burgess ISP wrote:

>Good afternoon;
>  I am involved in testing some facetes of PowerHouse 8.41D on an Win32
>based XP machine. My question deals with passing string &/or integer
>parameters back and forth between a quick screen and a dll. The examples I
>have found show basically how use the DO EXTERNAL command to exectute
>functions inside of a dll while passing parameters but I have not found any
>that how to receive parameter values back into a quick screen from a dll
>based function. If any one has any knowledge regarding this issue, I'd be
>very happy to hear from you.
>
>Thanks
>
>Jody Burgess
>
>  
>


More information about the powerh-l mailing list