How do you initialise a const array of TGUID from Interface type data, in Delphi?

后端 未结 7 758
谎友^
谎友^ 2020-12-18 00:43

I want to initialise an array like this -

Const MyArray : Array[0..0] Of TGUID = (IInterface);

But it results in -

[DCC Err         


        
7条回答
  •  借酒劲吻你
    2020-12-18 01:34

    I just tried in C++Builder:

    const TGUID g = __uuidof(IInterface);
    const TGUID MyArray[] = {__uuidof(IInterface)};
    

    I suspected that the explicit keyword __uuidof might avoid the problem you have, but it merely replaces it with something very similar.While the first line works fine, the second one yields:

    [C++ Fehler] Unit1.cpp(9): E2034 Konvertierung von 'const _GUID' nach 'unsigned long' nicht möglich
    

    (in English: [C++ error] Unit1.cpp(9): E2034 Conversion from 'const _GUID' to 'unsigned long' not possible)

提交回复
热议问题