ajitatif.com
ajitatif.com - gökalp gürbüzer'in kişisel web sitesi
Monday, October 15, 2007
CoCreateInstance Returns 0x80020008 "Bad Variable Type"
I built the Toolbar last friday and it worked just fine but today the CoCreateInstance for my COM object (which is a User Broker process to make the toolbar work on Windows Vista - see [1] for the reason) returned 0x80020008 (Bad Variable Type). The build had no errors but when the toolbar called the CoCreateInstance() method it returned "Bad Variable Type". This took my whole day to figure out (maybe I'm just low on documents or XP) but I solved the problem.
Here is the code that generated the error:
ATL::CComPtr
pub;
hr = pub.CoCreateInstance(CLSID_UserBrokerProcess,NULL,CLSCTX_LOCAL_SERVER); // hr = 0x80020008 "Bad Variable Type"
Everything is fine with the code, but just see this method declaration in the IDL file for my IUserBrokerProcess:
[id(1234), method SetBinaryValue"), local] HRESULT SetBinaryValue([in] BSTR bstrKeyName, [in] BSTR bstrKeyValueName, [in] const void * pValue, [in] ULONG nBytes);
Anything amiss?? It seems the Interface Definition Language does not support
void
as a valid type. I had to comment all my methods in the .idl file, implementing .h file and its .cpp file and uncomment the methods one by one to debug this situation. I just changes the
void
to
BYTE
and everyting is fine now. Well not everything maybe, but it doesn't cry for 0x80020008 anymore.
[1]
MSDN Technical Articles: Understanding and Working in Protected Mode Internet Explorer
Monday, October 15, 2007 10:53:28 AM (GTB Daylight Time, UTC+03:00) |
Comments [1]
|
English
|
Software Development
|
ATL
|
C++
Sunday, December 06, 2009 4:48:03 PM (GTB Standard Time, UTC+02:00)
This article is truly a good read for me! Informative and very interesting!
Sara
novelty aprons
Sara Colins
OpenID
Please login with either your
OpenID
above, or your details below.
Name
E-mail
(will show your
gravatar
icon)
Home page
Remember Me
Comment (Some html is allowed:
a@href@title, blockquote@cite
) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.
Live Comment Preview
Subscribe:
Copyright 2010 Gökalp Gürbüzer
newtelligence dasBlog 2.2.8279.16125
Search
Archive
April, 2010 (1)
March, 2010 (1)
January, 2010 (2)
November, 2009 (1)
May, 2009 (6)
April, 2009 (5)
March, 2009 (1)
February, 2009 (1)
January, 2009 (1)
December, 2008 (8)
January, 2008 (2)
December, 2007 (3)
November, 2007 (3)
October, 2007 (8)
Links
Ana Sayfa (Home)
Jargon
Java Teknolojileri Programcıları Derneği
followeb
dasBlog
Sourceforge
CodePlex
Categories
All Categories
AdSense
ajitatif.com
Askerlik
ASP.NET
ATL
Banu Avar
Blograzzi
C++
Çanakkale Savaşları
D880
dasBlog
English
Etkinlik
google
Güncel
hakia.com
Internet Explorer
İstanbulluluk
Jargon
Java
JQuery
JSP
JTPD
JTS
Kişisel
Kitap
Kronik Acemilik
Linux
Makale
Memleket Kurtarmaca
MySql
NetBeans
Oktay Sinanoğlu
Pardus
ProjeCep
Samsung
ScoopBar
Software Development
Tarih
Tavsiye
Tiyatro
Tiyatro Sporu
Türkçe
Ürün İnceleme
Veritabanı
Vosvos
VS 2005
Web
Web Development
Web Geliştirme
Wikipedia
Windows
XUL
Yazılım
Yazılım Geliştirme
Admin Login
Sign In
Blogroll
aychulus.blogspot.com
Kuzen Ayşegül'ün blog'u
volkanvardar.com
Volkan Vardar kişisel blog ve portföy sitesi
Themes
Pick a theme:
BlogXP
business
calmBlue
Candid Blue
dasBlog
dasblogger
dasblueblog
dasEmerald
DirectionalRedux
Discreet Blog Blue
Elegante
essence
Just Html
MadsSimple
Mobile
Mono
Movable Radio Blue
Movable Radio Heat
nautica022
orangeCream
Portal
Project84
Project84Grass
Slate
Sound Waves
Tricoleur
useit.com
Voidclass2