PDA

View Full Version : Visual Basic DLL


Waza04
09-23-2004, 02:05 PM
Hi,
I need to make Setup Factory call a VB DLL, any ideas how to do it?

Cheers,
Warren

PS: Setup Factory 7 is wicked!! :yes

Brett
09-23-2004, 02:37 PM
Basically, you should be able to use DLL.CallFunction to call the function from the DLL.

Waza04
09-23-2004, 03:15 PM
It dosent work! Cant find function...

I have a funtion in a class, how do I specify the class? Since all functions have to be in class!

Worm
09-23-2004, 03:39 PM
Be sure the function is exported, and that you are using the exact spelling in your call as the function is aliased as.

Waza04
09-23-2004, 03:48 PM
Be sure the function is exported, and that you are using the exact spelling in your call as the function is aliased as.

Huh? What you mean?

Worm
09-23-2004, 03:56 PM
From your previous post, I assumed that you wrote the DLL yourself. In your code, you need to tell the compiler which functions are exported (available to call from another program).

When you make the call to the DLL, be sure to use the same spelling as you did in your code, it is case sensitive.

Waza04
09-24-2004, 01:38 AM
Yes, in C++!

You cant do that with VB DLLs

JXBURNS
09-24-2004, 03:16 AM
I think you will have problems in either VB6 or VB.NET. Unless the DLL was compiled to instantiate your DLL through COM, COM won't help you in this situation. Developing in C++ is the only way that I know for this to be achieved. I'm not a great user of COM so may well be wrong and certainly do not use C++.

John

Waza04
09-24-2004, 05:09 AM
This is the problem I have! Its a shame that even this version of Setup Factory does not support VB DLLs....

(I cant code in C++)

Also, there is a typo bug in the DLL action:

CallConvention
The calling convention that AutoPlay will use when calling the DLL

AutoPlay should say Setup Factory

Corey
09-24-2004, 05:18 AM
Thanks for pointing out that typo. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Waza04
09-24-2004, 05:37 AM
Thanks for pointing out that typo. :)

No problem, however I need a solution to my problem with my VB DLL...

I can convert the DLL to an EXE, but whatever happens, I need to pass a variable to the EXE, and then the EXE will return a number...

How would I get this number?

Cheers,
Warren

JXBURNS
09-24-2004, 05:38 AM
Its a shame that even this version of Setup Factory does not support VB DLLs....

No application can access a VB generated DLL unless the DLL has clever stuff added to it which only available via C++ so not a Setup Factory problem. Your only choice is to have a VB6 front end application pass through from SUF7 to the DLL but then I would ask why bother having the DLL anyway.

Have you thought whether SUF7 could replicate the DLL functionality at all?

John

Waza04
09-24-2004, 05:40 AM
It cant replicate what the DLL does, bcause the DLL has encryption routines in it etc...

However, as I said I can convert to an EXE, but I need to get the result from the EXE?

Corey
09-24-2004, 05:47 AM
FWIW as far as I know the Crypto encryption plug-in from http://www.autoplay.org is compatible with Setup Factory 7.0...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Waza04
09-24-2004, 05:48 AM
I need to use the encryption I have in my DLL, as it is the same as that used in my app.

JXBURNS
09-24-2004, 06:27 AM
What about writing back from the DLL to a file on the disk and have SUF7 then read it before deleting it? Easiest option I can see although appreciate it may not be the securest.

John

Waza04
09-24-2004, 07:01 AM
What about writing back from the DLL to a file on the disk and have SUF7 then read it before deleting it? Easiest option I can see although appreciate it may not be the securest.

John

Good idea... Im still thinking about posibilties, such as getting the DLL to write to the registry etc... Thanks!

Worm
09-24-2004, 07:33 AM
Sorry Waza, I missed the whole VB angle on your DLL. As someone stated already, the DLL is an ActiveX DLL. You could look into using the LuaCOM plugin (if it's compatible with SF7).

Waza04
09-24-2004, 07:47 AM
Sorry Waza, I missed the whole VB angle on your DLL. As someone stated already, the DLL is an ActiveX DLL. You could look into using the LuaCOM plugin (if it's compatible with SF7).

No problem! What is/where is that plugin?

Worm
09-24-2004, 07:52 AM
http://www.icynorth.com/luacom/index.html

but I'm not 100% sure that it will work with SF7. My understanding was that the action plug-ins from AMS5 would work in SF7. If that's the case, then it should.

Brett
09-24-2004, 09:29 AM
Yeah, you could totally use the LuaCOM plugin to call the VB-created COM DLL function.

In answe to:

I can convert the DLL to an EXE, but whatever happens, I need to pass a variable to the EXE, and then the EXE will return a number...

File.Run action actually returns a number which is the process return code. In this manner you can get the number back from the executable. I think in VB you use "ExitProcess()" to quite tha pplication and return a process-specific return code.

Another way to do it is that your VB application could write the information to the Registry or an INI file and then just have your SUF7 app pick up the value when the VB app finished running.

One thing to bear in mind with all of this is that if your end user does not have the appropriate VB runtime DLLs on their system it is all moot because your VB app or DLL will not work properly anyhow.

What is it that your VB DLL/EXE needs to do anyhow? Maybe there is a way to do the same thing right from SUF70...

JXBURNS
09-25-2004, 05:39 AM
Brett,

You're right about VB sending back a code and (typically I had forgot I already do that in several of my apps):

Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

You can then terminate the VB app with

ExitProcess number_you_want_to_exit_with

and, as you said, SUF7 can then read that subject to all the usual caveats re runtimes etc. being available.

John