Results 1 to 7 of 7

Thread: vb6 dll built by Visual Studio 2017

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2020
    Posts
    1

    vb6 dll built by Visual Studio 2017

    I've found some material to help me get started, but I'm not able to get my .dll built by vs2017 registered/referenced into my vb6 project. The .dll reports the correct export symbols when I urn it through dumpbin.exe, so I think the .dll is "ok", but perhaps there is more I need to do.

    Can anyone recommend a go-by for how to connect a VS2017 c++ dll into a vb6 build?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: vb6 dll built by Visual Studio 2017

    Adding Objects and Controls to an ATL Project is no longer possible it seems.

    You may have to look into MFC instead.

    Naked flat DLLs are easier and can be used by VB6 programs, but that doesn't to seem to be what you want to do.

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: vb6 dll built by Visual Studio 2017

    Oops, you might need ATL after all: MFC and ATL.

    Sorry, it has been over 20 years since I even looked at this.

  4. #4
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,749

    Re: vb6 dll built by Visual Studio 2017

    you need use a regasm tool make *.tlb for vb6

    易语言调用VB.NET编写的COM-DLL | 511遇见
    http://www.511yj.com/eyuyan-vbnet-comdll.html
    Code:
    set p=test
    set w=C:\windows\
    copy %p%.dll %w%%p%.dll<strong class="text-danger"> xxx </strong>
     
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe %w%%p%.dll /tlb:%w%%p%.tlb /codebase
     
    pause

  5. #5
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    706

    Re: vb6 dll built by Visual Studio 2017

    In VB6, press F2(Object Browser), select your DLL and see if you find anything.

  6. #6
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,068

    Re: vb6 dll built by Visual Studio 2017

    When you say your exports are showing up correctly in dumpbin, this leads me to believe you are creating a standard C dll same as stdcall windows api and not an activeX library ?

    If this is the case you do not add standard C dlls using the "add references" or "add components" dialogs.

    You have to write declare statements for each exported function in them.

    A sample dll and vb declares can be found here for various prototypes: http://sandsprite.com/CodeStuff/c_dll_4_vb.zip
    more info: http://sandsprite.com/CodeStuff/Writ...ll_for_VB.html

  7. #7
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,749

    Re: vb6 dll built by Visual Studio 2017

    if use standard dll by vc++,vb6 can use like:
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
    you must export by " stdcall"
    you also can make com dll(activex dll)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width