Hey guys, I came across something I like to share with you, which makes it incredibly easy to extend DXL. Ever thought about making a COM Server for some functionality, but considered it to complex? Or you were looking for some complex functionality that is just missing in DOORS...
<?xml version="1.0"?>
<component>
<registration description="Easy" progid="MyFirst.WSC" version="1.00"
classid="{74bb1ba9-2e69-4ad6-b02c-c52f3cbe153b}"/>
<public>
<method name="SayHello"/>
</public>
<script language="VBScript">
sub SayHello()
MsgBox "Hello"
end sub
</script>
</component>
Save this to a 'wsc' file e.g. SayHello.wsc, right click on it and choose "Register" (you need the right to register COM servers on your windows). Afterwards execute the following DXL code:
OleAutoObj o = oleCreateAutoObject "MyFirst.WSC" if (null o) error "Please register the MyFirst.WSC library first" oleMethod (o, "SayHello")
<?xml version="1.0"?>
<component>
<registration description="Easy" progid="SHATest.WSC" version="1.00"
classid="{F21A632A-F422-42D8-A586-90E2D4D5AFF9}"/>
<public>
<method name="sha256_digest"/>
</public>
<script language="JScript" src="sha256.js"/>
</component>
OleAutoObj o = oleCreateAutoObject "SHATest.WSC"
if (null o) error "Please register the SHATest.WSC library first"
OleAutoArgs args = create()
put (args, "IT-QBase")
string result = ""
if (null oleMethod (o, "sha256_digest", args, result)) {
print "Success: " result "\n"
} else {
print "Fail ..."
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias Mamsch - Thu Mar 29 03:28:30 EDT 2012 |
Re: Easy DOORS extension great idea, offering nice possibilities. Always fun to read your postings ;-) We ourselves worked out a Visual C# proof-of-concept to combine a "real" GUI with DXL backend processing. This also allows for a pretty easy and performant enhancement of functionality, especially regarding usability. Regards, Gerhard --- innoreq GmbH Einfach Prozesse verbessern. |
Re: Easy DOORS extension Yo can use this URL http://www.guidgenerator.com/online-guid-generator.aspx to generate GUIDs. Regards, Alain |
Re: Easy DOORS extension |
Re: Easy DOORS extension If I try to register the file per your instruction, the following error is generated. "The module "C:\Windows\system32\scrobj.dll" was loaded but the call to DllInstall failed with error code 0x80004005." I also have tried to register from the command prompt and got the same message: c:\Windows\system32> regsvr32 c:\Users\n1126485\Desktop\MyFirst1.wsc %SystemRoot%\system32\scrobj.dll
Got the same error message.
Any suggestion is appreciated!
thanks FZ |
Re: Easy DOORS extension
Hello Mathias
But running the java-script using wscript will do the same for everyone. |
Re: Easy DOORS extension faisal.zahidi@boeing.com - Thu Sep 18 19:33:55 EDT 2014 If I try to register the file per your instruction, the following error is generated. "The module "C:\Windows\system32\scrobj.dll" was loaded but the call to DllInstall failed with error code 0x80004005." I also have tried to register from the command prompt and got the same message: c:\Windows\system32> regsvr32 c:\Users\n1126485\Desktop\MyFirst1.wsc %SystemRoot%\system32\scrobj.dll
Got the same error message.
Any suggestion is appreciated!
thanks FZ The best is to goole for the error number. It seems that on your computer not all services are running, which are required for the job. |
Re: Easy DOORS extension Wolfgang Uhr - Sat Sep 20 00:55:51 EDT 2014
Hello Mathias
But running the java-script using wscript will do the same for everyone. Hi Wolfgang, as far as I know it is somehow possible to register a DLL for one user only, although that is not the point of this post. It is a general problem of ALL 3rd party COM servers (whether or not they were created with Windows Scripting Components). I guess this technique is most applicable to 3rd party venors, that have the possibility to bundle an installer with their plugins. Software deployment is general problem of any ecorporate infrastructure and it should be expected. that companies IT allows users to install the software necessary for their work. At my company for example people you can get temporary admin rights to be able to install software. Anyway, calling external programs (e.g. call wscript) is possible. The advantage of this approach is, that it is fast and you do not need to solve the problem of serializing your data to the external library. For this you need to solve the deployment. An external process (wscript) does not need deployment, but has much more overhead for each function call. Regards, Mathias
|
Re: Easy DOORS extension Mathias Mamsch - Sun Sep 21 13:32:26 EDT 2014 Hi Wolfgang, as far as I know it is somehow possible to register a DLL for one user only, although that is not the point of this post. It is a general problem of ALL 3rd party COM servers (whether or not they were created with Windows Scripting Components). I guess this technique is most applicable to 3rd party venors, that have the possibility to bundle an installer with their plugins. Software deployment is general problem of any ecorporate infrastructure and it should be expected. that companies IT allows users to install the software necessary for their work. At my company for example people you can get temporary admin rights to be able to install software. Anyway, calling external programs (e.g. call wscript) is possible. The advantage of this approach is, that it is fast and you do not need to solve the problem of serializing your data to the external library. For this you need to solve the deployment. An external process (wscript) does not need deployment, but has much more overhead for each function call. Regards, Mathias
Hello Mathias As far as I know, you can register a com server in HKEY_LOCAL_MACHINE, then the server is accessible by all users or you can register it in HKEY_USERS, the it is only avaliable for one user. But in both cases you need local admin priviledges. And of course, technically seen, there is nothing simpler than the registration of a com server in an installation process. But I'm working for an employee, who has contracted more 150.000 members and that means that there is a special department for everything elsewhere. In this case even the smallest installation script is a real project. And that is valid for the script and for any future changes.
Here an example: http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/disk/drives/#EnumDiskDrive.htm Let us take the example "FreeSpace" of a volume. On com-Server-Site you have the variable type Variant, which means that the script interpreter itself decides the type of the variable which is used. FreeSpace is of type Longint. In doors dxl you do not have Longint, you only have Integer. I've tested this routine on my volume C:. Windows tells me, that the free space is about ~84,5 GB. FSO inside of dxl tells me, that the free space is about ~-2,1 GB. And if I change from
int iReturn; to
string sReturn; then I gent an empty string for the solution
real rReturn;
Only sometimes - then you are very lucky - you can avoid serializing.
Best regards |