Cannot use toolbox from AstControlsu.ocx file.

Cannot use toolbox from AstControlsu.ocx file.

quan_hm
Collaborator Collaborator
476 Views
2 Replies
Message 1 of 3

Cannot use toolbox from AstControlsu.ocx file.

quan_hm
Collaborator
Collaborator

Hi,

I was following the developer training guide to develop a joint: Advance Steel COM API Developer Training Guide

 

In the section 4.15.7 Add ActiveX control to load AstControlsu.ocx file and do exactly the same. It was loaded but I was not able to drag the item from toolbox to the design page. 

 

It will show error: "failed to import activex control please ensure it is properly registered"

It also show error "Object reference not set to an instance of an object." when I try to drag other default items from tool box. 

 

minhquanqttb_2-1676775846076.pngminhquanqttb_4-1676776164747.png

minhquanqttb_0-1676775779995.png

What I've tried is to register the ocx file followed this post: https://forums.autodesk.com/t5/advance-steel-forum/using-astcontrolsu-ocx-in-as-2019/td-p/8118758

But still have the problem.

 

Additional info: I was using AS 2023, the SDK I use is 2021 version, Visual Studio 2019.

Really appreciate your help.

Thank you. 

 

 

 

Hoang Minh Quan - Piping design engineer
Autodesk Store for Python Catalog
0 Likes
Accepted solutions (1)
477 Views
2 Replies
Replies (2)
Message 2 of 3

cristian.udreaBYPDW
Autodesk
Autodesk
Accepted solution

Hi,

 

Make sure the project has the build platform AnyCPU in the Configuration Manager, in addition to x64.

 

When you want to add new ActiveX controls to one of the forms, switch to AnyCPU before opening the form designer.

 

When compiling the project for distribution:

  • Close any form designers that are still open.
  • Remove the references ASTCONTROLSLibAxASTCONTROLSLib, and stdole from the project.
    They are automatically added by Visual Studio each time a new ActiveX control is placed.
  • Make sure the reference AxInterop.ASTCONTROLSLib from the AS install directory is added to the project.
    This will allow compiling the forms for x64.
  • Switch to x64 and compile.

This is needed because the form designer in Visual Studio 2019 is 32-bit.

 

For binary and API compatibility, I'd recommend using the same SDK version as the AS version you are targeting.
Using an addon compiled with an older SDK version with a newer version of AS is not supported and may cause errors.

 

The current version of the SDK can be found here: Advance Steel 2023 Software Development Kit

Message 3 of 3

quan_hm
Collaborator
Collaborator

Thank you. 

I think change to AnyCPU is really do the trick!. 

Hoang Minh Quan - Piping design engineer
Autodesk Store for Python Catalog
0 Likes