SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Using a COM Library

Last post 07-26-2006 10:16 AM by GoMa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-14-2006 10:56 PM

    Using a COM Library

    HI, new here, and I am sort of teaching myself C#.  So I'm working on creating a DLL of common methods I use (PGP Decryption, Email, etc..).  For email I want to use Redemption (http://www.dimastr.com/redemption/)

     

    So I regsvr32 redemption.dll, and add it as a reference.  But I can't open it.  I get the following error

     

    Can't load file Redemption.dll under C:\WINNT\system32.
    Check the file permission and the existence of that file.

     

    Thanks for the help

    OS: Windows 2000 SP4
    .NET 1.1
    Using SharpDevelop version 1.1 build 2124
  • 07-15-2006 1:02 PM In reply to

    Re: Using a COM Library

    To use COM or ActiveX in #develop, you will need to follow the steps given on this wiki page.
  • 07-17-2006 5:33 PM In reply to

    Re: Using a COM Library

    Thanks for your reply, I read website and it says I need to create a COM Interface wrapper using

    aximp.exe c:\<your activex path>\Activex_Filename.ocx

    but my file is a dll (Redemption.dll)

    Also I couldn't find any place to add components.  I'm using SharpDevelop 1.0.2 build 1709

    Right now I have the DLL added as a reference but can't seem to access it with using statement.

    OS: Windows 2000 SP4
    .NET 1.1
    Using SharpDevelop version 1.1 build 2124
  • 07-17-2006 6:14 PM In reply to

    Re: Using a COM Library

    Referring to the framework documentation, you might need to use tlbimp.exe. The files then usually should be placed in the directory of your project (makes things easier for starters). Besides the 'using' statement, you will also need to add a reference in the project browser.


  • 07-17-2006 10:35 PM In reply to

    • GoMa
    • Top 25 Contributor
    • Joined on 04-12-2006
    • Posts 80

    Re: Using a COM Library

    You can't add redemption.dll as a reference because it is a Win32 dll and not a .NET one. The readme that comes in the zip file states:
    To use Redemption in VB or .Net languages, add "SafeOutlook" library to your project references.
    So in SharpDevelop, after you regsvr32 it (you said you did), you have to right click the project, click Add Reference, and in the COM tab select SafeOutlook. SharpDevelop should automatically generate an interop assembly for you.
  • 07-17-2006 11:29 PM In reply to

    Re: Using a COM Library

    aha!

     

    thanks again guys for your help.  i read the documentation but didn't understand what adding SafeOutlook library to my project reference meant.  I'm new so I went looking for a "SafeOutlook.dll"

    I just get confused between regsvr32, regasm, tlbimp, and now aximp.

    Too bad there's not one exe or GUI that just does what you want no matter what you're working with.  Sigh.

     

    Thanks again guys

    OS: Windows 2000 SP4
    .NET 1.1
    Using SharpDevelop version 1.1 build 2124
  • 07-26-2006 12:47 AM In reply to

    • IgorV
    • Not Ranked
    • Joined on 07-25-2006
    • Posts 1

    Re: Using a COM Library

    Hi, there! I've just come accross this discussion while looking to a hint for using SafeOutlook in C#.net in VS 2005. I've added the "Redemption" library to my project's References and I've added

    using Redemption; to my class' code. Having done that I expected to be able to create an outlook application object with the following lines of code:

    ---------

    using System;

    using SHDocVw;

    using System.Runtime.InteropServices;

    using System.Diagnostics;

    using System.Threading;

    using mshtml;

    using Redemption;

    namespace MyNameSpace

    {

    public class MyProgram20060718

    {

    static void Main(string[] args)

    {

    Outlook.Application outlookApp = new Outlook.Application();

    ............................

    it did not work. The C# compilere did not understand it.

    What have I done wrong? or failed to do at all?

    Thank you

    Igor

  • 07-26-2006 10:16 AM In reply to

    • GoMa
    • Top 25 Contributor
    • Joined on 04-12-2006
    • Posts 80

    Re: Using a COM Library

    IgorV, you need to add the SafeOutlook COM library, not Redemption.dll (see whole thread for explanation).
Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.