[Stackoverflow] [Progress OpenEdge ABL] Use Custom DLLs into Progress

Status
Not open for further replies.
R

Raphael Frei

Guest
I'm having some issues while loading my custom DLL to OpenEdge Enviroment.

I've already copied my DLL to an PROPATH value and imported the DLL inside ProAsmRef.exe (The DLL is in the same folder as ProAsmRef and assemblies.xml)

The problem is, when I try to load my custom file inside a procedure, it sends me this current error:

Code:
**Unknown table name PCControl. (200)

I've already imported the DLL on my definition block with:

Code:
USING PCControl.*.

My DLL depends on another DLL (System.DirectoryServices.dll) but is already on assemblies.xml.

I can't figure it out why PCControl isn't importing, because I already have another two DLL's and they are working just fine...

Thanks for the help!

My DLL Code:

Code:
using System;
using System.DirectoryServices;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Outlook;

namespace PCControl{

public class PCC{

public static string AzureLogin(string user, string password) {

        string status;

        try {
            DirectoryEntry entry = new DirectoryEntry("LDAP://AUTOEXPR.COM", user, password) {
                AuthenticationType = AuthenticationTypes.Secure,
                Username = user,
                Password = password
            };

            DirectorySearcher _searcher = new DirectorySearcher(entry);
            _searcher.Filter = "(objectclass=user)";
            SearchResult _sr = _searcher.FindOne();
            string? _name = _sr.Properties["displayname"][0].ToString();

            status = "SUCCESS - User " + user + " has logged in.";

        } catch (System.Exception e) {
            status = "ERROR - While logging in: " + e.ToString();

        }

        return status;
    }
}
}

My XML:

Code:
    <?xml version="1.0" encoding="utf-8"?>
<references xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <assembly name="ClassADT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <assembly name="ClassOPC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <assembly name="PCControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <assembly name="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</references>

My login.p (resumed):

Code:
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE Login C-Win 
PROCEDURE Login :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
 
    DEF VAR lSuccess AS CHAR NO-UNDO.
 
    lSuccess = PCControl.PCC:AzureLogin("arorap1", "12345").
 
    MESSAGE lSuccess
        VIEW-AS ALERT-BOX INFO
        TITLE "ok".
 
 
END PROCEDURE.
 
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

This issue is not related to my code into DLL... I've added the function in my co-worker's DLL and it works perfectly:

Code:
USING ClassADT.*.

DEFINE VARIABLE LSuccess AS CHAR NO-UNDO.
    IF AVAIL usr_param AND usr_param.usr_ativo EQ TRUE THEN
        lSuccess = ClassADT.MyAdt:MyLogin(txtUser:SCREEN-VALUE, txtPassword:SCREEN-VALUE).

Continue reading...
 
Status
Not open for further replies.
Back
Top