Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antonio Carvalho - 13 Jul 2005 17:27 GMT
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
Antonio Carvalho - 14 Jul 2005 11:52 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.