Access VB dll

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Access VB dll

Cristian Porta-2
Hi all,
I need access to an object/class VB DLL using grails/groovy without
using java and JNI(argghhh), it's possible?

Thanks,
Cristian.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

Guillaume Laforge-2
Hello Cristian,

Perhaps this can help you?
http://groovy.codehaus.org/COM+Scripting

On 4/24/06, Cristian Porta <[hidden email]> wrote:
> Hi all,
> I need access to an object/class VB DLL using grails/groovy without
> using java and JNI(argghhh), it's possible?
>
> Thanks,
> Cristian.
>
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

Cristian Porta-2
Ok, I have tried access to the DLL but I recive thie error:

[groovy] Caused by:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed, CristianController: xxxx: unable to resolve class ActiveXProxy

this is a part of my class


import org.codehaus.groovy.scriptom.ActiveXProxy

class CristianController {

        .....

        @Property dll = {
                def lm = new ActiveXProxy("THE.objdll")
       
                lm.CryptoKey = "1234567890123456"
                lm.SoftwareKey = "UPRL3FTYAVJ3GCFBF4ZUBOK2Q3CXA"
               
                println lm.HasError.value
        }
        .....

}
 
Where I mistake?

T

On Mon, 24 Apr 2006 09:37:21 +0200
"Guillaume Laforge" <[hidden email]> wrote:

> Hello Cristian,
>
> Perhaps this can help you?
> http://groovy.codehaus.org/COM+Scripting
>
> On 4/24/06, Cristian Porta <[hidden email]> wrote:
> > Hi all,
> > I need access to an object/class VB DLL using grails/groovy without
> > using java and JNI(argghhh), it's possible?
> >
> > Thanks,
> > Cristian.


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

Guillaume Laforge-2
On 4/24/06, Cristian Porta <[hidden email]> wrote:

> Ok, I have tried access to the DLL but I recive thie error:
>
> [groovy] Caused by:
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed, CristianController: xxxx: unable to resolve class ActiveXProxy
>
> this is a part of my class
>
>
> import org.codehaus.groovy.scriptom.ActiveXProxy
>
> class CristianController {
>
>         .....
>
>         @Property dll = {
>                 def lm = new ActiveXProxy("THE.objdll")
>
>                 lm.CryptoKey = "1234567890123456"
>                 lm.SoftwareKey = "UPRL3FTYAVJ3GCFBF4ZUBOK2Q3CXA"
>
>                 println lm.HasError.value
>         }
>         .....
>
> }
>
> Where I mistake?

You've added the scriptom in your classpath? and also added the
jacob.dll somewhere?
I'm not sure I can help you much on that I'm afraid.

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

graemer
On 4/24/06, Guillaume Laforge <[hidden email]> wrote:

> On 4/24/06, Cristian Porta <[hidden email]> wrote:
> > Ok, I have tried access to the DLL but I recive thie error:
> >
> > [groovy] Caused by:
> > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> > failed, CristianController: xxxx: unable to resolve class ActiveXProxy
> >
> > this is a part of my class
> >
> >
> > import org.codehaus.groovy.scriptom.ActiveXProxy
> >
> > class CristianController {
> >
> >         .....
> >
> >         @Property dll = {
> >                 def lm = new ActiveXProxy("THE.objdll")
> >
> >                 lm.CryptoKey = "1234567890123456"
> >                 lm.SoftwareKey = "UPRL3FTYAVJ3GCFBF4ZUBOK2Q3CXA"
> >
> >                 println lm.HasError.value
> >         }
> >         .....
> >
> > }
> >
> > Where I mistake?
>
> You've added the scriptom in your classpath? and also added the
> jacob.dll somewhere?

You will need to add the scriptom jar to the lib directory of your
grails app and also you will have to modify the grails startup script
to include:

-Djava.library.path=$PATH_TO_JACOB\jacob.dll

Graeme
> I'm not sure I can help you much on that I'm afraid.
>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

Guillaume Laforge-2
On 4/24/06, Graeme Rocher <[hidden email]> wrote:
> [...]
> You will need to add the scriptom jar to the lib directory of your
> grails app and also you will have to modify the grails startup script
> to include:
>
> -Djava.library.path=$PATH_TO_JACOB\jacob.dll

I knew Graeme would have the missing details ;-)

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Access VB dll

Cristian Porta
In reply to this post by graemer
On Monday 24 April 2006 12:53, Graeme Rocher wrote:

> You will need to add the scriptom jar to the lib directory of your
> grails app and also you will have to modify the grails startup script
> to include:
>
> -Djava.library.path=$PATH_TO_JACOB\jacob.dll

Ok Graeme,
now I'm at home and I don't have any windows pc for try

I can wednesday :)

Thanks all
Cristian.