Fix build warnings of SimpleAddIn (SDK sample)

Fix build warnings of SimpleAddIn (SDK sample)

Maxim-CADman77
Advisor Advisor
517 Views
6 Replies
Message 1 of 7

Fix build warnings of SimpleAddIn (SDK sample)

Maxim-CADman77
Advisor
Advisor

Nowadays I study code samples of Inventor SDK.

 

I'd like to know the reason for two warnings that occur in Output window of VisualStudio while building SimpleAddIn (sample from Developer Tools) and the best way to get rid of those warnings:

 

1. warning BC40000: 'Support' is obsolete: 'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only (repeats 4 times).

 

2. "Info: Could not find files for the given pattern" 

 

PS: 

Warnings are reproducible in C# and VB.Net

 

PPS:

I'm using Autodesk Inventor 2023 (2023.1.1) and Visual Studio community 2019 (16.11.19).

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
518 Views
6 Replies
Replies (6)
Message 2 of 7

JelteDeJong
Mentor
Mentor
Accepted solution

If I'm not mistaken those Microsoft.VisualBasic.Compatibility.* classes are there for loading images. (for example images for your buttons.) But there are better solutions for that. You can have a look into my blog series about creating an addin.

http://www.hjalte.nl/60-creating-an-inventor-addin

http://www.hjalte.nl/61-adding-icons-to-your-buttons

http://www.hjalte.nl/62-debugging-addins

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 7

Maxim-CADman77
Advisor
Advisor

I still want to know if it possible to get rid of warnings on creating SimpleSample addin build without changing the way of loading images.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 7

Maxim-CADman77
Advisor
Advisor

@JelteDeJong 

Thank for you attention but...
...you recommend to use PNG but I do see much better transparency support (no white pixels on half-transparent pixels within Dark theme) when using ICO (see update in 1st comment to idea Icon customization for external iLogic rule ribbon Button).
This is why I prefer to stay with ICO and thus still need a better solution

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 5 of 7

JelteDeJong
Mentor
Mentor

I used png files in my tutorial because I think they are easier to create. But the "PictureDispConverter" -class should also accept ico files.

JelteDeJong_0-1665944996411.png

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 6 of 7

Maxim-CADman77
Advisor
Advisor

I do confirm getting best result using ICO with PictureDispConverter.
So let agree Autodesk just supply us with SDK containing some old ... samples.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 7 of 7

Maxim-CADman77
Advisor
Advisor

@JelteDeJong 
FYI, nowadays I needed to play-around with code of the add-in I've developed on my old PC (Visual Studio 2019 Community) on my new PC (Visual Studio 2022 Community) and it failed co compile reporting error BC31424 on all mentions of "stdole.IPictureDisp" (ribbon button images).

 

I then decided to add Microsoft.VisualStudio.Interop.DLL references of the project*.

This solved compile issue but Add-In than failed to load into Inventor with catch-Message:
"Method not found: 'Void Inventor.ButtonDefinitionObject.set_StandardIcon(stdole.IPictureDisp)'."

 

I'm a bit puzzled. Initial project code keep compile successfully in VS 2019.

 

What I'm missing?
Don't your "Adding-Icons-to-your-Buttons" article need to be updated somehow to meet changes introduced in Visual Studio 2022 ?

 

*
I've found such recommendation for Excel Add-In developers - New version requiring Microsoft.VisualStudio.Interop.dll 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes