none
SetupDiCallClassInstaller Failure in C# in Any CPU and X86? RRS feed

  • Question

  • Hi,

    I am using WIndows API SetupDiCallClassInstaller by sending DIF_PROPERTYCHANGE as a parameter n C# code for enable/Disable the Touch screen, but i see there is failure in the targets "Any CPU" and "X86". Do we have any equivalent or any work around where i can use the API in all the targets??

    I am using Windows 10-64bit OS as an environment.

    Please help!!

    Thank you!!


    Regards, Ravi Raj Nukala

    Friday, June 8, 2018 6:40 PM

All replies

  • Have you tried “Any CPU”, but unchecking the “Prefer 32-bit” option in Build tab of Project Properties?


    Friday, June 8, 2018 7:45 PM
  • IIRC there is some issue using SetupApi from a 32-bit app on 64-bit OS. The only clean solution in this case is a 64-bit helper program.

    -- pa

     
    Saturday, June 9, 2018 12:56 AM
  • Thank you Viorel for the reply

    Yes i have tried and i see this is not working. is there any other API that i can change the device state in all the platforms.

    Thank you!!


    Regards, Ravi Raj Nukala

    Saturday, June 9, 2018 4:48 AM
  • On a 32-bit Windows, calling SetupApi from 32-bit application should work, of course. 

    The problem is only in using SetupApi by 32-bit apps on 64-bit OS.

    -- pa

    Sunday, June 10, 2018 1:54 PM
  • Yes exactly..Does this problem have any solution??

    Or using Devcon with Commandline is the only solution??

    Please help if anyone have the solution for this?

    Thank you!!


    Regards, Ravi Raj Nukala


    Tuesday, June 12, 2018 5:34 AM
  • On x64 system, you can just let your app run in 64 bit mode (as Viorel wrote) - bingo, no problem.

    If you must run as 32 bit (for example because of native 32 bit DLLs) then you need 64-bit out of process helper (a 64-bit native or managed program).

    -- pa



    • Edited by Pavel A Wednesday, June 13, 2018 9:51 PM
    Wednesday, June 13, 2018 9:50 PM