Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load dll File in memory

Status
Not open for further replies.

fpal

Programmer
Nov 27, 2002
15
US
HI all
How i can load dll file in memory

Thanks for all
 
If the dll exposes a COM interface, you can use <CFOBJECT> to create an instance of the COM object and call its methods and properties. If this is the direction you need to go and you need further information, post back and I will post a code sample for you.
 
In the example below, I am calling a COM object from ZBitz that does zip-unzip actions on the server. After registering the .dll on the server, I used the Microsoft COM/OLE Viewer to find the class name of the object. You may also be able to find the class name from the product documentation. Similarly, you can find the object's properties and methods in the documentation or by using the COM/OLE Viewer.

You can download the viewer here:

It is not necessary to use <CFSCRIPT> to call the object's properties and methods, but I find it easiest to do it this way.
Code:
  <cfobject 
    type=&quot;COM&quot; 
    name=&quot;objZip&quot; 
    class=&quot;zbitz.zzip&quot; 
    action=&quot;CREATE&quot; 
    context=&quot;INPROC&quot;>
  <cfscript>
    unzipDir = &quot;C:\Windows\temp\&quot;;
    unzipFile = REQUEST.Upload_Dir & &quot;test.zip&quot;;

    /* Here's where we're calling the component's properties and methods: */
    objZip.Recursive = &quot;true&quot;;
    result = objZip.UnzipFile(unzipFile,unzipDir);

  </cfscript>
More good information on using <CFOBJECT> can be found in the Macromedia documentation. The online version of the MX documentation is currently down, but here's the CF5 version:

-pcorreia
Hope this post was helpful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top