473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

COM interop problem

Hey,

i have problems with the COM interop stuff of .NET.
I have a COM component with following interface:

interface IActionSet
{
void foo();
}
interface IController
{
void Init( IActionSet* as );
}

i added this dll to my .NET project, implemented a C# class which implements
IActionSet.
then i pass this class to the method Init(...).
inside i just call foo()

what i get as result is a NullReferenceException.

Anybody any idea how to solve this?

THX

Tom
Nov 15 '05 #1
2 1244
Hi,
i added this dll to my .NET project, implemented a C# class which implements IActionSet.
then i pass this class to the method Init(...).
inside i just call foo()

what i get as result is a NullReferenceException.


Can you send whole code, including Init() method?
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com

Nov 15 '05 #2
C# file:

....

[ClassInterface(ClassInterfaceType.AutoDispatch)]

class ActionSetImpl : ATLControllerLib.IActionSet

{

public void Bla(){}

}

[STAThread]

static void Main()

{

ATLControllerLib.IControllerClass cc = new
ATLControllerLib.IControllerClass();

ActionSetImpl AS = new ActionSetImpl();

AS.Buy();

ATLControllerLib.IEventHandler eh = cc.Init( AS );

return;

}

Implementation of COM methode: (created with .NET studio -> add simple ALT
object)

STDMETHODIMP CIController::InitController(IIActionSet* as, IIEventHandler**
ret)

{

as->Bla();

return S_OK;

}

"Arthur Nesterovsky" <ar****@nesterovsky-bros.com> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Hi,
i added this dll to my .NET project, implemented a C# class which

implements
IActionSet.
then i pass this class to the method Init(...).
inside i just call foo()

what i get as result is a NullReferenceException.


Can you send whole code, including Init() method?
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nadav | last post by:
Hi, Introduction *************** I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer,...
20
by: Razzie | last post by:
Hey all, I'm really going through a small hell right now - I've completely lost it :) I made a project, using two interop libraries from exchange (created them as in this msdn article:...
1
by: Shiro | last post by:
Hi I have read the various postings relating to Interop strong name signing and cannot find an example similar to mine. I have stringly named my AxInterops/Interops and they all work just...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.