 |
|  |
 |
|  |
 |
|  |
 |
|
Gramphos
|
|
ACS Civ III Files Manager, Prince of Development
|
 |
Chalmers, Sweden
Apr 2001 time: 06:15
|
|
quote: Originally posted by Grim Leaper
The error is very odd, i don't recall have any problems with vb programs before. as i have said i have vb5.0 learning edition installed on my computer, and i believe i have the correct files.
Here's what happens:
i unzip the file into a directory. there is just your exe there. then i run the exe and before anything happens (no forms/window and program doesn't appear on the takbar) i get a warning message box, with caption 'Error' and text 'Unexpected Error', with an OK button. That is all. I click OK and the program quits.
I think it is to do with vb or windows (ME) and not you program, because the program does not appear to actually start. Where can i get the service packs from, MS site? i guess that might be the problem. |
What are your sys-spec? Try the latest version (has a splash screen that shows up before any program error can be generated)
quote: How about you post the source code, i'd be very interested into how you did it |
I maybe will do that later, when I get some more structure to my functions, right now some things are in functions and other stuff direct in the form code. Also 50% of the comments are Swedish. I'll not give away such code.
|
|
|  |
 |
|  |
 |
|
Gramphos
|
|
ACS Civ III Files Manager, Prince of Development
|
 |
Chalmers, Sweden
Apr 2001 time: 06:15
|
|
quote: Originally posted by Grim Leaper
I have a 700/750 PC with 128 ram running windows ME |
The only thing I'm uncertain of is Windows ME, can any ME user use this tool?
quote: and VB5.0 Learning Edition (i presume sp1 as i haven't updated it). vb appears to work fine. i have Comdlg32.ocx version 5.something so that might be the problem, altough i would have expected a better error mesage if that was the case. If you know where i can get the service pack from i will try downloading it tonight. |
It is really big, I got it somewhere at Microsoft.com, but the Comdlg32.ocx version has another history.
I got it with VB6 working module, and it replaced the version 5.? that came with the servicepack. Other controls got new names, but that replaced the earlier version, and I had to stick with a vb6 file. (I have uninstalled the Working Module now, as I don't use it.)
quote: I would love to see the code you've written, as i enjoy programming but am not to good at it. |
I'll see if I can release some code later, but not yet. I have to make it a bit more finished before. (I change some load code with each version to make it easier to follow the code, and prepare for later versions)
quote:
I don't mind too much, i'm danish my self, and need some improvement on it. |
Ah, I didn't know that.
The right DLL-files can be obtained at http://support.microsoft.com/suppor...s/Q180/0/71.ASP
I'll look for the controls. If I can't find them I'll make a 2 MB (approx.) setup that includes everything.
|
|
|  |
 |
|  |
 |
|
Gramphos
|
|
ACS Civ III Files Manager, Prince of Development
|
 |
Chalmers, Sweden
Apr 2001 time: 06:15
|
|
quote: Originally posted by Grim Leaper
out of interest approx how much code is in there? i imagine most of it is for reading and saving the .bic file in the right order. |
The file that handles PCX read/write is 220 lines (approx.) (I have counted it down some for comment lines).
The file that READS the BIC, read and write SAVs and reads/writes all full structures (the one I read more then the name from (BLDG, PRTO, RACE and RULE as the moment (I'm writing functions for all, but I can't make it all at the same time.))) and contains functions, constants, types and global variables is 1400 lines (including comments (all full sections layout (I think I shall remove them later, but as long at I change things I have them there))) The function that reads the BIC (not including the called functions in that file is 210 lines (and shrinking ))
Still most of the code is unused, I don't need to store every data as the exact values, I could store them without decoding them, but I write the decoding as I might want to use it later, without having to rewrite everything.
The Copy Form itself has 1400 lines of code as well, and that includes all the copy code, except the one that uses the write functions (only BLDG right now IIRC, but I plan to make PRTO and RACE as well, as it would mean less code, and a more structured code.) (It actually has code for writing BICs in four places (I will write a more common function later)) I will also write functions for the text-file modifying as soon as I know for sure what variables I need to pass to it.
The Export Tool stays at 150 lines, mostly because it uses the write functions for the parts of the BIC. The Import Form has 400 lines code. Finally the SaveEdit has 120 lines (All save are made in the mainfunction. The code only handles the variable updates and the interface)
(I call both subs and functions for functions)
About Reading the BIC in the right order that isn't very mush of the code, the most is reading and writing all the sections in the right way.
For BICs you could use
code:
Dim buffer As String, version As Long, Length As Long, FileID as Integer
FileID = FreeFile
Open BICfile for Binary as FileID
buffer = String(8, 0)
Get FileID, , buffer
If buffer <> "BIC VER#" Then MsgBox "The file is invalid": Exit Sub
Get FileId, , Version
If Version <> 1 Then MsgBox "Unknown Version": Exit Sub
Get FileId, , Length
'Use Get instead of Seek, it is faster
buffer = String(Length, 0)
Get FileId, , buffer
Do Until EOF(FileId)
buffer = String(4, 0)
Get FileId, , buffer
If EOF(FileID) Then Exit Do
Get FileId, , num 'The number of the type in buffer (Except for CULT)
Select Case buffer
Case "BLDG", "CTZN", "DIFF", "ERAS", "ESPN", "EXPR", "GOOD", _
"GOVT", "RACE", "RULE", "CONT", "TILE", "WMAP", "WCHR", _
"WSIZ", "TERR", "TFRM", "TECH", "PRTO"
For i = 1 To num
Get FileId, , Length
buffer = String(Length, 0)
Get FileId, , buffer
Next i
Case "CULT"
Seek FileId, Seek(FileId) + &H4
Get FileId, , num
Seek FileId, Seek(FileId) + num * &H5C
Case Else
MsgBox "Unknown section"
Ext Sub
End Select
Loop
Close FileID
That code would be able to read a BIC (without getting any info from it)
Last edited by Gramphos on 23-11-2001 at 01:56
|
|
|  |
 |
|
Grim Leaper
|
 |
england
May 2001 time: 05:15
|
|
Phew, i am free. Thankyou Gramphos. I couldn't have done it without you.
Haven't had a try to see what your program can achieve, i'll do that tomorrow, but at least it works 
When you mentioned a splash screen, i was picturing a kinda professional one, and wondered for a while why all programmers seem to be able to make all their art so well, but i, alas, cannot. You pleasantly suprised me, in a good way. This is what programming should be about. Short, Sweet, and Simple 
And now to bed. Cheerio (and thankyou)
|
|
|  |
 |
|
Gramphos
|
|
ACS Civ III Files Manager, Prince of Development
|
 |
Chalmers, Sweden
Apr 2001 time: 06:15
|
|
quote: Originally posted by Grim Leaper
When you mentioned a splash screen, i was picturing a kinda professional one, and wondered for a while why all programmers seem to be able to make all their art so well, but i, alas, cannot. You pleasantly suprised me, in a good way. This is what programming should be about. Short, Sweet, and Simple  |
I'm not an artist, I only added that screen because the loading time was long enough for people start telling me that the tool hung up while loading and never showed up. (I don't even have an icon)
quote: And now to bed. Cheerio (and thankyou) |
You are right. 
|
|
|  |
All times are GMT. The time now is 05:15. Apolyton Time is 00:15. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|