Creating A File, And Loading Two Files At Once
How would i code the save buttons so it would create a file at the users difined area, and save a text file and a image file as the same name, so it stores the comment/description in a file for each image e.g. image1.jpg would have a file called image1.txt, and then your program just has to read this file when the image is loaded?
*See here for more info about my problem*
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Link List File And Loading Lib
Hope someone can help with this.
How do you create a link list file in vb6 and then load a library in your project.
any input will be appreciated.
Loading PCX Files Packed In A File
Well, I have to load a file (not a PCX file) that has a lot of header information, and then x number of PCX data information, all packed in one file.
The Format Specification is a little like:
31-32 bytes: number of PCX images
??-?? bytes: offset of 1o. image
xx-xx bytes: First PCX image
yy-yy bytes: Second PCX image
OK, I think you know what I'm talking about... I'm using:
OPEN Filename FOR BINARY As #1
Get #1, , b
OK, this way I can read any numbers like PCX width, height, etc... I have the PCX Format Specifications, but I need to do the following in VB: load this file, and show all PCX files in the screen (with PictureBox, DirectX, whatever)
Any suggestions? Thanks in advance...
Loading Files W/File Association
I have been thinking about this for a file now and so far i havent even got a starting point...
What i want to do is Associate .hbh file types (HellBound Harvester) with the Harvester program, The program has a Load Instructuction Set Button, where the files can be opened from inside the program... BUT...
I wanted to make it so that if you double click say "addons.hbh" it opens the program and reads the files, so far when i associate the .hbh with the exe all it does it fire the load exe, and i have no idea where to even start....
To sum up, i wanna be able to click on a file made with my program, that is associated with my program and have it open my program and read the settings from that file into the program..
When u click on .txt file, it fires NotePad and it reads the file and puts the contents into the textbox, thats what i wanna be able to do....
I know i rambled a little but im not very good at explaining what i want, so i try to give as much info as possible, it all makes sense in my head, but it dont when i type it out
Can someone tell me how to format VB Code ? i cant find it in the help file, im thinking like [vb] and [/vb]
Loading A Bunch Of Files Into A Resource File
I have over 1000 jpgs I need to load into a resource file, and I need to keep the name of the jpg in the resource file. Does anybody know a way to load a bunch of files into the resource file?
Loading Names Of Files Into A Data Base Or Text File
I need to put to gether a program for mangeing data at work. I need to know how to look in a directory and load the names of the files in it to either text file or preferbly a data base file. I need the code and explicet instructions on how to use the code(I'm still trying to get used to VB)
Need Help Creating A .txt File Of Files In A Folder
I am copying files from one central location "C:Documents and SettingsAll UsersDesktopupdates" to the same location on multiple machines dependent on what was selected via option boxes "live and test".and I need to make a .txt file of the files that were copied with whatever text was entered in txtTo.text being the file name of the .txt file. Can anybody give me a hand, I am having a hard time with it.
Private Declare Function CopyFile Lib "kernel32" _
Alias "CopyFileA" (ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, ByVal bFailIfExists As Long) _
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
Dim txt As String
Dim txt1 As String
Dim txt2 As String
Dim txt3 As String
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Const FO_COPY = &H2
Public Sub SHCopyFile(ByVal from_file As String, ByVal to_file As String)
Dim sh_op As SHFILEOPSTRUCT
.hWnd = 0
.wFunc = FO_COPY
.pFrom = "C:Documents and SettingsAll UsersDesktopupdates*.*"
.pTo = "\" & txtTo.Text & txt
txt3 = "C:Documents and SettingsAll UsersDesktopupdates*.*"
Private Sub cmdCopy_Click()
SHCopyFile txt3, txtTo.Text
Private Sub Option1_Click()
txt = "LIVEUPDATES"
Private Sub Option2_Click()
txt = "TESTUPDATES"
Thanks for your help
Creating And Copying Files Into A .Zip File
I want to be able to create a blank zip file and copy a text file into that zip directory. I can create the zip file and I've been trying the FileCopy function without success.
Any help would be much appreciated.
Opening Multiple .asc Files && Creating One .txt File
I am new to Excel VBA and I need some help. I want to create a macro that opens an .asc file which user selects through an input box. I want the macro to then copy a certain range of data from the .asc file and export into a .txt file. After that is done I want it to open another .asc file, do the same thing, but export it to the same .txt file. To explain I have an Infrared machine that splits the large data output into two .asc files. One file has the beginging data, the other has the end data. I want the .txt file to contain the full range. The .asc files have added junk, that is why I only want to export a certain range. **NOTE** the first .asc file will have a different range to export than the second, but I know the exact range of each. When opening an .asc file Excel automatically brings up the "text to columns" box. I want the file to open fixed-width automatically. I probably confused everyone, sorry, but I know someone will have a solution. Thanks in advance....it is much appreciated.
Need Help Creating A Text File Of Copied Files
I have written a program that copies files from one machine (cpu1) to other machines (cpu2, cpu3, cpu4). I need to write a log on the local machine (cpu1) stating the machine name of the copied to (cpu2) and date as the title of the log. When you open the log it has the files that were copied.
Reading Files In A Folder And Creating .ini File
I dont know if this is possible using FileSystemObject and WritePrivateProfileString, but what I want to do is read ALL the files from a folder (that will contain music files) and place the file names in an .ini file.
For example :
Folder Contains Files : Song1.mp3, Another Song.mp3, Nice Song.mp3
.INI file created :
Creating One Text File From Existing Files
I really need help with this one! There are at least 2 or more batch files but with unknown names. Now, what I need to do is copy all the texts from each and every one of them and save them in one file.
Any help or suggestion would be very much appreciated.
Creating A Text File That Lists Files And Timestamps
I am copying files from one machine to others and I have a .txt file that I want to list the files that were copied. How would I do that?
Open "c:update.txt " For Output As #1
Print #1, ????
Is there a way to list every file is the folder that I am copying from and write that to the c:update.txt?
Creating Macintosh-like Loading Bar
I think most of you know what i mean, that kind of scrolling bar that appears when something is loading on the macintosh, similar to the Windows XP startup bar but tilted...
I tried making a control like this, but first of all it was extremely slow, and secondly my logic failed somewhere in the middle so it looked awful...
How can i create a bar like this that looks good and runs smoothly?
Loading/creating Control Help
I have a question that somebody should be able to answer. I want
to create load an object for my program through code. Like :
but doing it like above means that I have to have an array button
already there to copy, does anyone know a way og creating a
button at runtime without having one ready, what I really need to to
is set its name. so if I cant do the above can i somehow rename
the/a control at runtime?
Tel +44 1323 524020
Fax +44 1323 524024
This message is intended for the use of the addressee
only and may contain confidential or privileged information.
If you have received it in error please notify the sender
and destroy it. You may not use it or copy it to anyone else.
E-mail is not a secure communications medium,
please be aware of this when replying.
Although Smith & Ouzman Limited has taken steps to ensure that
this E-mail and any attachments are virus free, we can take
no responsibility if a virus is actually present and you are
advised to ensure that the appropriate checks are made.
Creating A New Picture (as Opposed To Loading One)
I'm starting work on a 2d game, with a tile-based map. As opposed to drawing multiple tiles on the screen each frame, I'd like to build the map as one big bitmap when the level loads, and then just take a rectangular chunk of that bitmap each frame and set that chunk as the form's picture. So basically, I want this to happen each frame:
form.paintPicture mapPicture, 0, 0, form.width, form.height, cameraX, cameraY, form.width, form.height
Where "mapPicture" is the big bitmap representing my map, and "cameraX", "cameraY" is where we are in the map. Do you know what I mean?
Anyways, the problem with this is that, to create "mapPicture" in the first place, I need to be able to create a new bitmap of varying width and height through pure code; once I have that, I can just paintPicture individual tiles onto it. How would I go about doing this?
Creating Master Excel File From Many One Page Excel Files
I am using VB6 and am able to create a master excel file of Teaching schedules by getting all files in a specific directory that start with S2004. Starting with line 26 (MaxTimes = 11 represents time slots from 8a to 10p at night, increments of 1 hr 15 min classes) is a synopsis of the classes that an instructor will be teaching. So far I can create a single sheet in the master file from all the other schedules. What I would like to do is add a copy of the individual schedules into the master file. So, Master Sheet 1 (named 'MASTER') will still contain the synopsis. Master Sheet 2 will be a copy of Person#1's schedule (named for that person), Master Sheet 3 will be a copy of Person#2's schedule (named for that person), etc. My attempt below is not working. Please help. Thanks.
Private Sub CreateMasterSchedule_Click()
Dim Filename As String, Path As String
Dim Workbook, WorkbookAll As Workbook
Dim Worksheet, WorksheetAll As Worksheet
Dim Row As Integer, RowAll As Integer, i As Integer, j As Integer
Dim SheetNumber As Integer
'create MASTER file composed of individual schedule data
Set ExcelAll = New Excel.Application
Set WorkbookAll = ExcelAll.Workbooks.Add
Set WorksheetAll = WorkbookAll.ActiveSheet
WorksheetAll.Name = "MASTER"
RowAll = 1
SheetNumber = 2
Dialog1.Label1 = "Loading..."
' Set Worksheet = Workbook.ActiveSheet
Path = "c:"
Filename = Dir(Path)
Do While Filename <> ""
If Mid(Filename, 1, 6) = "S2004_" Then
'get data from files
Set Excel = New Excel.Application
Set Workbook = Excel.Workbooks.Open(Path + Filename)
Set Worksheet = Workbook.ActiveSheet
Dialog1.Label1 = Dialog1.Label1 + Chr(10) + "Processing " + Path + Filename + "..."
Row = 1
'offset of 3 accounts for two rows at top (Name, Days) and space row between last time slot and row data
Do While Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, 1) <> ""
For i = 1 To 12
'preserve date format as 03/14/98 instead of 34768
If i = 9 Or i = 10 Then
WorksheetAll.Rows.Cells(RowAll, i) = CStr(Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, i))
WorksheetAll.Rows.Cells(RowAll, i) = Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, i)
Row = Row + 1
RowAll = RowAll + 1
'copy schedule onto another sheet in the MASTER file
'I haven't figured out how to select and copy the entire sheet yet
' For i = 1 To Row
' For j = 1 To 12
' WorksheetAll.Rows.Cells(i, j) = Worksheet.Rows.Cells(i, j)
' Next j
' Next i
' WorksheetAll.Name = Mid(Filename, 6)
'change back to MASTER list sheet to add next faculty's info
' SheetNumber = SheetNumber + 1
'close faculty file
Set Excel = Nothing
Filename = Dir() ' Get next entry.
WorksheetAll.Cells.Sort Key1:=Range("A1:L" + CStr(RowAll))
WorkbookAll.SaveAs ("c:Documents and SettingscegDesktopMASTER")
Set ExcelAll = Nothing
Vista && Creating A File In "Program Files"
Hello everyone. I have recently been developing a program, and just the other day I completed it. I developed this program on Windows Vista Home Basic. When I ran the program it worked perfect. I compiled my program and made it an installer. When my program runs inside the "Program Files" folder, it returns this error: "Run-Time error '75': Path/File Error".
This is due to my program creating a "settings.txt" on the app startup. How do i fix this?
Trouble Loading/creating Multiple Imagebox
I can't figure out why this only creates 1 extra image box. any ideas?
Private Sub Form_Load()
Dim i As Long
For i = 1 To 8
.Move ImageBox(i - 1).Width, 0, 97, 97
.Visible = True
Private Sub ImageBox_Click(Index As Integer)
Loading/Creating User Forms At Runtime
Need another helping hand here!...
how do i create a form at runtime? is it the same as loading and
creating controls at runtime? does this piece of code will actually
Private Sub Command1_Click()
Dim i as Integer
for i = 1 to 5
this code is supposed to show five forms. doesn't work!
Loading PNG Files ?
I want to click the button and the image is loaded into Picture1. The problem is PNG files are not "standard" so I can't use this code to load it, does anyone have an idea what I have to do?
Picture1 = LoadPicture(App.Path & "Images.png")
Loading Gif Files?
i have an animated gif file, and i want to use it in my form, how can i do this, plz help
Aiight, this is how it goes... I've grasped the concept of Sprites and BitMaps, but I can't understand how to load it from a file into my game and use it from there... Any help and maybe some "explained" examples might help me out...
Pls Help For Loading EML Files
hi! Every body
I was writing a email program where in I have to Load eml files. Can any one help me in this.
Or in other words I want to load a .eml file in my program as it can be loaded and previewed in outlook express.
Looking for reply
Thanks & Regards
Down Loading More Than One Files Frm URL
i want to create a download manager in vb6.0
which will download files from a given url , it should have the feature for downloading from multiple url's simultaneously.
i.e multiples files can be downloaded simultaneously.
and show the progress bar for each diaplaying status of each.
pls suggest me how to do and what control should i use .
i have done it thru thread and ms-ITC , but is producing errors.
i am attaching the code i have written.
I hope I don't ask too much
I'd like to know how I can get VB to load a file from the same directory as the form/program is in itself.
When I write:
Open "Database.txt" For Input As #1
VB just says that the file's not found :S
I'm writing a program to load a file (file extentions *.mpg, *.avi, *.txt, and *.exe) for an autorun file on some cd's i'm making.
Basically, I want to be able to open the movie, or executable, or text file, all in the default veiwers and not in the program, and then have the program shut down when the user has succsessfully opened the file.
Don't get me wrong, I have attempted to do this on my own. The regular filehandling options don't seem to work...Is there a special command for just opening a file, as if the user clicked on the file's icon in explorer?
Thanks in advance....
How would I go about loading a text file, or an ini file into a listbox? I cant figure it out.
My program is acting a bit strangely. I have built into it a procedure were you can change the path of the needed files. And this procedure works fine. However, when I add my procedure to the program, everything work, the variables with the path, all get set correctly, but the files do not get loaded imidiatly, so that the combo-boxes of this, the main form, gets filled.
CODEDim strAnsatte As String
Dim strAnsatteFilePath As String
Dim strBygg As String
Dim strByggFilePath As String
Dim strEiendom As String
Dim strEiendomFilePath As String
On Error GoTo HandleErrors
'strAnsatteFilePath = "C:ikdv" & "Ansatte.dat"
'strByggFilePath = "C:ikdv" & "Bygg.dat"
'strEiendomFilePath = "C:ikdv" & "Eiendom.dat"
strAnsatteFilePath = gstrDatabasePath & "Ansatte.dat"
strByggFilePath = gstrDatabasePath & "Bygg.dat"
strEiendomFilePath = gstrDatabasePath & "Eiendom.dat"
Open strAnsatteFilePath For Input As #1
Open strByggFilePath For Input As #2
Open strEiendomFilePath For Input As #3
Do Until EOF(1)
Input #1, strAnsatte
Do Until EOF(2)
Input #2, strBygg
Do Until EOF(3)
Input #3, strEiendom
.exe Files And Loading Bar
1st whell, hum, i want to password protect some .exe files, like msn and kazaa and stuff, how can i let VB open them once you've selected the program?:s
2nd i've found this loading bar in the web browser form, i've just added a web browser to my project so i could put that loading bar in a normal form, how can i let this thing do it's loading?
plz give me the code and explain what i have to do in a normal way, in just plain english and not in a programming language that i don't understand...
Loading XML Files In VB6
I've loaded XML files using the code "xd.load (file_name)". However, as I was doing more testing, I found that some xml documents can be loaded successfully while some can't using the same line of code...
can anyone help?
how can i load all the file names that are "*.mp3" from the folder "my documents" into a listbox control?
Loading Pictures From Files
ok, making a program and instead of putting all the images in during design, im putting in blank picture boxes and loading them at runtime in the hope of reducing the file size of the project and the final .exe. can anyone think of a reason not to do this? i just want to be sure before i go ahead
Loading Ocx Files During Install.
Hello. Thank you in advance for any replies given to this post.
My problem is this:
When i install the application I am working on, on another machine i always get prompted about the OCX files already being in use...etc.
I would like the install to complete without prompted the user for such files.
Also, is there a way to track which files a program is utilizing. I receive an .exe error while running the application on other machines. So i assume it is not finding a file.
Thanks again for any replies, it is very much appreciated!
Loading Only Text Files
How do you make it so that when the player opens a Common Dialog box to load a file, only text files show up? Can I set a filetype?
Nuts of Steel
Loading X Files && Animating Them
I'm trying to make a program that will be able to load and animate x files.
I need help ith the code.
Im using directx 9.0c
thanks a lot-
Loading X.files In D3D7 IM
I was wondering if anybody would be able to help me with a problem?
I am trying to find out/work out how to load *.x files into direct3d7. I know it can be done with d3dRM but am unsure how to translate the d3dRM meshes into vertex and faces lists. The reason I am not using dx8 is because I use about 15 DDraw surfaces for my game's GUI and am unsure if you can do what you do in DX7, eg set 1 surface as the render target and use other surfaces as standard DDraw...
Help for either problem would be appreciated
Loading Files Into List Box
ok, this probably comes up all the time but say i have the file "C:/text.txt" with this text inside:
how would i load the text into a list box?
thanks in advance
Dynamically Loading OCX Files
In one of my projects I have a custom OCX file I wrote. The ocx is specified in references in the main vb project.
I want to give the users the ability to disable the ocx completely (this means that the program doesn't check for the ocx at all) by using a command line option.
Is this actually possible to disable a reference to an OCX in code? Or to *not* reference the OCX in Project - References and to dynamically load it instead?
Thanks for the help!
Loading Files To Arrays
what will be the performance issues in loading a binary file data into a multidimentional array. the binary file has 200,000 records. and 10 fields. they differenct data types. will it be fine on win 95/98 machines. and i intend to hold them thru the life of the applocation.
Loading .txt Files Into Arrays
I'm currently writing a program for a school project and i am having trouble with txt files and Arrays. The error occurs when trying to save the array,
my program so far:
Dim find As String 'Search String
Dim listend As Integer 'Used To Insert Names In Correct Position
Dim suppliers(500) As String 'Main Array Of Names
Private Sub cmdAdd_Click()
listend = listend + 1
suppliers(listend) = find
Pic.Print find; " Added To List"
Searchtxt.Text = ""
cmdAdd.Visible = False
Private Sub cmdSearch_Click()
Dim Count, Amount As Integer
Dim Found As Boolean
If Searchtxt.Text = "q" Then
Found = False
For Count = 1 To listend 'Main Search Loop
If suppliers(Count) = find Then
Found = True
Amount = Amount + 1
If Found = True And Amount > 1 Then
Pic.Print find; " Was Found On The Database"; Amount; "times."
Pic.Print "Click Add Name To Add "; find; "To The Database"
cmdAdd.Visible = True
If Found = True And Amount = 1 Then
Pic.Print find; " Was Found On The Database"; Amount; "time"
Pic.Print "Click Add Name To Add "; find; "To The Database."
cmdAdd.Visible = True
If Found = False Then
Pic.Print find; " Was Not Found."
Pic.Print "Click Add Name To Add "; find; "To The Database."
cmdAdd.Visible = True
Private Sub Form_Load()
Init 'Enter Some Names On The List
Myfile = FreeFile
Open "\gs251pfp002pupilsdrm3b64New Foldersuppliers.txt" For Input As Myfile
While Not (EOF(Myfile))
Input #Myfile, suppliers(counter)
counter = counter + 1
cmdSearch.Visible = True
lblSearch.Visible = True
Pic.Visible = True
Searchtxt.Visible = True
Sub Init() 'Filling Array With A few Names
suppliers(1) = "Country Wheat"
suppliers(2) = "Highland"
suppliers(3) = "McNabs Milk"
suppliers(4) = "McFisheries"
suppliers(5) = "Islay"
suppliers(6) = "Highland Oats"
suppliers(7) = "4You2"
suppliers(8) = "Northern Brew"
suppliers(9) = "McFisheries"
suppliers(10) = "Highland Oats"
listend = 10
Private Sub mnuHelp_Click()
Dim Hlp As Long
Prompt = "To Quit Enter 'q' into the Search Box and Click Search"
Title = "Help ?"
Hlp = MsgBox(Prompt, vbInformation, Title)
Private Sub mnuSave_Click()
'User want to close this form, so lets save the data
Dim ff As Integer
Dim counter As Integer
ff = FreeFile 'get the next available file handle
Open App.Path & "suppliers.txt" For Output As #ff
For counter = LBound(suppliers) To listend 'I'm using your listend variable here
Print #ff, suppliers(counter)
Private Sub Searchtxt_Change()
find = Searchtxt.Text
The error stated is "Run Time Error '55' File Is already Open" and it occurs when the code is highlighted in red
Loading Files From The Internet
Hi, my app uses files that are downloaded from the internet. When I try to download a file, then the regular "File Download" box pops up (I'm sure you've seen it) asking whether to open the file with the default application, save the file or cancel the download.
When I select to open the file with the default application, then my app automatically starts and the file is imported with the "Command" function. This works fine. When I download a second file and select to open it with the default app again, then the file is not imported in the same instance of the app, but a new instance of the app is loaded and the file is imported there.
How can I import the second file into the same instance of the app?
Loading / Saving Files...
I have just resolved a problem with loading files in a directory into a list box, and removing the .txt ending.
Now all the files are in the format of:
Now i want it so, when i double click one of the files (Names in a list). It will load the values into
Name ---> Name.caption
Year ---> Year.caption
Form ---> Form.caption
Point1 ---> Point1.caption
Point2 ---> Point2.caption
Pointx ---> Pointx.caption
Then when you press a button, it will save the values currently into the label into the txt file...
Thanks for any help
Loading Large Files
i am using:
status.Caption = "loading file..."
filenum = FreeFile
Open Text1.Text For Binary As #filenum
strtext1 = Input(LOF(1), 1)
to open a file for encryption, but the problem is, if i try and load large files and the computer does not have enough ram to do this then i get a few errors. i was thinking maybe i could split it up and load one chunk then encrypt that chunk and save it and then do the next chunk and save it to the end of the file so when it has done them all the file should be all together but i am not sure how to go about it. i am having trouble because i do not know how to tell visual basic to load, say, the first 10000000 characters of a file. does anyone know how i can do this? thanks.
Loading Files Other Than Text
Hi, I was wondering how I would load files other than text with command dialog. I can load text but don't know how to load anything else. I want to know how I can load music. Thanks.
Saving And Loading Files ...
I want to save (to a dir .. which I know I think ) and then load from there again .. but I only want it saved!!! no like save to.. I want it to only one Dir!
If thats not to hard!
Same gose for loading as well