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

error C2787: 'IQueryInfo' : no GUID has been associated with this object

Any thoughts on correcting this error?

Here is the source:

// PrjFileInfo.h : Declaration of the CPrjFileInfo

#pragma once
#include "resource.h" // main symbols

#include "AdvShellX.h"

#include <comdef.h>
#include <shlobj.h>

// CPrjFileInfo

class ATL_NO_VTABLE CPrjFileInfo :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CPrjFileInfo, &CLSID_PrjFileInfo>,
public IDispatchImpl<IPrjFileInfo, &IID_IPrjFileInfo, &LIBID_AdvShellXLib,
/*wMajor =*/ 1, /*wMinor =*/ 0>,
public IPersistFile,
public IQueryInfo
{
public:
CPrjFileInfo()
{
}

DECLARE_REGISTRY_RESOURCEID(IDR_PRJFILEINFO)
BEGIN_COM_MAP(CPrjFileInfo)
COM_INTERFACE_ENTRY(IPrjFileInfo)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()

HRESULT FinalConstruct()
{
return S_OK;
}

void FinalRelease()
{
}

public: // IPersistFile
STDMETHOD(GetClassID)(LPCLSID) { return E_NOTIMPL; }
STDMETHOD(IsDirty)() { return E_NOTIMPL; }
STDMETHOD(Load)(LPCOLESTR, DWORD);
STDMETHOD(Save)(LPCOLESTR, BOOL) { return E_NOTIMPL; }
STDMETHOD(SaveCompleted)(LPCOLESTR) { return E_NOTIMPL; }
STDMETHOD(GetCurFile)(LPOLESTR*) { return E_NOTIMPL; }

public: // IQueryInfo
STDMETHOD(GetInfoFlags)(DWORD*) { return E_NOTIMPL; }
STDMETHOD(GetInfoTip )(DWORD, WCHAR** );

private:
_bstr_t mFileName;
};

OBJECT_ENTRY_AUTO(__uuidof(PrjFileInfo), CPrjFileInfo)
Nov 16 '05 #1
4 8757
Jeff,

how did you define IQueryInfo in the IDL?
"Jeff F" <no*@anywhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Any thoughts on correcting this error?

Here is the source:

// PrjFileInfo.h : Declaration of the CPrjFileInfo

#pragma once
#include "resource.h" // main symbols

#include "AdvShellX.h"

#include <comdef.h>
#include <shlobj.h>

// CPrjFileInfo

class ATL_NO_VTABLE CPrjFileInfo :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CPrjFileInfo, &CLSID_PrjFileInfo>,
public IDispatchImpl<IPrjFileInfo, &IID_IPrjFileInfo, &LIBID_AdvShellXLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
public IPersistFile,
public IQueryInfo
{
public:
CPrjFileInfo()
{
}

DECLARE_REGISTRY_RESOURCEID(IDR_PRJFILEINFO)
BEGIN_COM_MAP(CPrjFileInfo)
COM_INTERFACE_ENTRY(IPrjFileInfo)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()

HRESULT FinalConstruct()
{
return S_OK;
}

void FinalRelease()
{
}

public: // IPersistFile
STDMETHOD(GetClassID)(LPCLSID) { return E_NOTIMPL; }
STDMETHOD(IsDirty)() { return E_NOTIMPL; }
STDMETHOD(Load)(LPCOLESTR, DWORD);
STDMETHOD(Save)(LPCOLESTR, BOOL) { return E_NOTIMPL; }
STDMETHOD(SaveCompleted)(LPCOLESTR) { return E_NOTIMPL; }
STDMETHOD(GetCurFile)(LPOLESTR*) { return E_NOTIMPL; }

public: // IQueryInfo
STDMETHOD(GetInfoFlags)(DWORD*) { return E_NOTIMPL; }
STDMETHOD(GetInfoTip )(DWORD, WCHAR** );

private:
_bstr_t mFileName;
};

OBJECT_ENTRY_AUTO(__uuidof(PrjFileInfo), CPrjFileInfo)

Nov 16 '05 #2
Whoops!

scratch that.

"Mike Frith" <mf****@esri.com> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
Jeff,

how did you define IQueryInfo in the IDL?
"Jeff F" <no*@anywhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Any thoughts on correcting this error?

Here is the source:

// PrjFileInfo.h : Declaration of the CPrjFileInfo

#pragma once
#include "resource.h" // main symbols

#include "AdvShellX.h"

#include <comdef.h>
#include <shlobj.h>

// CPrjFileInfo

class ATL_NO_VTABLE CPrjFileInfo :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CPrjFileInfo, &CLSID_PrjFileInfo>,
public IDispatchImpl<IPrjFileInfo, &IID_IPrjFileInfo,

&LIBID_AdvShellXLib,
/*wMajor =*/ 1, /*wMinor =*/ 0>,
public IPersistFile,
public IQueryInfo
{
public:
CPrjFileInfo()
{
}

DECLARE_REGISTRY_RESOURCEID(IDR_PRJFILEINFO)
BEGIN_COM_MAP(CPrjFileInfo)
COM_INTERFACE_ENTRY(IPrjFileInfo)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()

HRESULT FinalConstruct()
{
return S_OK;
}

void FinalRelease()
{
}

public: // IPersistFile
STDMETHOD(GetClassID)(LPCLSID) { return E_NOTIMPL; }
STDMETHOD(IsDirty)() { return E_NOTIMPL; }
STDMETHOD(Load)(LPCOLESTR, DWORD);
STDMETHOD(Save)(LPCOLESTR, BOOL) { return E_NOTIMPL; }
STDMETHOD(SaveCompleted)(LPCOLESTR) { return E_NOTIMPL; }
STDMETHOD(GetCurFile)(LPOLESTR*) { return E_NOTIMPL; }

public: // IQueryInfo
STDMETHOD(GetInfoFlags)(DWORD*) { return E_NOTIMPL; }
STDMETHOD(GetInfoTip )(DWORD, WCHAR** );

private:
_bstr_t mFileName;
};

OBJECT_ENTRY_AUTO(__uuidof(PrjFileInfo), CPrjFileInfo)


Nov 16 '05 #3
Hi Jeff,
#include <shlobj.h>

// CPrjFileInfo

class ATL_NO_VTABLE CPrjFileInfo :
[...]
public IQueryInfo

BEGIN_COM_MAP(CPrjFileInfo)
COM_INTERFACE_ENTRY(IPrjFileInfo)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()


IQueryInfo is not declared with __declspec(uuid(...)), so the interface
definition doesn't have an associated IID. This means you need to do this:

#include <shlguid.h> // This carries IID_IQueryInfo

And in the COM map:
COM_INTERFACE_ENTRY_IID(IID_IQueryInfo, IQueryInfo)

Also, if you look into shlguid.h, IID_IQueryInfo is guarded in _WIN32_IE >=
0x0400:

#if (_WIN32_IE >= 0x0400)
DEFINE_SHLGUID(IID_IQueryInfo, 0x00021500L, 0, 0);
#endif

so you need to #define this symbol in your stdafx.h or something, to agree
to depend on IE4 and upwards.

Hope that helps,
Kim
Nov 16 '05 #4
Kim,

Thanks, I'm up and running! _WIN32_IE was defined in my stdafx.h by default
with VC71.

I would never have figured out to use COM_INTERFACE_ENTRY_IID. I've been
using an example and instructions from CodeProject which are obviously
wrong.

Thanks again, Jeff
"Kim Gräsman" <ki*@mvps.org> wrote in message
news:On**************@TK2MSFTNGP09.phx.gbl...
Hi Jeff,
#include <shlobj.h>

// CPrjFileInfo

class ATL_NO_VTABLE CPrjFileInfo :
[...]
public IQueryInfo

BEGIN_COM_MAP(CPrjFileInfo)
COM_INTERFACE_ENTRY(IPrjFileInfo)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()


IQueryInfo is not declared with __declspec(uuid(...)), so the interface
definition doesn't have an associated IID. This means you need to do this:

#include <shlguid.h> // This carries IID_IQueryInfo

And in the COM map:
COM_INTERFACE_ENTRY_IID(IID_IQueryInfo, IQueryInfo)

Also, if you look into shlguid.h, IID_IQueryInfo is guarded in _WIN32_IE
=
0x0400:

#if (_WIN32_IE >= 0x0400)
DEFINE_SHLGUID(IID_IQueryInfo, 0x00021500L, 0, 0);
#endif

so you need to #define this symbol in your stdafx.h or something, to agree
to depend on IE4 and upwards.

Hope that helps,
Kim

Nov 16 '05 #5

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

Similar topics

6
by: Bernd Koehler | last post by:
Hi: I am a EE prof currently teaching an IT course. One the assignments students recently completed was designing a small MS Access Database. I have two submissions that are remarkably...
2
by: Alan Bahm | last post by:
Hi all, I'm trying to write an InfoTip extension for my filetype in explorer (running on WinXP & W2K). The interface IQueryInfo supports this feature (with some help from IPersistFile), through...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
4
by: Steve Richter | last post by:
this code compiles ok: public string AssureAnonUID( ) { if (Session == null) Session = Guid.NewGuid(); return Session.ToString(); } but this code does not: public string AssureAnonUID( )
4
by: charleswesley | last post by:
I think the problem is with the strPrice variable in the AddToCart() sub. I've been messing with it all morning and can't seem to figure it out. Any ideas? ...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
2
by: Lucas Tam | last post by:
Hi all, I'm using the command GetType(MyObject).GUID to return a GUID. Is the GUID a CRC type calculation on the object, or is it a pre-assigned value on the object? I was hoping to have a...
2
by: danielle.m.manning | last post by:
I have a question about a problem I am having with attempting to port some old ASP code to ASP.NET. We have a dll out there which we downloaded which creates GUIDs for session management. In...
1
by: rose.kevin | last post by:
Hi I am trying to make a little tool tip box pop up when you hover the mouse over one of our custom filetypes in Windows explorer. And it is slowly driving me insane. I have a created a dll,...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.