Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3963540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:13:38+00:00 2026-05-20T03:13:38+00:00

This is a follow-up question to this question because I’m losing my mind over

  • 0

This is a follow-up question to this question because I’m losing my mind over this right now.

Someone pointed me to this article and I’m trying to copy section 4 from there.

So I created an empty C++ Project in MSVC++2010, created a new .cpp file inside it, and put the following code in there:

#include <windows.h>
#define CCONV _declspec(dllexport) // used to be __stdcall but resulting DLL is identical

int CALLBACK LibMain (HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
LPSTR lpszCmdLine)
{
     return 1;
}

short CCONV PassInteger (short intgr, short far *pintgr)
{
    *pintgr = intgr;
    return intgr + 1;
}

(I got the LibMain code from here but I think it doesn’t do anything here.)

Then, I added a .def file to the project and put this in it:

;vb6dll32 DEF File
LIBRARY vb6dll32

CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE

EXPORTS
PassInteger

The compiler outputs two warnings that CODE and DATA in the .def file are not supported for the current target, but it eventually compiles and generates the file vb6dll32.dll which I have then copied to C:\windows\system and ...\system32 and C:\.

Then I have created a VB6 project, put a button into the form and added this sourcecode:

Private Declare Function PassInteger Lib "vb6dll32.dll" _
(ByVal intgr As Integer, pintgr As Integer) As Integer

Private Function BuiltIntest() As Integer

    Dim i As Integer
    Dim ir As Integer

    i = 7

    i = PassInteger(i, ir)
    Print i, ir

    Return

End Function

Private Sub Command1_Click()
    MsgBox (BuiltIntest())
End Sub

Now, when I click the button, it still gives me “Runtime error ’53’: file vb6dll32.dll not found.” (This happens even if I give it a fully specified path in the VB source code, e.g. “C:\vb6dll32.dll” and the file is definitely there. I tried giving its location without path and without “.dll” and so on, nothing changes.)

What also bugs me is, when I run regsvr32 c:\vb6dll32.dll it also tells me “The module C:\vb6dll32.dll could not be loaded. etc etc” .. I have no idea what it should do but that should generally do something for DLL files, right?

What am I doing wrong?! Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:13:39+00:00Added an answer on May 20, 2026 at 3:13 am

    Maybe your vb6dll32.dll is dynamically linked and depends on stuff like MSVCR100.dll, which
    isn’t easy to locate. Check imports and put these dlls beside your vb6dll32.dll, or
    link it statically (/MT /LD).

    Also you really don’t need these CODE and DATA lines in the .def file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is a follow-up question of mine. Suppose now I have a URL :
This is a follow up question to my previous question . I am trying
This looks very similar to my previous question because it's some sort of follow
A few months ago I posted this question because I tried to follow all
This is a follow up question from Calling constructor in return statement . This
This is a follow up question to a previous question I asked about calculating
This is a follow-on question from the one I asked here . Can constraints
This is a follow-up question to ASP.NET How to pass container value as javascript
This is a follow-up question to this question I asked earlier. Btw thanks Neil
This is a follow-up question to the following if you would like to see:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.