Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Retrieving File type Pin
Gary R. Wheeler6-Sep-05 13:10
Gary R. Wheeler6-Sep-05 13:10 
QuestionHow to import VB interface in VC++ programming?How to link the interface with VC++ codes Pin
ladyscarlet994-Sep-05 20:04
ladyscarlet994-Sep-05 20:04 
AnswerRe: How to import VB interface in VC++ programming?How to link the interface with VC++ codes Pin
MailtoGops5-Sep-05 4:19
MailtoGops5-Sep-05 4:19 
GeneralRe: How to import VB interface in VC++ programming?How to link the interface with VC++ codes Pin
Christian Graus5-Sep-05 16:08
protectorChristian Graus5-Sep-05 16:08 
QuestionProgress Dialog Pin
LighthouseJ4-Sep-05 17:08
LighthouseJ4-Sep-05 17:08 
QuestionRemoving Drivers from a system Pin
Peter Prescher4-Sep-05 16:58
Peter Prescher4-Sep-05 16:58 
AnswerRe: Removing Drivers from a system Pin
Gary R. Wheeler5-Sep-05 5:55
Gary R. Wheeler5-Sep-05 5:55 
GeneralRe: Removing Drivers from a system Pin
Peter Prescher5-Sep-05 9:04
Peter Prescher5-Sep-05 9:04 
I have. But it does not work.
What do I make wrong?
example code:
<br />
#include "stdafx.h"<br />
#include <stdio.h><br />
#include <windows.h><br />
#include <setupapi.h><br />
#include "cfgmgr32.h"<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
<br />
    PSP_DEVICE_INTERFACE_DETAIL_DATA pspdidd;<br />
    SP_DEVICE_INTERFACE_DATA         spdid;<br />
    SP_DEVINFO_DATA                  spdd;<br />
    HDEVINFO                         hDevInfo;<br />
    DWORD                            dwIndex, dwSize, dwType;<br />
    TCHAR                            szProperty[256];<br />
	GUID ClassGUID;<br />
	TCHAR ClassName[MAX_CLASS_NAME_LEN];<br />
	LPTSTR INFFile = argv[1];<br />
	CString strInfClassID;<br />
	BOOL isInstall = FALSE;<br />
	<br />
    ZeroMemory(&spdid, sizeof(spdid));<br />
    spdid.cbSize = sizeof(spdid);<br />
<br />
	//*****************************************************************************<br />
	// Use the INF File to extract the Class GUID.<br />
	if(!SetupDiGetINFClass(INFFile,&ClassGUID,ClassName,sizeof(ClassName),0))<br />
	{<br />
		printf("GetINFClass");<br />
		goto cleanup_DeviceInfo;<br />
	}<br />
<br />
	//*****************************************************************************<br />
	// GUID aus Inffile einlesen<br />
	LPOLESTR InfBuffer;<br />
<br />
	StringFromCLSID( ClassGUID, &InfBuffer );<br />
	strInfClassID = InfBuffer;<br />
	CoTaskMemFree(InfBuffer);<br />
<br />
<br />
	//*****************************************************************************<br />
    hDevInfo = SetupDiGetClassDevs(&ClassGUID, NULL, NULL, NULL);<br />
<br />
	if(hDevInfo == INVALID_HANDLE_VALUE)<br />
	{<br />
		printf("SetupDiGetClassDevs nicht gefunden.\n ");<br />
		goto cleanup_DeviceInfo;<br />
<br />
	}<br />
<br />
	//*****************************************************************************<br />
	spdd.cbSize = sizeof(spdd);<br />
<br />
    for(dwIndex = 0; (SetupDiEnumDeviceInfo(hDevInfo,dwIndex,&spdd)); dwIndex++)<br />
    {<br />
<br />
       SP_DEVINFO_LIST_DETAIL_DATA devInfoListDetail;<br />
       devInfoListDetail.cbSize = sizeof(devInfoListDetail);<br />
	   <br />
	   if(!SetupDiGetDeviceInfoListDetail(hDevInfo,&devInfoListDetail))<br />
	   {<br />
			isInstall = FALSE;<br />
			goto cleanup_DeviceInfo;<br />
<br />
	   }<br />
<br />
		LPOLESTR Buffer;<br />
		CString strClassID;<br />
		StringFromCLSID( spdd.ClassGuid, &Buffer );<br />
		strClassID = Buffer;<br />
		CoTaskMemFree(Buffer);<br />
<br />
		if (strInfClassID == strClassID)<br />
		{<br />
			printf("Test GUID ok.\n");<br />
		<br />
	        SP_REMOVEDEVICE_PARAMS rmdParams;<br />
        <br />
		    rmdParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);<br />
            rmdParams.ClassInstallHeader.InstallFunction = DIF_REMOVE;<br />
            rmdParams.Scope = DI_REMOVEDEVICE_GLOBAL;<br />
            rmdParams.HwProfile = 0;<br />
<br />
		    if(!SetupDiSetClassInstallParams(hDevInfo,NULL,&rmdParams.ClassInstallHeader,sizeof(rmdParams)) ||<br />
										!SetupDiCallClassInstaller(DIF_REMOVE,hDevInfo,NULL)) <br />
			{<br />
			   printf("Driver not remove.");<br />
			}<br />
		    else<br />
			{<br />
			   printf("Driver remove.");<br />
<br />
			}<br />
		<br />
		}<br />
		else<br />
		{<br />
			printf("Test GUID not ok.\n");<br />
		}<br />
<br />
<br />
 }<br />
<br />
cleanup_DeviceInfo:<br />
<br />
    SetupDiDestroyDeviceInfoList(hDevInfo);<br />
	<br />
	return 0;<br />
}<br />
<br />

QuestionWhere to delete item data with CListCtrl Pin
followait4-Sep-05 16:24
followait4-Sep-05 16:24 
AnswerRe: Where to delete item data with CListCtrl Pin
Jose Lamas Rios4-Sep-05 19:12
Jose Lamas Rios4-Sep-05 19:12 
GeneralThank you. It works. Pin
followait4-Sep-05 19:54
followait4-Sep-05 19:54 
AnswerRe: Where to delete item data with CListCtrl Pin
Kelly Herald4-Sep-05 20:06
Kelly Herald4-Sep-05 20:06 
GeneralRe: Where to delete item data with CListCtrl Pin
Jose Lamas Rios4-Sep-05 20:26
Jose Lamas Rios4-Sep-05 20:26 
GeneralIt doesn't help to delete item data. Pin
followait4-Sep-05 20:43
followait4-Sep-05 20:43 
GeneralRe: It doesn't help to delete item data. Pin
Kelly Herald6-Sep-05 4:07
Kelly Herald6-Sep-05 4:07 
QuestionConnection to SQL? Pin
Member 21004814-Sep-05 16:22
Member 21004814-Sep-05 16:22 
AnswerRe: Connection to SQL? Pin
Steve S5-Sep-05 0:11
Steve S5-Sep-05 0:11 
QuestionPrinting Pin
Ivan Cachicatari4-Sep-05 16:00
Ivan Cachicatari4-Sep-05 16:00 
QuestionHow to determine if a window has scroll bar? Pin
followait4-Sep-05 15:25
followait4-Sep-05 15:25 
AnswerRe: How to determine if a window has scroll bar? Pin
Jose Lamas Rios4-Sep-05 19:22
Jose Lamas Rios4-Sep-05 19:22 
GeneralCListCtrl, any way? Pin
followait4-Sep-05 19:55
followait4-Sep-05 19:55 
GeneralRe: CListCtrl, any way? Pin
Jose Lamas Rios4-Sep-05 20:04
Jose Lamas Rios4-Sep-05 20:04 
GeneralIt's ok. Thank you very much. Pin
followait4-Sep-05 20:29
followait4-Sep-05 20:29 
QuestionHow to play *.rm ? Pin
alias00184-Sep-05 15:20
alias00184-Sep-05 15:20 
AnswerRe: How to play *.rm ? Pin
Christian Graus4-Sep-05 15:35
protectorChristian Graus4-Sep-05 15:35 

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.