Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to call c# dll from vbscript
    primarykey
    data
    text
    <p>Hi I am creating a c# dll with below code</p> <pre> using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; namespace imageexport { [ComVisible(true)] public class ExportImage { [ComVisible(true)] public void exportPNG(String pDirectory,String svgFileName,String outputFileName) { String arguments= pDirectory+"res\\include\\highcharts-convert.js -infile "+pDirectory+"res\\graphs\\"+svgFileName+" -outfile "+pDirectory+"res\\graphs\\"+outputFileName +" -scale 2.5 -width 1088"; /*using (StreamWriter writer = new StreamWriter("c:\\debug.txt", true)) { writer.WriteLine("pDirectory=" +pDirectory); writer.WriteLine("arguments="+arguments); }*/ Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = false; p.StartInfo.FileName = pDirectory+"res\\bin\\phantomjs.exe"; p.StartInfo.Arguments = arguments; p.Start(); p.WaitForExit(); } } } </pre> <p>For creating dll I do configuration as below in VS2005<br></p> <pre> <b>Application</b> Assembly Name -> imageexport Default Namespace - > imageexport outputtype => Classlibrary startup object ->(Not Set) Assembly Information : a) Assembly Version ->1 0 0 0 b)File Version ->1 0 0 0 c) Make Assembly Com visible ->checked <b> Build </b> Configuration -> Active (Debug) Platform ->Active (Any CPU) General : a)conditional Compilation Symbols -> blank b) Define Debug Constant ->checked c) Define Trace Constant -> checked d) platform Target -> Any CPU e) allow unsafe code -> not checked f) optimize code -> not checked g) warning lavel -> 4 h) Supperess warning -> blank i) Treat Warnign errors -> None </pre> <p>Now after this I register the imageexport.dll with regasm of .net 2.0<br></p> <p>Now when I look registry then under HKEY_CLASSES_ROOT I found imageexport.ExportImage. <br></p> <p>Now in vbscript below code is use to create object and call the function</p> <pre> Dim obj Set obj = CreateObject("imageexport.ExportImage") obj.exportPNG rvPAWZDirectoryPath&"\","SVGData_"&Session("export_time")&".svg","Export_" & export_time & ".png" </pre> <p>But this give exception named 'UnknownException' at the line createObject in VBSCript. Please tell me where is the problem</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload