locked
How Can I use OCX FILE in VB 6.0 RRS feed

  • Question

  • Sorry, for my bad english.


    I have some problem to reference OCX in VB 6.0

    ocx file name is testOCX.ocx



    This OCX well running in HTML with javascript.


    CODE :

    ...
    <script>
    function login() {
    ret = document.testOCX.login(); // Call login Function 
    return ret; // That just 0( or some positive int value, no meaning)
    }
    </script>

    ... 

    <script language='javascript" for="testOCX" event="event_login(str_result)>

       event_result = str_result; // str_result : "SUCCESS" , "FAIL" , "UNHANDLED ERROR" 

    </scipt>

    ...



    and, well running in VB.NET in VS2010 

    Project - reference - COM - ADD OCX ( testOCX Active X Control Module )

    testOCX1 is name of testOCX 

    CODE : 

    ...
    Public Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    label1.text = CStr(testOCX1.login()) // call login()
    End Sub
    ...
    public sub testOCX1_event_login(sender As Object, res As testOCXLib._DtestOCXEvents_event_loginEvent) Handles testOCX1.event_login
    MsgBox ( res.str )
    End Sub


    In VB.NET in VS2010 well running intellisence.

    In public sub Button1_Click()

    Cursor over testOCX1 , intellisence shows [Friends WithEvents testOCX1 As testOCXLib.testOCX]
    Cursor over testOCX1.login() , intellisence shows [Public Overridable function login() As Integer]

    In public Sub testOCX1_event_login()

    Cursor over testOCXLib , intellisence shows [Namespace testOCXLib]
    Cursor over testOCXLib._DtestOCXEvents_event_loginEvent , intellisence shows [Class _DtestOCXEvents_event_loginEvent]
    Cursor over testOCX1.event_login , intellisence shows [Public Event event_login(sender As Object, res As testOCXLib._DtestOCXEvents_event_loginEvent)]



    OCX in HTML or VB.NET well running. 

    call login() Function. 
    then get event result. variable name in javascript is str_result. in VB.NET is res.str 
    like this "SUCCESS", "FAIL", "UNHANDLED ERROR"

    But in VB 6.0. 
    I can't find how to get event message. I can't find how to event handling.
    I don't This OCX's running in VB 6.0 ??

    Please, anyone explain this problem. 
    I don't know what problem in this case. 

    Thank you for any answers. ANY ANSWERS... I don't know what I didn't know.

    IF YOU SAY TO ME : 
    You can't use this OCX file in VB 6.0 Because that OCX can't checked COM Visible Property  or NOT checked register for COM interface.  
    .. and so on.

    Thank you very much. Thank you... I'll give up.
    • Moved by Youjun Tang Tuesday, May 12, 2015 6:26 AM Not supported
    Monday, May 11, 2015 8:23 AM

Answers

  • Hello,

    VB 6.0 is a kind of antique visual basic version which is not supported in this forum. 

    However, if you search on Google you can certainly find like from everything websites from persons who try to keep it running. 


    Success
    Cor

    • Proposed as answer by Armin Zingler Monday, May 11, 2015 11:35 AM
    • Marked as answer by Just Karl Thursday, May 21, 2015 10:34 PM
    Monday, May 11, 2015 9:26 AM

All replies

  • Hello,

    VB 6.0 is a kind of antique visual basic version which is not supported in this forum. 

    However, if you search on Google you can certainly find like from everything websites from persons who try to keep it running. 


    Success
    Cor

    • Proposed as answer by Armin Zingler Monday, May 11, 2015 11:35 AM
    • Marked as answer by Just Karl Thursday, May 21, 2015 10:34 PM
    Monday, May 11, 2015 9:26 AM
  • Hi Karl, 

    No problem however, 

    That "Where to post your VB 6 questions" was for 5 years already outdated. 

    I currently don't even get it anymore. 

    I write it the way I do to signal persons to get a newer Visual Basic, we are currently almost 7 versions further 12 (there has been a .1 version which was in fact a major revision)

    It seems wrong to me to redirect then to ancient tools.


    Success
    Cor


    Wednesday, May 13, 2015 8:58 AM
  • Hi Karl, 

    No problem however, 

    That "Where to post your VB 6 questions" was for 5 years already outdated. 

    I currently don't even get it anymore. 

    I write it the way I do to signal persons to get a newer Visual Basic, we are currently almost 7 versions further 12 (there has been a .1 version which was in fact a major revision)

    It seems wrong to me to redirect then to ancient tools.


    Success
    Cor


    Cor,

    Thanks, I did not notice that the "Where to post your VB 6 questions" post is now deleted. I will modify my standard response.

    I agree that people should upgrade.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Wednesday, May 13, 2015 2:03 PM
  • Hello,

    VB 6 is no longer supported by Microsoft.

    I'd suggest upgrading to the free Visual Studio Community Edition or to a paid Visual Studio version.

    If you insist that you need to use VB 6, which has been out of support since April 2008, I'd suggest using your favorite search engine to find a third party support forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Wednesday, May 13, 2015 2:12 PM
  • Thank you for reply.
    Thursday, May 14, 2015 8:09 AM
  • Thank you for reply.
    Thursday, May 14, 2015 8:10 AM