Compilation error when importing .net type libraryXmlSerializer - There was an error reflecting typeWhen to use dynamic vs. static librariesTrouble using .NET DLL in Borland C++ Builder 4Using a .NET COM DLL in C++ Builder 4 - Ambiguity between Strings and System::StringsHow do I fix the Visual Studio compile error, “mismatch between processor architecture”?Accessing COM-dll via imported type library failsHow to programmatically register (set correct path to) a type library from within .NET?C# : Unmanaged delegate in structs, and other unmanaged problems by wrapping the vulkan API dllProblems importing Microsoft.Sharepoint.Client.Dll into DelphiWhat is the difference between .NET Core and .NET Standard Class Library project types?

How would you translate "more" for use as an interface button?

Has any country ever had 2 former presidents in jail simultaneously?

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

Doesn't the system of the Supreme Court oppose justice?

Can you use Vicious Mockery to win an argument or gain favours?

PTIJ: Why is Haman obsessed with Bose?

Mimic lecturing on blackboard, facing audience

Can I cause damage to electrical appliances by unplugging them when they are turned on?

What (the heck) is a Super Worm Equinox Moon?

US tourist/student visa

Why do ¬, ∀ and ∃ have the same precedence?

How can I write humor as character trait?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

What is the English pronunciation of "pain au chocolat"?

Permission on Database

How much theory knowledge is actually used while playing?

What does Apple's new App Store requirement mean

Non-trope happy ending?

What kind of floor tile is this?

Make a Bowl of Alphabet Soup

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

Circuit Analysis: Obtaining Close Loop OP - AMP Transfer function

Does grappling negate Mirror Image?

Does Doodling or Improvising on the Piano Have Any Benefits?



Compilation error when importing .net type library


XmlSerializer - There was an error reflecting typeWhen to use dynamic vs. static librariesTrouble using .NET DLL in Borland C++ Builder 4Using a .NET COM DLL in C++ Builder 4 - Ambiguity between Strings and System::StringsHow do I fix the Visual Studio compile error, “mismatch between processor architecture”?Accessing COM-dll via imported type library failsHow to programmatically register (set correct path to) a type library from within .NET?C# : Unmanaged delegate in structs, and other unmanaged problems by wrapping the vulkan API dllProblems importing Microsoft.Sharepoint.Client.Dll into DelphiWhat is the difference between .NET Core and .NET Standard Class Library project types?













0















I'm trying to use a third party .net dll in C++Builder (10.3).



I create a .tlb file for the dll with regasm.exe. Then I go to 'Import a Type Library' and choose the .tlb that has been registered, and then choose to install into a new package.



When building the package, I get errors in the generated file mscorlib_TLB.h (I have no experince of .net, but I understand mscorlib is a base class needed in .net).



Here are some of the error messages and the source lines:



[bcc32c Error] mscorlib_TLB.h(2321): declaration of anonymous struct must be a definition:



 interface DECLSPEC_UUID("84E7AC09-795A-3EA9-A36A-5B81EBAB0558") _Nullable;


[bcc32c Error] mscorlib_TLB.h(2322): expected a type:



typedef TComInterface<_Nullable, &IID__Nullable> _NullablePtr;


[bcc32c Error] mscorlib_TLB.h(4426): C++ requires a type specifier for all declarations:



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(4426): nullability specifier '_Nullable' cannot be applied to non-pointer type 'int':



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(12060): declaration of anonymous struct must be a definition:



interface _Nullable : public IDispatch


[bcc32c Error] mscorlib_TLB.h(22823): expected ')'
mscorlib_TLB.h(22822): to match this '(':



 virtual HRESULT STDMETHODCALLTYPE MarshaledObject(VARIANT obj/*[in]*/, 
Mscorlib_tlb::_ObjRef* or/*[in]*/) = 0; // [-1]


I've also tried to import the .net dll with 'Import .NET Assembly', but that gives me 'OLE Error'.



Any idea what I'm missing?










share|improve this question






















  • Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

    – Hans Passant
    10 hours ago















0















I'm trying to use a third party .net dll in C++Builder (10.3).



I create a .tlb file for the dll with regasm.exe. Then I go to 'Import a Type Library' and choose the .tlb that has been registered, and then choose to install into a new package.



When building the package, I get errors in the generated file mscorlib_TLB.h (I have no experince of .net, but I understand mscorlib is a base class needed in .net).



Here are some of the error messages and the source lines:



[bcc32c Error] mscorlib_TLB.h(2321): declaration of anonymous struct must be a definition:



 interface DECLSPEC_UUID("84E7AC09-795A-3EA9-A36A-5B81EBAB0558") _Nullable;


[bcc32c Error] mscorlib_TLB.h(2322): expected a type:



typedef TComInterface<_Nullable, &IID__Nullable> _NullablePtr;


[bcc32c Error] mscorlib_TLB.h(4426): C++ requires a type specifier for all declarations:



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(4426): nullability specifier '_Nullable' cannot be applied to non-pointer type 'int':



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(12060): declaration of anonymous struct must be a definition:



interface _Nullable : public IDispatch


[bcc32c Error] mscorlib_TLB.h(22823): expected ')'
mscorlib_TLB.h(22822): to match this '(':



 virtual HRESULT STDMETHODCALLTYPE MarshaledObject(VARIANT obj/*[in]*/, 
Mscorlib_tlb::_ObjRef* or/*[in]*/) = 0; // [-1]


I've also tried to import the .net dll with 'Import .NET Assembly', but that gives me 'OLE Error'.



Any idea what I'm missing?










share|improve this question






















  • Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

    – Hans Passant
    10 hours ago













0












0








0








I'm trying to use a third party .net dll in C++Builder (10.3).



I create a .tlb file for the dll with regasm.exe. Then I go to 'Import a Type Library' and choose the .tlb that has been registered, and then choose to install into a new package.



When building the package, I get errors in the generated file mscorlib_TLB.h (I have no experince of .net, but I understand mscorlib is a base class needed in .net).



Here are some of the error messages and the source lines:



[bcc32c Error] mscorlib_TLB.h(2321): declaration of anonymous struct must be a definition:



 interface DECLSPEC_UUID("84E7AC09-795A-3EA9-A36A-5B81EBAB0558") _Nullable;


[bcc32c Error] mscorlib_TLB.h(2322): expected a type:



typedef TComInterface<_Nullable, &IID__Nullable> _NullablePtr;


[bcc32c Error] mscorlib_TLB.h(4426): C++ requires a type specifier for all declarations:



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(4426): nullability specifier '_Nullable' cannot be applied to non-pointer type 'int':



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(12060): declaration of anonymous struct must be a definition:



interface _Nullable : public IDispatch


[bcc32c Error] mscorlib_TLB.h(22823): expected ')'
mscorlib_TLB.h(22822): to match this '(':



 virtual HRESULT STDMETHODCALLTYPE MarshaledObject(VARIANT obj/*[in]*/, 
Mscorlib_tlb::_ObjRef* or/*[in]*/) = 0; // [-1]


I've also tried to import the .net dll with 'Import .NET Assembly', but that gives me 'OLE Error'.



Any idea what I'm missing?










share|improve this question














I'm trying to use a third party .net dll in C++Builder (10.3).



I create a .tlb file for the dll with regasm.exe. Then I go to 'Import a Type Library' and choose the .tlb that has been registered, and then choose to install into a new package.



When building the package, I get errors in the generated file mscorlib_TLB.h (I have no experince of .net, but I understand mscorlib is a base class needed in .net).



Here are some of the error messages and the source lines:



[bcc32c Error] mscorlib_TLB.h(2321): declaration of anonymous struct must be a definition:



 interface DECLSPEC_UUID("84E7AC09-795A-3EA9-A36A-5B81EBAB0558") _Nullable;


[bcc32c Error] mscorlib_TLB.h(2322): expected a type:



typedef TComInterface<_Nullable, &IID__Nullable> _NullablePtr;


[bcc32c Error] mscorlib_TLB.h(4426): C++ requires a type specifier for all declarations:



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(4426): nullability specifier '_Nullable' cannot be applied to non-pointer type 'int':



typedef _Nullable Nullable;


[bcc32c Error] mscorlib_TLB.h(12060): declaration of anonymous struct must be a definition:



interface _Nullable : public IDispatch


[bcc32c Error] mscorlib_TLB.h(22823): expected ')'
mscorlib_TLB.h(22822): to match this '(':



 virtual HRESULT STDMETHODCALLTYPE MarshaledObject(VARIANT obj/*[in]*/, 
Mscorlib_tlb::_ObjRef* or/*[in]*/) = 0; // [-1]


I've also tried to import the .net dll with 'Import .NET Assembly', but that gives me 'OLE Error'.



Any idea what I'm missing?







.net dll c++builder






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 12 hours ago









TomasTomas

33




33












  • Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

    – Hans Passant
    10 hours ago

















  • Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

    – Hans Passant
    10 hours ago
















Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

– Hans Passant
10 hours ago





Your compiler just can't handle mscorlib.tlb. Requiring it to use your .NET assembly is not pretty and should always be avoided. You need to go back to your C# code and make it better. We can't see it but you need to declare the interface explicitly and make your C# class [ClassInterface(ClassInterfaceType.None)].

– Hans Passant
10 hours ago












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280161%2fcompilation-error-when-importing-net-type-library%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280161%2fcompilation-error-when-importing-net-type-library%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?