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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. I want a file DLL write by VC++ used in VisualBasic ?

I want a file DLL write by VC++ used in VisualBasic ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
4 Posts 2 Posters 1 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.
  • T Offline
    T Offline
    Thangnc
    wrote on last edited by
    #1

    :^)Hi all! I created a file DLL by VC++.After that to insert in VisualBasic I do following: From Menu choose Project->Reference...-> Browse to file *.DLL (Adsoft.DLL) Choose in ComboList (Prọect/Library)->Adsoft But any class and function in there don't to appear. If possible. Can you give me an example ? Thank !

    D 1 Reply Last reply
    0
    • T Thangnc

      :^)Hi all! I created a file DLL by VC++.After that to insert in VisualBasic I do following: From Menu choose Project->Reference...-> Browse to file *.DLL (Adsoft.DLL) Choose in ComboList (Prọect/Library)->Adsoft But any class and function in there don't to appear. If possible. Can you give me an example ? Thank !

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Thangnc wrote: But any class and function in there don't to appear. Have they been exported?


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      T 1 Reply Last reply
      0
      • D David Crow

        Thangnc wrote: But any class and function in there don't to appear. Have they been exported?


        "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        T Offline
        T Offline
        Thangnc
        wrote on last edited by
        #3

        Thanks DavidCrow! I don't think your ? I write this class following: // Adsoft.H #ifdef ADSOFT_IMPL #define CLASS_DECL_ADSOFT _declspec(dllexport) #else #define CLASS_DECL_ADSOFT _declspec(dllimport) #endif #undef AFX_DATA #define AFX_DATA CLASS_DECL_ADSOFT class AdsoftDLL : public CSocket { public: BOOL CGetCheckErro(int nErroCode); }; #undef AFX_DATA #define AFX_DATA // Adsoft.cpp #include "afxdllx.h" #include "Adsoft.h" BOOL CGetCheckErro(int nErroCode) { if (nErroCode==0) return FALSE; return TRUE; } But to happen phenomenon don't to want

        D 1 Reply Last reply
        0
        • T Thangnc

          Thanks DavidCrow! I don't think your ? I write this class following: // Adsoft.H #ifdef ADSOFT_IMPL #define CLASS_DECL_ADSOFT _declspec(dllexport) #else #define CLASS_DECL_ADSOFT _declspec(dllimport) #endif #undef AFX_DATA #define AFX_DATA CLASS_DECL_ADSOFT class AdsoftDLL : public CSocket { public: BOOL CGetCheckErro(int nErroCode); }; #undef AFX_DATA #define AFX_DATA // Adsoft.cpp #include "afxdllx.h" #include "Adsoft.h" BOOL CGetCheckErro(int nErroCode) { if (nErroCode==0) return FALSE; return TRUE; } But to happen phenomenon don't to want

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          I'm really not sure what you've provided here. Is this code that does not work? Are you wanting to export the AdsoftDLL class or just the CGetCheckErro() method? After a successful compile/link, have you verified with either Dependency Walker or Dumpbin that the DLL has the correct export table? Thangnc wrote: BOOL CGetCheckErro(int nErroCode) In adsoft.cpp, shouldn't this be:

          BOOL AdsoftDLL::CGetCheckErro(int nErroCode)


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

          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