how to correct VBE missing type?

J

Jerry Nettleton

I'm getting the following error:

c:\projects\WordAddIn\CiteLinkAddin.h(7) : error C4772: #import referenced a
type from a missing type library; '__missing_type__' used as a placeholder
c:\projects\WordAddIn\Debug\vbe6ext.tli(248) : error C2440: 'return' :
cannot convert from '__missing_type__ *' to '__missing_type__'
This conversion requires a reinterpret_cast, a C-style cast or
function-style cast

Base on the following import statements:
#import "C:\Program Files\Common Files\Microsoft Shared\office11\mso.dll"
rename("RGB","_RGB") rename("DocumentProperties","_DocumentProperties")
named_guids
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" // named_guids
#import "progid:Word.Document" rename("ExitWindows", "_ExitWindows")
rename("FindText","_FindText") // named_guids

How can I fix this problem? The compiler generated this code (in
vbe6ext.tlh file):

VBE : Application
{
//
// Property data
//
__declspec(property(get=GetActiveVBProject,put=PutRefActiveVBProject))
_VBProjectPtr ActiveVBProject;
__declspec(property(get=GetSelectedVBComponent))
_VBComponentPtr SelectedVBComponent;
__declspec(property(get=GetVBProjects))
_VBProjectsPtr VBProjects;
__declspec(property(get=GetCommandBars))
__missing_type__ CommandBars;
...
}

inline __missing_type__ VBE::GetCommandBars ( ) {
__missing_type__ * _result;
HRESULT _hr = get_CommandBars(&_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _result;
}



Thanks,
Jerry N
 
W

Wei-Dong XU [MSFT]

Hi Jerry,

Currently we are finding one support professional for you on this issue. If
any result, we will reply you at the first time.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.
 
P

Peter Huang [MSFT]

Hi

Based on my test, the precompile code works at my side(VC7.1,VS.NET 2003)

Anyway, you may also try the approach below to import the three tlb(mso,vbe
and word)

////MSO
//#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" version("2.3")
lcid("0") auto_search auto_rename
////VBE
//#import "libid:0002E157-0000-0000-C000-000000000046" version("5.3")
lcid("0") auto_search auto_rename
////Word
//#import "libid:00020905-0000-0000-C000-000000000046" version("8.3")
lcid("0") auto_search auto_rename


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jerry Nettleton

I tried your approach with "libid" in the import statements. No change. I
have the same "missing type" problem. I also tried adding 'auto_search
auto_rename' to my original code but that didn't make any difference.

Jerry
 
P

Peter Huang [MSFT]

Hi

It is strange that works at my side but not yours.
So far I wants to confirm the environment setting with you, because it may
be caused by the different version.
Office 2003+VS.NET 2003+windows XP SP2

Also you may try on another machine, if that still did not work at your
side, can you send a simplest reproduce sample to me via removing "online"
from my email address.
You can just create a blank project and add the precompiler code as I
suggest before.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jerry Nettleton

I have the same environment and sent you my source code a few days ago. Let
me know if you need any additional info.

Thanks,
Jerry
 
P

Peter Huang [MSFT]

Hi

Thanks for your reminder, I have replied to your mail, please have check.
Thanks!


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top