473,394 Members | 1,773 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,394 software developers and data experts.

Using DLL from Unmanaged Code : Unable to access parent interface members

Hello,

(1) I am building a com component with multiple interfaces in .NET Managed
VC++
(2) Then use the managed .NET dll in unmanaged code after registering
through regasm and getting the tlb file

Problem:
(A) Everyrthing works fine except that I get a compile time error C2039
while trying to
ACCESS PARENT INTERFACE's MEMBER function

(B) I notice that the tlh file created does not contain the parent
interface's member functions in the child
interface

CODE FOR .NET MANAGED DLL
namespace ClassLibrary1
{
public __gc __interface IBaseInterface
{
public:
virtual void func1(); //parent interface's member function
};

public __gc __interface IChildInterface: public IBaseInterface
{
public:
virtual void func2(IChildInterface* pChild); //child interface member
function
};

[ClassInterface(ClassInterfaceType::AutoDual)]
public __gc class Class1: public IChildInterface
{
virtual void func1() { } //implementation for IBaseInterface::func1
virtual void func2(IChildInterface* pChild) //implementation for
IChildInterface::func2
{
pChild - > func1(); //NO ERROR while accessing
parent interface member here
}
};

};

CLIENT CODE:
{
IChildInterfacePtr child;
HRESULT hr = child.CreateInstance(__uuidof(Class1));
child - >func2(); //OK
child - >func1( child ); //ERROR
}

Error
error C2039: 'func1' : is not a member of 'IChildInterface'
ClassLibrary1.tlh(161) : see declaration of ''IChildInterface'
Regards,
Maansi

Nov 17 '05 #1
0 1163

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

Similar topics

5
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
1
by: DataB | last post by:
Hi Everyone! I have, essentially, two table structures in the same ms access database file. Both are of the parent-child format, one parent table with personal details, then multiple child...
15
by: Brian Rogers | last post by:
Hello everyone, I apologize for the cross and re-post, but I am still searching for an answer. Why can C++ can create this object, but C# can't? I am trying to create an instance of the...
47
by: Bonj | last post by:
I downloaded the gzlib library from zlib in order to do compression. (http://www.gzip.org/zlib) The prototype of the compression function seems to be int compress (Bytef *dest, uLongf *destLen,...
2
by: Bob Beauchaine | last post by:
I found out the hard way that I can't include an STL container in a form object, and spent a half day trying to locate authoritative documentation on exactly why. So far I've concluded from...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: DocAccolade | last post by:
I am trying to include a legacy com control (controlname.ocx) in an asp.net application using vs 2003. I have added the control to the user control tool box, then dragged it to the form. However,...
16
by: pkoniusz | last post by:
Hello everybody, Been just thinking how actually one could convert the following unmanaged code to the managed C++: struct JustAnExample { char value1; int value2; // etc ....
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.