Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get compiled object name

Status
Not open for further replies.

bakerm

Programmer
Apr 25, 2000
53
US
I am writting a program that allows me to compile multiple vbp files into dll's. I am using a shell function for the compile and it works great. I need a way to get the dll file name once it is compiled, it can vary from the project name.

Shell Example:
Shell(sCompilerLocation & " /m " & sCompileFile & ", vbHide)

The shell does a great job, but I don't know how to get the dll name once compiled.

Thanks in advance for your help.
 
You have to open the .VBP and look at the ExeName32= line in the project file. Try something like this:

Private Sub Form_Load()
Debug.Print CompileToName("c:\vb\prj\Test\Test.vbp")
End Sub

Private Function CompileToName(sProjectName As String) As String
Dim iFile As Integer
Dim sBuffer As String

iFile = FreeFile
Open sProjectName For Input As #iFile

Do Until EOF(iFile)
Line Input #iFile, sBuffer
If InStr(1, sBuffer, "ExeName32") > 0 Then
CompileToName = Mid$(sBuffer, 12, Len(sBuffer) - 12)
Exit Do
End If
Loop

Close #iFile
End Function
Snaggs
tribesaddict@swbell.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top