C# addin cannot create object

Jan 09, 2007 2 Replies

Hi,



I'm trying to create a c# add in for RMS 1.3 with vs2005 but get a cannot create object when the hook tries to start the dll. The code I'm using is shown below (just for a little test). When I compile the dll I have selected to make the assembly com visible.



I register the dll using regasm and the dll is located in the store ops folder.



Have I missed something ? (I can createobject using vba)



using System; using System.Collections.Generic; using System.Text; using System.IO;


namespace HalTender { public class Tender { private string m_LogFile Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\HalTender.txt"; private TextWriter tw;



public bool Process(Object obj) { LogIt(m_LogFile,"Started"); return true; }



private void LogIt(string LogFile, string Message) { if (!File.Exists(LogFile)) { tw = File.CreateText(LogFile); tw.Close(); } StreamWriter fs = new StreamWriter(LogFile, true); fs.WriteLine(DateTime.Now.ToString() + ": " + Message); fs.Close(); } }



}

Please post the hook entry to invoke your object.. thanks

cod

Hi Cod,

Thanks for the reply, the hook was 2, HalTender.Tender, 1. I have resolved the issue by adding a constructor...

public HalTender() { //do nothing }

Thanks, Olan

"cod" wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required