473,398 Members | 2,188 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,398 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 8774
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.