Hi,
 
I tried to retrieve some information about installed Product, as bellow:
 
TCHAR szProductName[100] = {0};

DWORD length(0);

MsiGetProductInfoW(szProductCode,L"InstalledProductName",szProductName,&
length);

However, it always return ERROR_MORE_DATA. It sounds like that TCHAR
szProductName[100]  is not enough. Actually, length is only 42 in my
case. I would like to use 

CStrBufW(szProductName, length, CStrBufW::SET_LENGTH)

instead of TCHAR. However, #include <atlstr.h> causes many errors, like:

1>D:\Program Files\Microsoft Visual Studio
8\VC\atlmfc\include\atlchecked.h(93) : error C2664: 'errno_t
strcpy_s(char *,rsize_t,const char *)' : cannot convert parameter 1 from
'TCHAR *' to 'char *'

1> Types pointed to are unrelated; conversion requires reinterpret_cast,
C-style cast or function-style cast

 

Is there anyway to use MsiGetProductInfo function?

 

Regards,

Chunyan

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to