Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to close a user created message box without effecting the parent window Pin
msr_codeproject27-Jun-07 2:05
msr_codeproject27-Jun-07 2:05 
QuestionHow to forward delare CArray class ? Pin
VCSharp00726-Jun-07 20:21
VCSharp00726-Jun-07 20:21 
AnswerRe: How to forward delare CArray class ? Pin
CPallini26-Jun-07 20:50
mveCPallini26-Jun-07 20:50 
AnswerRe: How to forward delare CArray class ? Pin
Nibu babu thomas26-Jun-07 21:00
Nibu babu thomas26-Jun-07 21:00 
GeneralRe: How to forward delare CArray class ? Pin
VCSharp00726-Jun-07 22:31
VCSharp00726-Jun-07 22:31 
GeneralRe: How to forward delare CArray class ? Pin
Nibu babu thomas26-Jun-07 22:39
Nibu babu thomas26-Jun-07 22:39 
AnswerRe: How to forward delare CArray class ? Pin
KarstenK26-Jun-07 21:28
mveKarstenK26-Jun-07 21:28 
QuestionEnumerating Installed Apps with MSI Pin
Akin Ocal26-Jun-07 20:13
Akin Ocal26-Jun-07 20:13 
I am trying to do it with MSI , but i do something wrong in the code below , publisher names dont always match with product names , can you browse it ?

Function just fills struct :

#define VERSION_LEN 16
#define CODE_LEN 39
#define NAME_LEN 256
#define PUBLISHER_LEN 256
#define PATH_LEN 256
#define MSI_LEN 256

typedef struct _INSTALLED_SOFTWARE_INFORMATION
{
BOOL bManaged ;
BOOL bPerMachine ;
char wszProductCode[CODE_LEN] ;
char wszProductName[NAME_LEN] ;
char lpVersion[VERSION_LEN] ;
char lpPublisher[PUBLISHER_LEN];
char lpPath[PATH_LEN];
char lpMSI[MSI_LEN];
ERROR_DATA errData ;
}INSTALLED_SOFTWARE_INFORMATION ;


int GetInstalledProducts(INSTALLED_SOFTWARE_INFORMATION* pSwInformation,unsigned int* nCount)
{

DWORD dwIndex = 0;
UINT uiStatus ;

char assignment_type[10] = {0} ;
char lpVersion[VERSION_LEN] = {0} ;
char lpProducts[NAME_LEN] = {0} ;
char lpPublisher[PUBLISHER_LEN] = {0};
char lpPath[PATH_LEN]= {0};
char lpMSI[MSI_LEN]= {0};

DWORD cchAssignmentType ;
DWORD cchVersionName ;
DWORD cchPublisher;
DWORD cchProductName;
DWORD cchPath ;
DWORD cchMsi;


for(;;)
{



uiStatus = MsiEnumProducts(dwIndex,pSwInformation[dwIndex].wszProductCode);


uiStatus = MsiIsProductElevated( pSwInformation[dwIndex].wszProductCode,&( pSwInformation[dwIndex].bManaged ));

uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_ASSIGNMENTTYPE,assignment_type,&cchAssignmentType) ;

if(uiStatus !=ERROR_SUCCESS )
{

switch(uiStatus)
{

// return FALSE ;

}

}
else
{
if(assignment_type[0] == '1' )
pSwInformation[dwIndex].bPerMachine = TRUE ;
else
pSwInformation[dwIndex].bPerMachine = FALSE ;

}



uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_PRODUCTNAME,lpProducts,&cchProductName);
strcpy(pSwInformation[dwIndex].wszProductName,lpProducts);


uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_VERSIONSTRING,lpVersion,&cchVersionName);
strcpy(pSwInformation[dwIndex].lpVersion ,lpVersion);



uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_PUBLISHER,lpPublisher,&cchPublisher);
strcpy(pSwInformation[dwIndex].lpPublisher ,lpPublisher);





uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_INSTALLSOURCE ,lpPath,&cchPath);
strcpy(pSwInformation[dwIndex].lpPath ,lpPath);


uiStatus = MsiGetProductInfo(pSwInformation[dwIndex].wszProductCode,INSTALLPROPERTY_PACKAGENAME ,lpMSI,&cchMsi);
strcpy(pSwInformation[dwIndex].lpMSI ,lpMSI);


dwIndex++;
*nCount = dwIndex ;
}

EXIT :

return dwIndex ;

}
QuestionBSTR in C++ Pin
Axonn Echysttas26-Jun-07 19:45
Axonn Echysttas26-Jun-07 19:45 
AnswerRe: BSTR in C++ Pin
Nibu babu thomas26-Jun-07 20:10
Nibu babu thomas26-Jun-07 20:10 
GeneralRe: BSTR in C++ Pin
Axonn Echysttas26-Jun-07 20:52
Axonn Echysttas26-Jun-07 20:52 
GeneralRe: BSTR in C++ Pin
Nibu babu thomas26-Jun-07 21:06
Nibu babu thomas26-Jun-07 21:06 
AnswerRe: BSTR in C++ Pin
Arman S.26-Jun-07 20:16
Arman S.26-Jun-07 20:16 
GeneralRe: BSTR in C++ Pin
Axonn Echysttas26-Jun-07 20:48
Axonn Echysttas26-Jun-07 20:48 
GeneralRe: BSTR in C++ Pin
CPallini26-Jun-07 21:06
mveCPallini26-Jun-07 21:06 
GeneralRe: BSTR in C++ Pin
CPallini26-Jun-07 21:03
mveCPallini26-Jun-07 21:03 
GeneralRe: BSTR in C++ Pin
Randor 27-Jun-07 8:38
professional Randor 27-Jun-07 8:38 
AnswerRe: BSTR in C++ Pin
Randor 27-Jun-07 8:48
professional Randor 27-Jun-07 8:48 
GeneralRe: BSTR in C++ Pin
Axonn Echysttas27-Jun-07 9:24
Axonn Echysttas27-Jun-07 9:24 
GeneralRe: BSTR in C++ Pin
Randor 27-Jun-07 17:03
professional Randor 27-Jun-07 17:03 
GeneralRe: BSTR in C++ Pin
Axonn Echysttas27-Jun-07 21:47
Axonn Echysttas27-Jun-07 21:47 
QuestionCPropertySheet::DoModal and focus problem Pin
rp_suman26-Jun-07 19:42
rp_suman26-Jun-07 19:42 
QuestionRe: CPropertySheet::DoModal and focus problem Pin
prasad_som27-Jun-07 0:53
prasad_som27-Jun-07 0:53 
AnswerRe: CPropertySheet::DoModal and focus problem Pin
rp_suman1-Jul-07 18:10
rp_suman1-Jul-07 18:10 
QuestionDocking Dialog Bar Pin
g_sandipan26-Jun-07 19:17
g_sandipan26-Jun-07 19:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.