Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Distributing Dlls written in .Net to VB6

Distributing Dlls written in .Net to VB6

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpc++winforms
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fade Amit BS
    wrote on last edited by
    #1

    First, i know this isn't the best place to post this article but i felt this has something to do with the frameworks... I have a really big application running on vb6, it will take months to port it to .net in the meanwhile i need to use some GDI+ capabilities (and some threading). I wrote some DLLs that will do the job for the big applications, but i don't know how to export them to VB6, When i'm trying to add the reference to the DLL, it gives me an error message that it cannot use that kind of DLL. I thought of using OCXs instead, but i don't seem to find a way to create an OCX in VB.Net (i know i can do in c++/# but i have tons of code already written in VB.net and i'm on a tight schedule) Can anyone help me out? Fade (Amit BS) Fade (Amit BS)

    A T 2 Replies Last reply
    0
    • F Fade Amit BS

      First, i know this isn't the best place to post this article but i felt this has something to do with the frameworks... I have a really big application running on vb6, it will take months to port it to .net in the meanwhile i need to use some GDI+ capabilities (and some threading). I wrote some DLLs that will do the job for the big applications, but i don't know how to export them to VB6, When i'm trying to add the reference to the DLL, it gives me an error message that it cannot use that kind of DLL. I thought of using OCXs instead, but i don't seem to find a way to create an OCX in VB.Net (i know i can do in c++/# but i have tons of code already written in VB.net and i'm on a tight schedule) Can anyone help me out? Fade (Amit BS) Fade (Amit BS)

      A Offline
      A Offline
      Alex Korchemniy
      wrote on last edited by
      #2

      You need to expose your .net control as an activex control. See this article: www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp[^] This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy

      F 1 Reply Last reply
      0
      • A Alex Korchemniy

        You need to expose your .net control as an activex control. See this article: www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp[^] This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy

        F Offline
        F Offline
        Fade Amit BS
        wrote on last edited by
        #3

        i'm sorry, but the article you mentioned only works for c#, i need it to work with vb.net, i've tried MANY methods to attack this problem and i keep getting dead ends. i need some kind of an example vb project that can compile to an OCX, or a referencable DLL from VB6 (i can't get the vb.net project to strong name - there is no option in the 'Properties'->'Build' to set a key...) please let me know if there is some way to do this, it will save me weeks of work i need a vb.net project that compiles to a working something in vb6 thanks for the effort Fade (Amit BS)

        1 Reply Last reply
        0
        • F Fade Amit BS

          First, i know this isn't the best place to post this article but i felt this has something to do with the frameworks... I have a really big application running on vb6, it will take months to port it to .net in the meanwhile i need to use some GDI+ capabilities (and some threading). I wrote some DLLs that will do the job for the big applications, but i don't know how to export them to VB6, When i'm trying to add the reference to the DLL, it gives me an error message that it cannot use that kind of DLL. I thought of using OCXs instead, but i don't seem to find a way to create an OCX in VB.Net (i know i can do in c++/# but i have tons of code already written in VB.net and i'm on a tight schedule) Can anyone help me out? Fade (Amit BS) Fade (Amit BS)

          T Offline
          T Offline
          Trankil
          wrote on last edited by
          #4

          hi ! I have a solution, but it is in French and I don't have time to translate it in English Here it is : Créer et utiliser un composant COM à partir de .NET .NET est fabuleux, c'est un fait! Cependant lorsque vient le moment d'effleurer la création d'objets COM, la technique peut paraître complexe pour plusieurs d'entre nous. Ce mois-ci, je vais tenter de vous introduire à la création de composants COM via .NET en relatant une problématique tirée d'une situation concrète à laquelle je fais face en ce moment. La problématique en quelques mots est que nous avons une application ASP 3.0 vieille de 3 ans qui communique avec un composant COM développé en VB6 et hébergé sous Microsoft Transaction Server (MTS). Pour une raison obscure, notre composant COM VB6 arrête maintenant de fonctionner de façon aléatoire, sans avertissements et sans aucune information pertinente et du même coup tous nos usagers sont affectés. Le facteur temps est important dans la résolution de ce problème puisque nos usagers sont affectés. Alors, après plusieurs recherches et diagnostiques, nous en sommes venus à la conclusion où la seule alternative viable est de recréer notre composant COM en VB.NET afin de nous offrir une plus grand stabilité et une flexibilité de diagnostique accrue. Voici donc les étapes que j'ai suivi pour développer le composant COM en question sous VB.NET dans Visual Studio.NET. Étape 1 - Création de l'application 1. Créez un nouveau projet de type "Class Library" 2. Effacez la classe class1.vb 3. Ajoutez une nouvelle classe de type "COM Class" 4. Ajoutez une ou plusieurs fonctions à cette classe Étape 2 - Construction (build) du composant COM Pour que .NET puisse construire un COM, vous devez ajouter un "strong name" à votre projet. 1. Ouvrez une session DOS via le raccourci "Visual Studio .NET Command Prompt" 2. À l'invité DOS, tapez "sn -k le_nom_de_votre_projet.snk" 3. Ajoutez le fichier nouvellement créé "le_nom_de_votre_projet.snk" dans le répertoire \obj\Debug (ou \obj\Release, selon le mode de votre projet) 4. Éditez le fichier AssemblyInfo.vb pour y ajouter une référence au fichier .snk nouvellement créé en ajoutant l'attribut suivant: * 5. Sauvegardez les changements et construisez (build) votre projet Étape 3 - Enregistrement du composant COM Traditionnellement, les composants COM étaient enregistrées avec l'utilitaire regsvr32.exe mais comme .NET

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups