elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Resourse From Dll(gif)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Resourse From Dll(gif)  (Leído 1,707 veces)
ntaryl

Desconectado Desconectado

Mensajes: 95



Ver Perfil
Resourse From Dll(gif)
« en: 25 Diciembre 2010, 12:52 pm »

Good  morning   

I play a litle with Resource File last night
Add a resource(gif) in a small project and is easy to load it from there in the form and show in listview.
Try to add the resourse(gif)in Dll and  call it from there but i cant 
Please can someone   help me with this   .or give me some tips 

thanks for the time


En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: Resourse From Dll(gif)
« Respuesta #1 en: 25 Diciembre 2010, 22:51 pm »

.
Si es una dll Externa al ejecutable deberas usar

Código
  1.  
  2. Private Declare Function FreeLibrary Lib "KERNEL32" (ByVal hLib As Long) As Long 'BOOL
  3. Private Declare Function LoadLibrary Lib "KERNEL32" Alias "LoadLibraryA" (ByVal strFilePath As String) As Long
  4.  
  5.  

Código
  1.  
  2. Private Declare Function FindResource Lib "KERNEL32" Alias "FindResourceA" (ByVal hLib As Long, ByVal strName As String, ByVal strType As String) As Long
  3. Private Declare Function FreeLibrary Lib "KERNEL32" (ByVal hLib As Long) As Long
  4. Private Declare Function LoadResource Lib "KERNEL32" (ByVal hLib As Long, ByVal hRes As Long) As Long ' // handle of Resource
  5. Private Declare Function LockResource Lib "KERNEL32" (ByVal hRes As Long) As Long ' // Get Pointer Of Resource
  6. ...
  7. ...
  8.  
  9.  

ligas de interes:
 * http://www.recursosvisualbasic.com.ar/htm/listado-api/160-obtener-recurso-avi-de-archivo.htm
 * http://wap.andreavb.com/forum/viewtopic_5214.html

Para reproducir un Gif nesesitaras cargar los "Fotogramas con un intevalo X de tiempo".
 * http://www.recursosvisualbasic.com.ar/htm/trucos-codigofuente-visual-basic/59.htm

Temibles Lunas!¡.
.


« Última modificación: 25 Diciembre 2010, 22:53 pm por BlackZeroX▓▓▒▒░░ » En línea

The Dark Shadow is my passion.
ntaryl

Desconectado Desconectado

Mensajes: 95



Ver Perfil
Re: Resourse From Dll(gif)
« Respuesta #2 en: 26 Diciembre 2010, 00:23 am »

Thanks  from the Reply 
But  i cant  solve  it   sorry   
If store res gif  in executable  work  fine   
from  dll   no   
Have a good  night 
En línea

ntaryl

Desconectado Desconectado

Mensajes: 95



Ver Perfil
Re: Resourse From Dll(gif)
« Respuesta #3 en: 27 Diciembre 2010, 15:22 pm »

Good  afternoon   
My friend i try but i cant.
Search around but find only the way with to add the dll as referense .Not like me this way .

This is the code i writte .i dont know if is correct  ?
Código:
Dim hLibrary As Long, hFind As Long
Dim hGif As Long
hLibrary = LoadLibrary(App.Path + "\Flags.dll")
If hLibrary = 0 Then
      MsgBox "Failed to load the specified library with error code " & Err.LastDllError
      Exit Sub
   End If
hFind = FindResource(hLibrary, "#111", "CUSTOM")
If hFind = 0 Then
     MsgBox "Failed to find Resource with error code " & Err.LastDllError
    Exit Sub
  End If
hGif = LoadResource(hLibrary, hFind)
If hGif = 0 Then
      MsgBox "Failed to load the specified resource with error code " & Err.LastDllError
      Exit Sub
      End If
this Files(Gifs) in Dll are Flags and add at runtime in imagelist and from there put in a listview .
I saw many ways how to load bmp from dll in another project .
if add the Flags in dll like Bmp then the dll Grow up  .

thanks for the time   


giorgos   
En línea

ntaryl

Desconectado Desconectado

Mensajes: 95



Ver Perfil
Re: Resourse From Dll(gif)
« Respuesta #4 en: 4 Enero 2011, 20:27 pm »

Thanks  for the replys 
Deside and Use Createobject and  load the gif from dll in  listview
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines