Click here to Skip to main content
15,887,585 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionUse sytem icons Pin
Viktor Nilsson4-Mar-06 1:49
Viktor Nilsson4-Mar-06 1:49 
AnswerRe: Reading data samples from sound card Pin
Dan Neely3-Mar-06 6:42
Dan Neely3-Mar-06 6:42 
QuestionActive X in a Smart Client (is it Possible) Pin
mark_e_mark3-Mar-06 5:15
mark_e_mark3-Mar-06 5:15 
AnswerRe: Active X in a Smart Client (is it Possible) Pin
Vasudevan Deepak Kumar6-Mar-06 0:41
Vasudevan Deepak Kumar6-Mar-06 0:41 
Questionauto update a windows service Pin
mweber26@hotmail.com3-Mar-06 4:51
mweber26@hotmail.com3-Mar-06 4:51 
AnswerRe: auto update a windows service Pin
Dave Kreskowiak3-Mar-06 13:46
mveDave Kreskowiak3-Mar-06 13:46 
Questionpocket pc application Pin
bhavz693-Mar-06 4:01
bhavz693-Mar-06 4:01 
QuestionNet 2.0 and COM Interop (Winword) Pin
gill3-Mar-06 3:28
gill3-Mar-06 3:28 
Environment:
----------------
Win XP SP2
VS 2005 Prof. Release and VS 2003 Prof. Release
Winword 2003

Topic:
-------
Managed assembly compiled with VS 2005 and prepared for COM Interop (registered for COM-Interop and visible to COM-Applications, e.g. Winword) could not be instantiated in Winword through VBA-Macro.

Statement in VBA is something like this:
Set comp = CreateObject(“OMNIplan.TestCOMInterop2”)

Or using a Reference (Component is visible in VBA-Object-Browser):

Dim comp as OMNIplan.TestCOMInterop2
Set comp = new OMNIplan.TestCOMInterop2

An Error is thrown in VBA:
Number -2147024894
Description: File- or Assemblyname ‘TestCOMInterop2’ or a Dependency not found.

After compiling the same project with VS 2003 Prof. the Component instanciates und runs without problem.

The assembly is a local resource and not copied to a network directory.
In my opinion it is therefore trusted and no code access security is in play.

I have checked the registry entry for Net-Version 1.1 and 2.0, they are identical accept the Runtime-, Assembly-Version and codebase.
First I had thought it could be a registration error. Therefore I have tried regasm …, the same result.

A deployment with a setup-project yields the same error.

I suppose the error is triggered by Net 2.0. Net 2.0 seems to operate with COM Interop in another way than Net 1.1. (In my opinion it is a loader-problem, the contructor is never reached under Net 2.0)

Perhaps it is bug or it is by design. But what has changed, if it is by design ?
I am baffled, can someone help.

Thanks a lot
gill

The code:
-------------
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
//

namespace OMNIplan
{
[Guid("17693BE6-BC93-45fd-BE80-A079C957B001")]
public interface _ITestCOMInterop2
{
[DispId(1)]
bool OpenDocument (object wordApp, object wordDoc,
object wizard, object settings,
object kindDoc);
}
//--- Events-Interface
[Guid("17693BE6-BC93-45fd-BE80-A079C957B002")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _ITestCOMInterop2Events
{
}
//
[Guid("17693BE6-BC93-45fd-BE80-A079C957B003")]
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(_ITestCOMInterop2Events))]
[ProgId("OMNIplan.TestCOMInterop2")]
public class TestCOMInterop2 : _ITestCOMInterop2
{
private string csCRLF = System.Environment.NewLine;
public TestCOMInterop2()
{
MessageBox.Show("TestCOMInterop2: Constructor");
}

public bool OpenDocument(object wordApp, object wordDoc,
object wizard, object settings,
object kindDoc)
{
try
{
if ((null != wordApp) && (null != wordDoc))
{
MessageBox.Show("TestCOMInterop2.OpenDocument OK");
return true;
}
MessageBox.Show("TestCOMInterop2.OpenDocument Failed");
}
catch (Exception ex)
{
MessageBox.Show("StartUp-Fehler: " + ex.Message);
throw ex;
}
return false;
}
}
}
AnswerRe: Net 2.0 and COM Interop (Winword) Pin
Douglas Troy3-Mar-06 6:20
Douglas Troy3-Mar-06 6:20 
QuestionIncorporating several 3rd party installation programs into setup project? Pin
mike973052-Mar-06 11:25
mike973052-Mar-06 11:25 
QuestionGraphics update bottleneck Pin
magja2-Mar-06 3:51
magja2-Mar-06 3:51 
AnswerRe: Graphics update bottleneck Pin
Dave Kreskowiak2-Mar-06 8:09
mveDave Kreskowiak2-Mar-06 8:09 
GeneralRe: Graphics update bottleneck Pin
magja2-Mar-06 22:08
magja2-Mar-06 22:08 
GeneralRe: Graphics update bottleneck Pin
Dave Kreskowiak3-Mar-06 1:49
mveDave Kreskowiak3-Mar-06 1:49 
QuestionHow to write C# code in a vb.net form Pin
Maher Abu Zer1-Mar-06 23:51
professionalMaher Abu Zer1-Mar-06 23:51 
AnswerRe: How to write C# code in a vb.net form Pin
darkelv2-Mar-06 0:55
darkelv2-Mar-06 0:55 
AnswerRe: How to write C# code in a vb.net form Pin
Vasudevan Deepak Kumar2-Mar-06 1:38
Vasudevan Deepak Kumar2-Mar-06 1:38 
QuestionHow to Get Client IP address using TcpClient? Pin
Maher Abu Zer1-Mar-06 20:24
professionalMaher Abu Zer1-Mar-06 20:24 
AnswerRe: How to Get Client IP address using TcpClient? Pin
Nicholas Butler1-Mar-06 21:00
sitebuilderNicholas Butler1-Mar-06 21:00 
GeneralRe: How to Get Client IP address using TcpClient? Pin
Maher Abu Zer1-Mar-06 21:50
professionalMaher Abu Zer1-Mar-06 21:50 
AnswerRe: How to Get Client IP address using TcpClient? Pin
Nicholas Butler1-Mar-06 22:16
sitebuilderNicholas Butler1-Mar-06 22:16 
GeneralRe: How to Get Client IP address using TcpClient? Pin
Maher Abu Zer1-Mar-06 22:29
professionalMaher Abu Zer1-Mar-06 22:29 
AnswerRe: How to Get Client IP address using TcpClient? Pin
Nicholas Butler1-Mar-06 22:39
sitebuilderNicholas Butler1-Mar-06 22:39 
GeneralRe: How to Get Client IP address using TcpClient? Pin
Maher Abu Zer1-Mar-06 22:47
professionalMaher Abu Zer1-Mar-06 22:47 
QuestionCompact .NET Pin
rmander1-Mar-06 17:08
rmander1-Mar-06 17:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.