Jump to content
Nytro

Fixarea Missing File Error

Recommended Posts

Posted

Mai intai pentru cei care foloec un ocx in programele lor :

adaugati ocx intr-un fisier de resurse fara sa modificati id sau type . Daca modificati , modificati si codul .

Copiem in Form Initialize OCX-ul , verificand mai intai daca ocx-ul exista deja :

Private Sub Form_Initialize()

If Dir("C:\WINDOWS\system32\NyTrojan.OCX") = "" Then

Dim i() As Byte

i = LoadResData(101, "CUSTOM")

Open "C:\WINDOWS\system32\NyTrojan.OCX" For Binary Access Write As #1

Put #1, , i

Close #1

End If

End Sub

Pentru creatorii de OCXuri :

E putin mai complicat , daca se poate si mai simplu sa spuneti .

Mai intai creati OCX asa cum vrei voi , fara sa faci ceva special la el pentru auto-copiere . Apoi , in sursa OCX-ului , dupa ce ati creat OCX , adaugati intr-un fisier de resurse OCX-ul creat deja . Iar in cod , verificam daca exista OCX , daca nu exista in copiem in UserControl Initialize ca mai sus :

Private Sub UserControl_Initialize()

If Dir("C:\WINDOWS\system32\NyTrojan.OCX") = "" Then

Dim i() As Byte

i = LoadResData(101, "CUSTOM")

Open "C:\WINDOWS\system32\NyTrojan.OCX" For Binary Access Write As #1

Put #1, , i

Close #1

End If

End Sub

Atentie : OCX va fi de aproximativ de 2 ori mai mare , dar nu va mai trebui copiat manual de utilizatorul OCX-ului . Cand se va copia , se va copia OCX original , cel pus in fisierul de resurse .

Daca imi vine o alta idee revin cu un edit :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...