how to compile OCX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suvarna1026
    New Member
    • Jan 2008
    • 21

    how to compile OCX

    Hi,thanks for motivating me.(Last time I gave myhomework to somebodyelse,bu t that is not good approach to learn.)I tried everything n learnt lot.But I have on doubt,plz tell me how to compile OCX.(I am creating HTTP File Upload OCX in VB6.0).Thanking you.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    From the file menu find the option Make OCX.

    It will compile the code and create the ocx file for you.

    Comment

    • suvarna1026
      New Member
      • Jan 2008
      • 21

      #3
      Originally posted by debasisdas
      From the file menu find the option Make OCX.

      It will compile the code and create the ocx file for you.




      sorry,not getting.Plz tell me again in brief.I have'nt created an OCX before.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by suvarna1026
        sorry,not getting.Plz tell me again in brief.I have'nt created an OCX before.
        Have you written the code for the OCX ?

        Comment

        • suvarna1026
          New Member
          • Jan 2008
          • 21

          #5
          Originally posted by debasisdas
          Have you written the code for the OCX ?
          Yes.First I searched what is it,I used API's n user control.I m posting my eritten code.

          Public Function UploadFileHTTP( ByVal localFileName As String, ByVal remoteFileName As String) As Integer
          'On Error Resume Next
          Dim nRet As Integer
          Dim nFileHandle As Integer
          Dim sData As String
          Dim lWritten As Long
          Dim hConnect As Long
          Dim hsend As Long
          Dim nLOF As Long
          Dim remoteFileSize As Long
          Const BUFFER_SIZE = 1000

          downloadCancele d = False 'Set initially to False
          remoteFileSize = GetHTTPFileSize (remoteFileName )
          sData = String(BUFFER_S IZE, 0)
          nFileHandle = FreeFile

          hConnect = InternetConnect (hInternet, "", INTERNET_DEFAUL T_HTTP_PORT, "", "", INTERNET_SERVIC E_HTTP, 0, 0)
          If hConnect = 0 Then
          GetHTTPErrorInf o
          RaiseEvent DownloadErrorHT TP(HDC_ERROR_RE MOTE_OPENFILE_F AILED, HDC_REMOTE_OPEN FILE_FAILED, httpErrorCode, httpErrorString )
          UploadFileHTTP = False
          Exit Function
          End If
          hRequest = HttpOpenRequest (hConnect, "", "", Null, Null, Null, INTERNET_FLAG_R ELOAD, 0)

          Open localFileName For Binary Access Write As nFileHandle
          nLOF = LOF(nFileHandle ) + 1
          nRet = InternetWriteFi le(hConnect, sData, BUFFER_SIZE, lWritten)

          Close nFileHandle
          InternetCloseHa ndle hConnect
          End Function

          Comment

          • suvarna1026
            New Member
            • Jan 2008
            • 21

            #6
            Originally posted by debasisdas
            Have you written the code for the OCX ?
            my question is how to test written code.I mean it is correct or not.

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              Compile the code (refer post #2).
              Include the OCX in another standard EXE project and check if it works.

              Comment

              • Swan
                New Member
                • Mar 2008
                • 27

                #8
                Originally posted by debasisdas
                Compile the code (refer post #2).
                Include the OCX in another standard EXE project and check if it works.
                hey I got d point.I choose standerd EXE instead ActiveEXE.Now ok.I got d option make ocx.But I am getting error as "Error accessing System registry".

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Originally posted by Swan
                  hey I got d point.I choose standerd EXE instead ActiveEXE.Now ok.I got d option make ocx.But I am getting error as "Error accessing System registry".

                  That is OK but

                  Why this duplicate ID ???

                  Comment

                  • suvarna1026
                    New Member
                    • Jan 2008
                    • 21

                    #10
                    Originally posted by debasisdas
                    That is OK but

                    Why this duplicate ID ???
                    hey,don't take it othewise.It's not like that.Me n my friend commonly trying to solve the problem.That was by mistake.I am sorry.

                    Comment

                    Working...