473,698 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2753
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(NUL L)
{
}

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
1606
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 accessible could be the friend function at '../include\OTC\misc\hash.hh(54)' : 'otclib_hash' or the friend function at '../include\OTC\misc\hash.hh
6
4406
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 same invocation from a DistantlyRelated class. What actually happened was that the compiler produced: error C2247: 'A::function' not accessible because 'CloselyRelated' uses 'private' to inherit from 'A' I'm guessing that the above compiler...
4
4520
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 code. The class is an owner draw control implemented into a Control Library. The access is on a DLLs that support CLR with old syntax. The code compiled OK on Beta-1.
3
5473
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
2828
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 contents, use the "Bookmarks" tab in Adobe Acrobat. Comments, corrections, praise, nits, etc., are still welcome!
2
7877
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 forms project. Thus,
2
3473
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 message is as follows:
57
5646
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 expects type 'void *; but argument 2 has type 'void
4
2400
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 used by one master class that is public. I am able to declare the interface as "internal interface" without problem but when I attempt to use it by declaring a class that implements it, if I declare the implemented interface members as...
0
9028
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.