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 7723683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:30:15+00:00 2026-06-01T04:30:15+00:00

I am loading OCX dynamically in VB 6.0. The following is the code that

  • 0

I am loading OCX dynamically in VB 6.0.

The following is the code that I am using to load and call the methods:

Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long 
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long 
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long 
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long 

Private Sub Foo 
  On Error Resume Next 

  Dim lb As Long, pa As Long 
  Dim versionString As String 
  Dim retValue as Long 

  lb = LoadLibrary("D:\projects\other\VB_DLLs\TestDLL\TestDLL.dll")   

  'retrieve the address of getVersion' 
  pa = GetProcAddress(lb, "getVersion") 

  'Call the getVersion function' 
  retValue = CallWindowProc (pa, Me.hWnd, "I want my version", ByVal 0&, ByVal 0&) 

  'release the library' 
  FreeLibrary lb 
End Sub 

Now I want to access public properties of OCX. How I can access (get/set) the properties of OCX?

  • 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-06-01T04:30:16+00:00Added an answer on June 1, 2026 at 4:30 am

    You can not use an OCX/COM control in that manner.

    To create and use an instance of the object, you will need to.. create an instance of the object, then use that.

    Set TestObject = CreateObject("TestDll.TestObject")
    Value = TestObject.Method(InputValue)
    

    This requires the DLL to be registered, and will use whichever is registered rather than a specific instance.

    If you don’t want it to be registered, look at DirectCOM.

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

Sidebar

Related Questions

After loading a PHP template (using jQuery's load function), this simple script won't make
When loading a html page using JQuery load, I also need to call another
Loading the image one time works as done in the following steps (for code
Does loading unimportant data right after page load using AJAX help load the web
Upon loading into a C++ program a Prolog program that contains the command 'send'
When loading an existing document using NSPersistentDocument , as part of initialization I'd like
When loading a page, I have the following in my controller: request.setAttribute(myAtt, Testing); I
When loading tables from SAS to Teradata, SAS loads the data (usually using the
I am working with the Adobe Flash ocx by loading it into my C++
I'm using a form that has date picker controls on it. When the form

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.