Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Clan CDH on December 01, 2006, 08:54 PM

Title: Executing An EXE From DLL
Post by: Clan CDH on December 01, 2006, 08:54 PM
How would I do this via a dll made in VB6???
Title: Re: Executing An EXE From DLL
Post by: l2k-Shadow on December 01, 2006, 09:29 PM
ok? What do you mean?

this dll would have to be loaded into another vb6 program (since vb6 are ActiveX dlls) and then a sub in the dll would have to be called by the loading program. Loading a dll can be done by using the CreateObject() function in VB.
Title: Re: Executing An EXE From DLL
Post by: topaz on December 01, 2006, 09:56 PM
Shell(), exec()
Title: Re: Executing An EXE From DLL
Post by: Clan CDH on December 01, 2006, 10:15 PM
basically I want when the dll is loaded to execute files, kinda like in just a standard exe it would be something like this

Quote
Private Sub Form_Load()
Shell("notepad.exe"
End Sub

edit:
would this have to be made in something like c,c++, or c# by any chance?
Title: Re: Executing An EXE From DLL
Post by: topaz on December 01, 2006, 10:22 PM
no
Title: Re: Executing An EXE From DLL
Post by: Joe[x86] on December 02, 2006, 12:32 AM
Quote from: Clan CDH on December 01, 2006, 10:15 PM
basically I want when the dll is loaded to execute files, kinda like in just a standard exe it would be something like this

Quote
Private Sub Form_Load()
Shell("notepad.exe"
End Sub

edit:
would this have to be made in something like c,c++, or c# by any chance?

Program:

Public Sub Form_Load()
    ' create the DLL object here
    Call dllReference.ExecuteProgram("C:\Windows\sol.exe")
End Sub


DLL:

Public Sub ExecuteProgram(Path as String)
    Shell Path
End Sub


Untested. I don't have VB handy.
Title: Re: Executing An EXE From DLL
Post by: l2k-Shadow on December 02, 2006, 09:21 AM
I talked to him on AIM and it looked like he wanted to execute a by itself .dll as if it was a .exe =/
Title: Re: Executing An EXE From DLL
Post by: warz on December 02, 2006, 12:47 PM
Calling LoadLibrary executes DllMain, if present.
Title: Re: Executing An EXE From DLL
Post by: rabbit on December 02, 2006, 07:16 PM
You can use Windows' rundll to execute a DLL as an executable.
Title: Re: Executing An EXE From DLL
Post by: MysT_DooM on December 02, 2006, 11:00 PM
i hope his not making some client server program o.O