Getting CPU ID code from C# to be in C++

前端 未结 2 621
说谎
说谎 2021-01-19 14:28

I have this C# code to get Processor ID but I\'m not able to pass it to C++, I tried a lot but I really can\'t, I just started in C++ and I would like to be able to get the

2条回答
  •  死守一世寂寞
    2021-01-19 14:39

    1. If it is just the problem of sending the obtained ProcessorID of type string (managed code) to unmanaged code (c++), then you can try variety of option like using a COM interface or through some intermediate CLR CLI interface or using normal native dll writing marshalling code on your own.

    2. Another way is to create a C# COM interface and accessing it from C++ to get the sProcessorID by calling your function GetProcessorID()

提交回复
热议问题