ADO _ConnectionPtr in a DLL

From: Arnie Mauer (xxx_at_nowhere.net)
Date: 09/28/04


Date: Tue, 28 Sep 2004 10:56:02 -0400

I have an _ConnectionPtr as a private member in a class in a DLL.
When a cpp in an exe includes the class H file, I get the warning
below. It is similar to a warning I was getting with a std::string in
the class include file but eliminated it by using the /MD[d] library
option. Please see a code fragment from the include file and the
warning below.

Does anyone have any idea how to resolve the warning?

Thanks,
- Arnie

#import "C:\Program Files\Common Files\System\ADO\msado27.tlb" \
    no_namespace rename("EOF", "EndOfFile")

#include <ole2.h>
#include <string>

class __declspec( dllexport ) MyDb
{
private:
   std::string m_DbName;
   _ConnectionPtr m_db;
protected:
public:
                 MyDb( void * ) {}
};

The warning:
<filename goes here> : warning C4251: 'MyDb::m_db' : class
'_com_ptr_t<_IIID>' needs to have dll-interface to be used by clients
of class 'MyDb'

with

[

_IIID=_com_IIID<_Connection,&
_GUID_00000550_0000_0010_8000_00aa006d2ea4>

]



Relevant Pages

  • Re: Downloading mail through VB.NET?
    ... I've created the necessary class and have placed the For loop code into a ... Use the "new" keyword to create an object instance. ... If I click the EXE from Windows Explorer, ... Warning 1 Function 'List' doesn't return a value on all code paths. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Warning when opening shortcuts on desktop
    ... > shortcut that points to a .exe on the server. ... The warning says: ... > This started after the client was cleaning their keyboard, ...
    (microsoft.public.windowsxp.general)
  • Re: Linked .cs files and defined in multiple places warning
    ... CTF Technologies do Brasil LTDA ... Analista Programador ... >I have a utilities class which I include in a library and the exe. ... > also includes the library therefore generating the warning about the same ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: "The Publisher could not be verified. etc."
    ... So we switched to self extracting ... > exe. ... but the ZIP itself will cause a warning because IE "sniffs" ... is to include a small explanation on my download page. ...
    (microsoft.public.vb.general.discussion)
  • Re: Phone very slow after ActiveSync
    ... Tried to run the exe but after warning me that the file is from an unknown source which I accepted the system tells me that the file ... Whether you can install any non-Danish, generic Qtek ROM without unlocking the CID - it's another question. ...
    (microsoft.public.pocketpc)