|
-
Jul 11th, 2000, 08:23 AM
#1
hey,
the weirdest thing happeneed to my program.
i have a program that uses ini files. all was working fine, you click a button, a form appears. you fill in the details and click 'add', then the form closes and a refresh command takes place. the refresh reads the ini file to get the new info and changes the status and captions of other buttons and labels.
and all was working fine.
but today i started my program, and the weirdest thing happend to it.
you click on the button, a form appears. you fill in the details and click 'add' then the referesh takes palce.
but the referesh reads blank values! the ini files is there, filled with info, the referesh search to see if it exists, bingo, its there. check for label captions 'empty'.
chek to see if command button are enabled 'empty'.
but the values are there, and it reads the ini file, and the other they it worked.
what is wrong?
if anyone has an idea, please let me know ASAP!
i was going to upload it today, is this thing doesnt work just on my computer or what?
if you want the code, i can post it here
-
Jul 11th, 2000, 08:53 AM
#2
Hyperactive Member
Posting the code may help so that some of the code gurus can give it a whirl. Also, as far as
"is this thing doesnt work just on my computer or what?"
sometimes that is the problem. Can you test it on another work station?
-
Jul 11th, 2000, 09:01 AM
#3
here is the code
assuming you have form1: command button: 'reload', 'option11' and 'option12', labels: 'label13' and 'label14'.
Private Sub Reload_Click()
inipath$ = App.Path & "\_01test.ini"
If Dir(inipath$, vbNormal) = "" Then
rc% = WritePrivateProfileString("Slot1", "Enabled", "0", inipath$)
rc% = WritePrivateProfileString("Slot1", "Caption", "Slot1", inipath$)
rc% = WritePrivateProfileString("Slot2", "Enabled", "0", inipath$)
rc% = WritePrivateProfileString("Slot2", "Caption", "Slot2", inipath$)
End If
lngResult = GetPrivateProfileString("Slot1", "Enabled", inipath$, strResult, Len(strResult), inipath$)
s1enabled = Trim(strResult)
If s1enabled = 1 Then
Form1.option11.Enabled = True
Else
Form1.option11.Enabled = False
End If
lngResult = GetPrivateProfileString("Slot2", "Enabled", inipath$, strResult, Len(strResult), inipath$)
s2enabled = Trim(strResult)
If s2enabled = 1 Then
Form1.option12.Enabled = True
Else
Form1.option12.Enabled = False
End If
' Read captionss
lngResult = GetPrivateProfileString("Slot1", "Caption", "Slot1", strResult, Len(strResult), inipath$)
Slot1Cap = Trim(strResult)
lngResult = GetPrivateProfileString("Slot2", "Caption", "Slot2", strResult, Len(strResult), inipath$)
Slot2Cap = Trim(strResult)
Form1.label13.Caption = Slot1Cap
Form1.label14.Caption = Slot2Cap
End Sub
this is part of the actual code in the refersh code.
this should have no problem, generatin a new ini file, and then changing the captions and enabled status of the command buttons and label.
on my computer i get no enabled 'empty' and no caption 'empty'.
-
Jul 11th, 2000, 09:35 AM
#4
Hyperactive Member
I don't see any problems just from looking at your code, but I can't run it on my machine since you have some functions declared there. If you want to, you can email me the entire program and I will try to run it.
Also, have you tried using breakpoints with Debug.Print to locate the problem? At the very minimum, you should be able to identify where the problem is occuring.
-
Jul 11th, 2000, 10:07 AM
#5
Hyperactive Member
Weird
Weird stuff like that has happened to me before to....For example with my current project. My cpu has win98, and im using vb3.0..... it works fine on my system but for some reason it doesnt on the 95 system at work......Its a dir problem just like uras as well. Also for some reason i cant center my text boxes, only my captions...weird huh?
-RaY
VB .Net 2010 (Ultimate)
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
|