2 Replies Latest reply: May 1, 2012 12:26 PM by Daniel Lipkie RSS

    OCX in Windows Forms Application .NET 4.0 C#



      I'm currently trying to embed a QLikViewOCX into a standard windows forms application. Everytime I drag the object onto the form I get an error that my OCX is not correctly registered (which it is). I'm using QV 11 IR an Visual Studio 2010 SP1 wih .NET 4.0.


      Any ideas?




        • OCX in Windows Forms Application .NET 4.0 C#
          Matthias Seeck



          currently is it not possible to use QlikViewOCX with VS2010 .NET 4.0.

          Her are the relevant extract from the release note of Qvs 10 SR4:


          ''Visual Studio 2010 is unable to import QlikView OCX in projects that target .NET framework 4. For QlikView OCX to work with Visual Studio 2010, the project should target .NET framework 3.5 or earlier."


          Best regards


          • OCX in Windows Forms Application .NET 4.0 C#

            Have you tried manually replacing the wrappers that are created when you drag the OCX from the Visual Studio toolbox to the WinForm?


            After the drag/drop ... use the following to manually create the three wrapper dlls that are needed as project references.


            Unfortunately there is a bug in Visual Studio 2010 and it does not properly generate wrappers for ocx files. So these wrappers need to be created using the utility, AxImp.exe. These wrappers are used to replace wrappers in Visual Studio as described below.


            Click Start, point to All Programs, point to Microsoft Visual Studio, point to Visual Studio Tools, and then click Visual Studio Command Prompt. This command prompt will use a PATH environment variable that makes AxImp.exe available as a command.


            To create these wrappers




            execute the following commands from the Visual Studio command prompt

                            cd C:\temp\QlikView\x86

            "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\AxImp" QlikOcx.ocx

            cd C:\temp\QlikView\x64

            "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\AxImp" QlikOcx.ocx

            Close the command prompt.