1

I have tested the code from here and in the follow part

begin 
  Paths := TStringList.Create(); 
  try 
    ParseInfFile(LocateInfFile(DeviceHelper.InfName), DeviceHelper.InfSection)
  ...
...

when compile ...

Undeclared identifier InfName and InfSection

How I can fix that? Have somebody other properly variant?

Community
  • 1
  • 1

1 Answers1

2

DeviceHelper appears to be a class or record that isn't included in the linked code, but it's also not used anywhere else except in the line you posted (which, for ease of others I'll mention is at the very bottom of that code). So you can just declare them as local variables instead, assign the values you want for InfName and InfSection, and proceed without DeviceHelper:

var
  InfName, InfSection: string;
begin
  InfName := 'WhatEver.Inf';
  InfSection := 'WhatEverSection`;
  Paths := TStringList.Create(); 
  try 
    ParseInfFile(LocateInfFile(InfName), InfSection);
  ...

  // You'll need to remove these lines, too. They add the returned items
  // to a TListView using functionality that's available in Vista and above
  ListView_InsertGroup(lvAdvancedInfo.Handle, 'Driver Files', 2);
  for I := 0 to Paths.Count - 1 do
     ListView_AddItemsInGroup(lvAdvancedInfo, '', Paths[I], 2);
Ken White
  • 123,280
  • 14
  • 225
  • 444
  • Thanks for reply. Yes, I understand that these variables (InfName, InfSection) are not contained in DeviceHelper, there exists any way to get automatically the name of the inf and the section that stores the path of the driver files? because by this way I must do it all manually, driver by driver. – user1591987 Aug 13 '12 at 04:27