|
-
Dec 10th, 1999, 11:53 AM
#1
Thread Starter
Junior Member
I simply cant get to open a simple .exe or .txt file from a resource file, i tried, but i seem to be way off, can anybody give me a little help here?
-
Dec 10th, 1999, 03:10 PM
#2
Are you trying to open a txt file as text into a text box? Are you trying to run the exe file? What is the resource file? Sorry for all the questions, I may not have any idea of what you are looking for but I can't help if I don't understand
-
Dec 10th, 1999, 09:18 PM
#3
Sure! Here is a function I wrote for a similar post:
Code:
Public Sub RunResourceExe(pintResourceID As Integer)
Dim bytArr() As Byte
Dim intFFN As Integer
Dim strPath As String
bytArr = LoadResData(pintResourceID, "CUSTOM")
strPath = App.Path & IIf(Right(App.Path, 1) = "\", "~tempexe.exe", "\~tempexe.exe")
intFFN = FreeFile
Open strPath For Binary As intFFN
Put #intFFN, , bytArr
Close #intFFN
Shell strPath, vbNormalFocus
End Sub
Usage: RunResourceExe ResourceID
Example: RunResourceExe 101
Assuming that you have an ID 101 in the CUSTOM thread.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 11th, 1999, 08:45 AM
#4
Thread Starter
Junior Member
the code works to run the .exe, but i cant get it to load a text. I was also hoping you could make some sense to the code since i know just a little about what it means. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|