Calling DLL/library from DXL

Hi,

Is it possible to call function from a DLL from DXL?

Something like

ret = executeFromDll('foo.dll', 'Foobar', 'Hello, World')

(calls function Foobar from foo.dll with string argument 'Hello, World' - or similar.

I need to write a complex parser which I want to implement in C#.

Regards
N
Smartcard8101 - Tue Apr 24 11:41:44 EDT 2012

Re: Calling DLL/library from DXL
SystemAdmin - Tue Apr 24 13:22:03 EDT 2012

I think if you encapsulate your complex parser as a registered COM object, you can use get to it.

Read this post and it may get you well on your way:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14773177&#14773177

Re: Calling DLL/library from DXL
octavianstanescu - Wed Jul 18 20:12:52 EDT 2018

Hi, the link you posted is no longer working.

However I create 3 COM DLLs with Visual Studio 2015 and none is loading in DOORS 9.6.1.10...

One is a ClassLibrary .NET - ComVisible, 

One is an ATL project with C++

One if an MFC - ocx project with C++ 

DOORS, oleCreateAutoObject is returning null.

In Excel I am able to call the following code is working ok:

 

Sub f()
  Dim f As cl1.cl1class
  Set f = CreateObject("cl1.cl1class")
  Debug.Print f.ToString
 
End Sub
 

Do the DLLs need to be specially signed? compiled to a specific target? or anything special that DOORS needs?

 

 

 

Re: Calling DLL/library from DXL
Mathias Mamsch - Thu Jul 19 06:26:58 EDT 2018

octavianstanescu - Wed Jul 18 20:12:52 EDT 2018

Hi, the link you posted is no longer working.

However I create 3 COM DLLs with Visual Studio 2015 and none is loading in DOORS 9.6.1.10...

One is a ClassLibrary .NET - ComVisible, 

One is an ATL project with C++

One if an MFC - ocx project with C++ 

DOORS, oleCreateAutoObject is returning null.

In Excel I am able to call the following code is working ok:

 

Sub f()
  Dim f As cl1.cl1class
  Set f = CreateObject("cl1.cl1class")
  Debug.Print f.ToString
 
End Sub
 

Do the DLLs need to be specially signed? compiled to a specific target? or anything special that DOORS needs?

 

 

 

I think the effort of trying to make a COM Wrapper around your external program is not worth it. Also the hassle of making the COM DLL available on the client PCs can be a real turn off. I would suggest, that you make an external executable that you interface with in some way, and that you start from your DXL. This external executable can access your DLLs. How the best implementation will look depends however on your requirements (how much data you need to exchange, how much latency you can allow for the DLL calls). Regards, Mathias

Re: Calling DLL/library from DXL
octavianstanescu - Thu Jul 19 07:41:50 EDT 2018

Hi,

The reason I need is because I need the return value from the DLL/COM function.

I wrote a dxl that is a "workflow" around signatures for baselines.

Our DOORS is setup in Citrix environment with the -osUSER option so any authenticated user in citrix can start DOORS without any password dialog (based on FDQN key attached to each account).

In this setup, when you add a signature to a baseline DOORS is not asking for a password anymore - which seems like a bug, but I want to take advantage and make my call to the windows domain to check the user/password combination.

Our DOMAIN password is under many restrictions and each user already knows it because it is used in all other systems.

 

So the ultimate goal is to have a function that returns true/false given a user name and password like this:

bool doomainAuth(string user, string pass) 

 

This function already exists in win32 api but the only way I can think to make it work is by using COM/DLL...

I appreciate any other ideas...

 

 

Re: Calling DLL/library from DXL
Mathias Mamsch - Thu Jul 19 08:49:27 EDT 2018

octavianstanescu - Thu Jul 19 07:41:50 EDT 2018

Hi,

The reason I need is because I need the return value from the DLL/COM function.

I wrote a dxl that is a "workflow" around signatures for baselines.

Our DOORS is setup in Citrix environment with the -osUSER option so any authenticated user in citrix can start DOORS without any password dialog (based on FDQN key attached to each account).

In this setup, when you add a signature to a baseline DOORS is not asking for a password anymore - which seems like a bug, but I want to take advantage and make my call to the windows domain to check the user/password combination.

Our DOMAIN password is under many restrictions and each user already knows it because it is used in all other systems.

 

So the ultimate goal is to have a function that returns true/false given a user name and password like this:

bool doomainAuth(string user, string pass) 

 

This function already exists in win32 api but the only way I can think to make it work is by using COM/DLL...

I appreciate any other ideas...

 

 

First of all, you need to be aware about security considerations:

- There is no security with this. Period.

- With DXL you will not be able to implement this securely, without the possibility for users working around it.

- In the end the user could add a signature to a baseline in DOORS manually.

Ok, this being said - with a simple use case like this you should not bother with COM. Create an Executable in any language that calls the API function and takes a file as a parameter. E.g.

verifyDomainAccess.exe  username password c:\temp\SomeTempFile.dat

The tool verifies the domain credentials and writes the result to the tempfile (e.g. true or false).

In your DXL you launch the tool with the correct parameters:

string username = "test"
string password = "me"
string tempfile = tempFileName () 
system("C:\\Path\\To\\Your\\Tool\\VerifyDomainAccess.exe \"" username "\" \"" password "\" \"" tempFilePath "\"")

// read the contents of tempfile and evaluate

I think this is the easiest way to achieve what you want without having to bother with COM and installing the library in your citrix environments. Regards, Mathias

Re: Calling DLL/library from DXL
octavianstanescu - Mon Jul 23 13:28:33 EDT 2018

Ok, I found the solution. - 

It involves an ATL Project build as .exe.

Visual Studio 2017 is broken - so using 2015 is possible - but even with this one the registry entries are incomplete 

But, there is a MySrv.MyObj C++ sample project that has the required registry entries and one can either modify it for functionality or can copy the required reg entries into a new project.

- with this I am able to call LoginUserA (windows api function) from within the dxl script to check user credentials

Now I have to clean my registry from all the demo/test projects that I created trying different version of visual studio ...