For one of my setups I need to access a dll (it´s a VB dll and it will be also registered for com) to do the following:
- First I will need to create an object from a sprecific class of mydll. Let´s call it MyClass and MyObject. The constructor won´t need any parameters.
- Second I will need to call some functions with MyObject. These functions will need some parameters and out-parameters. Most of these parameters and return values will be of Type LONG and BSTR, but also every function will have an out parameter that is a struct (let´s call it MyErrorStruct) that contains two LONGs (lErrorSystem and lErrorNr) and a BSTR (szDescription). Ofcourse MyErrorStruct is also defined in my Dll.
I´ve already done a lot with InstallScript but I didn´t need an external dll until now, and I don´t have any clue how to solve my Problem. Looking around in help files, forums and the internet I found two funtions that seem relevant for me:
- CoCreateObject and
- UseDll
I found plenty examples, but I still don´t understand...
...how can I instanciate a object of a specfic class? In both fuctions above only the dll or the ProgId is given and an object is created - but of what class??? How can I specify MyClass? How can I specify MyErrorStruct?
...how do I have to handle the parameters and the return values? In these examples there are often 'pointers' and commands like '->' and '&' and I also haven´t ever used a BSTR...
I only need LONGs, BSTR, MyErrorStruct for my funtions could anyone please tell me how to use them in InstallScript?
Could any one help me with my problem?
Best Regards
Ralf
PS: Ihr dürft auch gerne auf deutsch antworten ;-)
Edited by MillionsterNutzer, 19 March 2009 - 10:16.