locked
All of my VB6 controls throw the same 'Failed to Import the ActiveX Control' error when I try to add them to my vb.Net form RRS feed

  • Question

  • I am using VS 2010 SP1.

    I have a VB6 app with over 100 ocx's that I want to use in my VB.Net winforms app (eventually porting all the controls to .net as time goes by).  I can add the controls to the toolbar no problem, however when I try and drag and drop any of the controls from the toolbar to a .Net usercontrol I get the same 3 warnings (just the ocx name is different), i.e.

    Warning 1 Could not load file or assembly 'Interop.PICSIF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. AXIMP PICSDNCOM
    Warning 2 Cannot find wrapper assembly for type library "AxPICSXMVA". PICSDNCOM
    Warning 3 The referenced component 'AxPICSXMVA' could not be found.

    Note:  The VB6 app runs just fine so all of the ocx's are registered properly, etc.

    Am I missing a step here or is it that I just can't use my VB6 controls in vb.net?

     

     

    Thursday, December 1, 2011 7:46 PM

Answers

  • Try to switch your project to use .NET 3.5 instead of 4.0
    • Marked as answer by Doug Marquardt Friday, December 16, 2011 3:13 PM
    Thursday, December 15, 2011 7:47 AM
  • Hi Mike:

    I switched to 3.5 and it worked!  Then I switched it back to 4.0 and it worked as well... so the workaround is to add it to a 3.5 project first and then switch to 4.0 (I need to target the 4.0 framework as my app used the new entity framework features in 4.0).  I am getting error messages from 3rd party controls about licensing... that will be the next thing I'll have to figure out ;-)

    Thanks for your help!

    Doug.

     

    Friday, December 16, 2011 3:15 PM

All replies

  • Hi Doug,

    Welcome to the MSDN Forum.

    How about this suggestion: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/0806b8ef-c914-428f-ad19-75196276e1b5/ Please take a look at grattier's reply at Wednesday, July 19, 2006 12:33 PM.

    The detail is:

    After you add it to ToolBox, Drag and Drop it in your Windows Form... The error will raise.. click Ok..

    Rebuil Your Project (The DLL will be copied)

    Re-Drag and Drop the component and now, it'll work.

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, December 2, 2011 12:00 PM
    Moderator
  • Hi Mike:

    I tried everything in the article - nothing worked (same errors).

    Any other suggestions?

    Doug.

     

    Friday, December 2, 2011 6:57 PM
  • Hi Doug,

    Do you try this way?

    http://social.msdn.microsoft.com/Forums/ar/msbuild/thread/5071b3c2-bef7-46c6-998d-d065b5c5d191

    The VB.NET IDE will generate the interop assembly automatically when Add Reference to a type library, it seems there are some path issues on the reference to this interop assembly in your new setup machine, or the interop assembly is just missed and would be existed only after installed your production(I guess this is the case). Because I'm not very familiar with ADODB, you could ask that developer for help to installed the necessary library to resolve this issue.

    In addition, you can put the dlls in the bin folder, so you can change the "copy local" property to true. (Right click on project -> properties -> References), Or you can put your dll in the system32 folder, and try again.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, December 5, 2011 12:49 PM
    Moderator
  • Tried all the ways suggested - same thing.

    The 'ax' wrapper has these properties:

    Identity: {5BE1119A-9191-4A08-8C15-C81DA1566215}\1.6\0\aximp
    Path: <blank>

    Does that give us any more clues?

    Doug.

     

    Monday, December 5, 2011 4:38 PM
  • Hi Doug,

    This is a quick note to let you know that I am performing research on this issue and get back to you as soon as possible. I appreciate your patience.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, December 7, 2011 5:33 AM
    Moderator
  • Try to switch your project to use .NET 3.5 instead of 4.0
    • Marked as answer by Doug Marquardt Friday, December 16, 2011 3:13 PM
    Thursday, December 15, 2011 7:47 AM
  • Hi Mike:

    I switched to 3.5 and it worked!  Then I switched it back to 4.0 and it worked as well... so the workaround is to add it to a 3.5 project first and then switch to 4.0 (I need to target the 4.0 framework as my app used the new entity framework features in 4.0).  I am getting error messages from 3rd party controls about licensing... that will be the next thing I'll have to figure out ;-)

    Thanks for your help!

    Doug.

     

    Friday, December 16, 2011 3:15 PM
  • Hi Doug,

    Thank you for sharing your workaround here.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, December 19, 2011 11:10 AM
    Moderator
  • fwiw... it no longer works in 4.0 (no idea why it worked for a little bit and then back to the same old errors) - so I'm stuck with the 3.5 and using a file reference instead of a project reference.

    Also, I'm now having issues with XP Styles screwing up my VB6 forms - I will post another thread about that ;-)

     

    Tuesday, December 20, 2011 2:25 PM