473,399 Members | 3,106 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,399 software developers and data experts.

error C3767: candidate function(s) not accessible + COM interface pointers

I am getting this compler error in similar situations as described in
previous posts to this site, however in my case the solution that is
proposed is of no use.

In my case, the managed C++ class has a method that takes a COM Interface
pointer that is imported from a typelib and hence it is not possible at all
to forward-declare it, otherwise I will be getting a C2011 type redefinition
error.

I've tried several solutions but have had no luck whatsoever.

Regards,
Antonio


Nov 17 '05 #1
1 2746
Ok, in all fairness, I realize that what I wrote before is not all that
clear. Nothing like a good case study!!!

I have a managed class A that contains a COM interface pointer as a member,
which in this case I will just use the well known IDispatch. I then want to
access this member from another Managed object of class B which resides in a
different module (dll). So I add a member to A that will return the
IDispatch pointer and have B try to call that method on an instance if A.
Here is the code to help get a better picture:
////////////////////////////////////////////////////////////////
// A.h

#pragma once
#include <Oaidl.h>

namespace C3767
{
public ref class A
{
public:
A(void):
m_pDispatch(NULL)
{
}

IDispatch* getDispatch()
{
return m_pDispatch;
}

private:
IDispatch* m_pDispatch;
};
}
////////////////////////////////////////////////////////////////
// B.h

#pragma once
#include <Oaidl.h>

namespace C3767
{
public ref class B
{
public:
B(void) {}

void func()
{
A^ a = gcnew A();
a->getDispatch();
}
};
}

The call to getDispatch will issue the C3767 error that has been discussed
in two other topics. Unfortunately in this case the unmanaged class is an
interface and not an exported class from a dll.

Any ideas???
Antonio
Nov 17 '05 #2

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

Similar topics

1
by: JW | last post by:
I received this error while compiling OSE 6.0 with MSVC7.1 (it compiles with MSVC7.0). otcbitset.cc .../include\OTC\collctn\strgactn.hh(45) : error C3767: 'otclib_hash' matching function is not...
6
by: Bill Rubin | last post by:
The following code snippet shows that VC++ 7.1 correctly compiles a static member function invocation from an Unrelated class, since this static member function is public. I expected to compile the...
4
by: Adriano Coser | last post by:
I'm getting the following error: error C3767: PictureSource - candidate function(s) not accessible when accessing a public member function of a managed class, either from managed or unmanaged...
3
by: Steve Jaworski | last post by:
Using VS2005Beta 2 I have VC++/CLI class defined in a Class Library DLL as: #foo.h namespace foo { public ref class Convert { public: static Obj^ ToObj(UnmanagedObj* uObj);
14
by: Alf P. Steinbach | last post by:
Not yet perfect, but: http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01_examples.zip To access the table of...
2
by: ajtaylor | last post by:
Hello, Sorry another question on mixed code assemblys. I have a static class library containing a lot of unmanged code. I have created a mixed code assembly which I am attempting to use in a...
2
by: Iwanow | last post by:
Hello! I have a single class without any inheritance over there, and I get that error on its constructor which is an empty function: LabelProcessor::LabelProcessor() { } The full error...
57
by: Robert Seacord | last post by:
i am trying to print the address of a function without getting a compiler warning (i am compiling with gcc with alot of flags). if i try this: printf("%p", f); i get: warning: format %p...
4
by: ~~~ .NET Ed ~~~ | last post by:
I am facing a problem. My project is composed of several assemblies. In one of them -the backend- I have several internal classes that must implement an interface. These internal classes are only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.