Hola Gente

Tengo problemas al instalar un paquete en una nueva ubicación.
Por ejemplo, instalo dolphin en otro lugar que no sea el predeterminado e 
intento cargar el paquete, luego un script intenta cargar y registrar la DLL 
que es un COM. 
Pero me dice que no encuentra la DLL.

Yo hago esto:
TV3DObject(class)>>applicationPath
    "Return the application path"

    ^(PackageRelativeFileLocator packageNamed: 'TV3DProject') basePath.

TV3DObject(class)>>registerServer
    "Register the TV3DLib as a COM component"

    | dllpath entrypoint |
    dllpath := self applicationPath , 'Library\TVb3D65.dll'.
    entrypoint := #DllRegisterServer.
    
    [| lib |
    lib := ExternalLibrary open: dllpath.
    
    [| method proc |
    proc := lib getProcAddress: entrypoint
                ifAbsent: 
                    [self 
                        error: ('<1s> was loaded but the <2s> entry point could 
not be found.<n><n>This file cannot be registered' 
                                expandMacrosWith: dllpath
                                with: entrypoint)].
    method := (lib class compiledMethodAt: #DllRegisterServer) copy.
    method literalAt: 1
        put: (((method literalAt: 1) copy)
                dwordAtOffset: 0 put: proc;
                yourself).
    method value: lib withArguments: #()] 
            ensure: [lib close].
    MessageBox new notify: ('<1s> in <2s> succeeded.' expandMacrosWith: 
entrypoint with: dllpath)] 
            on: Error
            do: [:each | MessageBox errorMsg: each description]

El tema es que si yo copio la DLL al directorio donde esta el dolphin.exe, si 
encuentra la DLL !!!!!

Donde esta el error ?.
Como lo manejan  ustedes ?.

Porque diablos la imagen es colocada en un directorio a parte del EXE ?.

Como quedan los directorios cuando se hace un exe de la imagen ?.
Segun este  comentario :
An ImageRelativeFileLocator is used to indicate the location of an external 
file that may be referenced within the image. 
Instances of this class always locate files relative to the image directory, 
unless the file is outside the local directory hierarchy below the image 
directory, in which case an absolute path is used.

Note that the 'image' directory may dynamically change between image restarts, 
and in the case of a deployed application the 'image' directory is the folder 
in which the executable resides.

El exe quedaría en el directorio de la imagen !.
Entonces porque tengo este problema ?

saludos 



      Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/
--~--~---------~--~----~------------~-------~--~----~

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]

http://www.clubSmalltalk.org
-~----------~----~----~----~------~----~------~--~---

Responder a