Skip to main content
Participant
June 14, 2007
Answered

Where does Coldfusion store the reference to server libraries (C++).dll's ?

  • June 14, 2007
  • 2 replies
  • 556 views
I am using a custom tag CFX_IMAGE. It is a .dll file which needs to be registered in the Coldfusion Administrator in order for Coldfusion to find this file. I would like to register this tag automatically with code versus having to manually register the .dll in the Coldfusion Administrator. Does anyone know where this reference is stored and how I would create this reference with code?
This topic has been closed for replies.
Correct answer c_wigginton
Assuming JAVA object creation hasn't been locked out, here is a scripted method for a cfx install.
The example below is an install of the nslookup.dll located in the same directory as the installation template


<cfobject action="CREATE"
type="JAVA"
class="coldfusion.server.ServiceFactory"
name="factory">

<cfset request.runtime = factory.getRuntimeService()>
<cfscript>
tagname = "CFX_NSLookup";
if ( structKeyExists(request.runtime.cfxtags, tagname) )
{
//delete the tag name, so when we add a new one it will trigger store()
//(adding and removing are the only things that triger the store() method.)
StructDelete( request.runtime.cfxtags, tagname);
}
// CPP for dll
// or JAVA
stCFXs = structNew();
stCFXs[tagname] = StructNew();
stCFXs[tagname].name = tagname;
stCFXs[tagname].type = "CPP";
stCFXs[tagname].description = "Provides NSLookup by TCP/IP, used by application for logging.";
stCFXs[tagname].cache = false;
stCFXs[tagname].procedure = "ProcessTagRequest";
stCFXs[tagname].library = "#expandPath('.')#\nslookup.dll";
// store this tag
request.runtime.cfxtags[tagname] = stCFXs[tagname];
</cfscript>

2 replies

c_wiggintonCorrect answer
Participating Frequently
July 2, 2007
Assuming JAVA object creation hasn't been locked out, here is a scripted method for a cfx install.
The example below is an install of the nslookup.dll located in the same directory as the installation template


<cfobject action="CREATE"
type="JAVA"
class="coldfusion.server.ServiceFactory"
name="factory">

<cfset request.runtime = factory.getRuntimeService()>
<cfscript>
tagname = "CFX_NSLookup";
if ( structKeyExists(request.runtime.cfxtags, tagname) )
{
//delete the tag name, so when we add a new one it will trigger store()
//(adding and removing are the only things that triger the store() method.)
StructDelete( request.runtime.cfxtags, tagname);
}
// CPP for dll
// or JAVA
stCFXs = structNew();
stCFXs[tagname] = StructNew();
stCFXs[tagname].name = tagname;
stCFXs[tagname].type = "CPP";
stCFXs[tagname].description = "Provides NSLookup by TCP/IP, used by application for logging.";
stCFXs[tagname].cache = false;
stCFXs[tagname].procedure = "ProcessTagRequest";
stCFXs[tagname].library = "#expandPath('.')#\nslookup.dll";
// store this tag
request.runtime.cfxtags[tagname] = stCFXs[tagname];
</cfscript>
France19Author
Participant
July 3, 2007
Thank you! This was the information I needed. I tested this with my tag and it was registered successfully in the Coldfusion Administrator by using the script.
Inspiring
June 14, 2007
France19 wrote:
> I am using a custom tag CFX_IMAGE. It is a .dll file which needs to be
> registered in the Coldfusion Administrator in order for Coldfusion to find this
> file. I would like to register this tag automatically with code versus having
> to manually register the .dll in the Coldfusion Administrator. Does anyone know
> where this reference is stored and how I would create this reference with code?
>


I presume it is one of the neo-xxxx files in the lib folder, but I do
not know which one. If you are brave enough, one should be able to edit
this file with code, but the service needs to be restarted after a
change for new data to take effect.
France19Author
Participant
June 14, 2007
Thanks.....after looking around I see that it gets written to the neo-runtime.xml file