HELP Program Crashing!!!!!!!!!
Hi Everyone,
I must be about the dumbest programmer out there, with all the question that I put up here.
In the program that I'm working on I have a drive box(drive1)and a direcotry box (dir1). When the program is compiled and installed on a Windows 95 or 98 box, if the user clicks on either drive1 or dir1 the program crashes. I have a Windows NT machine and the program works fine on it, it was also tested on another NT box and works fine on it. Any suggestions as to why it is crashing until 95 or 98?? The error number is either 52 or 32 sorry I can not remember for sure which one.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Program Crashing
Howdy folks
I have, hopefully a quick question
I am working with Paolo Giacomuzzi's AppBar application. I have seen it floating around here and at Planet Source Code. Everthing is working so far; but for 1 annoying issue. Whenever I end the app, VB6 itself crashes. I have tried a few different things, including using the terrible "End" keyword.
I have had to resort to making a 'Loader' form that loads the AppBar. When I now close the appbar, VB does not crash, and I can close the loader form.
I have only encountered this in one other control a Tab app that I no longer use. I do remember though that there was a debug mode I could use that would resolve this; or am I barking up the wrong tree.
Anyone else encounter such a problem?
Program Crashing
Hello,
I have a complicated program that crashes. It has error trapping in every routine with an "End" statement to stop execution without an error dialog.
Problem is I still get that error dialog in about 1 of 3 crashes... What could be happening?
Program CRASHING.
The program I made randomly crashes... (once or twice a day)
Ive tried running the program from VB6 but it crashes VB6 along with it!
Is there any way to log errors like this? Its extremely frustrating.
Thanks
Program Keeps Crashing
VB Code:
lngSearch = FindFirstFile(m_strSystemRoot & "*", udtFindFile) If lngSearch <> INVALID_HANDLE_VALUE Then Do strFileName = StrConv(udtFindFile.barFileName, vbUnicode) strFileName = Left$(strFileName, InStr(strFileName, vbNullChar) - 1) DebugLog "strFileName: " & strFileName If strFileName <> "." And strFileName <> ".." And (udtFindFile.lngFileAttributes And FILE_ATTRIBUTE_DIRECTORY) Then strFolders = strFolders & "|" & strFileName End If Loop While FindNextFile(lngSearch, udtFindFile) FindClose lngSearch strFolders = Mid$(strFolders, 2) Else DebugLog "Form1.Form_Load().FindFirstFile(" & m_strSystemRoot & ") failed: GetLastError=" & GetLastError End If
Something here keeps crashing my program!
Program Keeps Crashing
Hey, i had my code and it worked fine. A minute ago, i added:
VB Code:
RS.MoveFirstdo while not RS.EOFIf txtcarreg.text = RS.Fields("Car_Registration") thenmsgbox "Car already entered"exit subend ifloop
When it gets to this loop it just freezes and i have to close VB
Any ideas please??
Thanks, BIOSTALL
Program Crashing
ok here is my code
VB Code:
For i = 1 To fileLength sPrevious = s s = Mid(txtBox.Text, i, 1) If s = Chr(13) Or s = Chr(10) Then If sPrevious = Chr(13) And s = Chr(10) Then txtBox2.Text = txtBox2.Text + Chr(10) End If Else txtBox2.Text = txtBox2.Text & s End IfNext
the program runs great till it gets to this point. this part of the program is converting the text in txtbox back to an emacs file. and it reads every character. it even runs normal on normal size files but when you get large or medium sized files in there and try to save then it crashing while trying to convert. i have put up msgbox all over the place in my code and i have narrowed it down to this little piece of code. could someone please help me if you need more info jst let me know. thanks.
Program Keeps Crashing.. Getting Desperate
Has anyone here had any experience with VB6 class modules being destroyed while an application is running, for no apparent reason? Like as if some other process of the application is overwriting the memory held by an object? I have a program that has a bunch of class modules defined it it, a half-dozen forms, and a couple of code modules.... nothing very complex. But for some reason, during the course of execution one of my classes is getting trounced in memory by something else. Methods start returning jibberish, or nothing at all, and most often it ends up crashing the application.
I don't know to how to explain the problem any better than how I just did. i have been spending the last 4 days trying to debug this problem but I haven't gotten any where with it. Its driving me bonkers because I can't reproduce the erorr at will -- it's sporadic. In a few subroutines of the application I have Debug.Print lines that print the runtime values of the class in question. The values are displayed as expected during execution, but eventually they start to display either nothing or jibberish and/or crash the app, leading me to despair (and that possibly lead to me going postal on a co-worker).
The only thing else I could add is the that the class that is wiped out is not wiped completely because the Class_Terminate doesn't execute.
Sounds futile, I know. I don't expect anyone will be able to help but I am grasping here.
Thanks
codeMnky
Loops Crashing Program
Hey Guys,
I'm trying to write code for an app that will cause it to pause or wait until a zip file is created with pkzip using the shell command. right now I am using a loop but it causes my app to bomb. Is there any way for vb6 to determine if a shell command has completed executing and wait until it has?
Crashing My Program Through Code...
I have produced a module that is to be added into most of our projects here it work, it mainly monitors usage, who is running what etc etc.
In this I am using the settimer api to run a few commands every so often.
This all works well, but if the program crashes, the timer is left running... I have added code into it so it will make sure the program that it started in, is still running... I cannot do this within vb so I cannot just click the stop button (though that would most of the time just close VB straight out)... So I need to compile it... but im having problem crashing my test program to see if the timer closes itself...
how can I crash my program?
I have tried closing its process with no luck... ideas? a few various ways would be handy.
Loop Crashing Program
Hey Guys,
I'm trying to write code for an app that will cause it to pause
or wait until a zip file is created with pkzip using the shell
command. right now I am using a loop but it causes my app to
bomb. Is there any way for vb6 to determine if a shell command
has completed executing and wait until it has?
My Array Is Crashing The Program When Altered.
Whenever I call UBound or alter the pic array, the program crashes. I tracked the problem down to this function and array by commenting various things out of the code to see what did and did not crash the program. I think that UBound might be crashing simply because it takes in the pic array as an argument, but I'm just learning this stuff so I can't be sure. If I had to guess, I would say that the "CopyMemory ByVal VarPtrArray(pic), sa, 4" line is not copying the memory correctly so that the pic array is empty (which would mean I'm trying to access elements of the array which do not exist). I'm looking for help solving this problem and/or a way to test my array to see how large it is (that would help me to test my empty array hypothesis).
Any useful help is appreciated.
---
Here is my section with declared variables and functions and types:
Option Explicit
Private Type SAFEARRAYBOUND
cElements As Long
lLbound As Long
End Type
Private Type SAFEARRAY2D
cDims As Integer
fFeatures As Integer
cbElements As Long
cLocks As Long
pvData As Long
Bounds(0 To 1) As SAFEARRAYBOUND
End Type
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Declare Function VarPtrArray Lib "msvbvm50.dll" Alias "VarPtr" (Ptr() As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Private Declare Function GetObjectAPI Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Dim pic() As Byte
Dim sa As SAFEARRAY2D
Dim bmp As BITMAP
Dim i As Integer
Dim j As Integer
Dim r As Long, g As Long, b As Long
---
And here is my only event, triggered by the button on my form. It is supposed to invert the picture.
Private Sub btbInvert_Click()
GetObjectAPI Picture1.Picture, Len(bmp), bmp
With sa
.cbElements = 1
.cDims = 2
.Bounds(0).lLbound = 0
.Bounds(0).cElements = bmp.bmHeight
.Bounds(1).lLbound = 0
.Bounds(1).cElements = bmp.bmWidthBytes
.pvData = bmp.bmBits
End With
CopyMemory ByVal VarPtrArray(pic), sa, 4
For i = 0 To UBound(pic, 1)
For j = 0 To UBound(pic, 2)
pic(i, j) = 255 - pic(i, j)
Next j
Next i
CopyMemory ByVal VarPtrArray(pic), 0&, 4
Picture1.Refresh
End Sub
---
Again, thanks for any help you might give.
{Winsock Crashing Program} Why Does This Happen
when i connect to winsock, recieve data then close the program Visual Basics crashes, but if i dnt recieve any data this doesn't happen.
Code:
Private Sub cmdStrt_Click()
For i = 0 To 15
lstID.Selected(i) = True
CurID = lstID.Text
ws(i).Close
ws(i).Connect "profiles.yahoo.com", "80"
Call MoveDown(lstID)
Do Until ws(i).State = sckConnected
DoEvents
Loop
Next i
End Sub
Private Sub ws_Connect(Index As Integer)
iData.Text = ""
strURL = "http://profiles.yahoo.com/" & CurID
strMsg = "GET " + strURL + " HTTP/1.0" + vbCrLf
strMsg = strMsg + "Accept: */*" + vbCrLf
strMsg = strMsg + "Accept: text/html" + vbCrLf
strMsg = strMsg + vbCrLf
ws(Index).SendData strMsg
DoEvents
End Sub
Private Sub ws_DataArrival(Index As Integer, ByVal bytesTotal As Long)
ws(Index).GetData rData
DoEvents
iData.Text = iData.Text & rData
End Sub
Private Sub imgXdwn_Click()
X = 0
Do Until X = 16
ws(X).Close
X = X + 1
Loop
End
End Sub
Thats all the code i have that includes anything to do with winsock.....can anyone spot anything wrong?
Why Does This Program Keep Crashing? Its Makes Vb Go Crazy
the attached program keeps making my actual visualbasic program go crazy like black squares apear over the tool bar, and when im running my program i have numbers moving over the me.caption and they dont refresh, the just overlap
it all started when i added create brush,select object etc coomands to my loop
heres the program.....
Please Help With This Code. My Program Is Crashing When Unloading
I'm using a class module (in the zip file) called ctooltip.cls
I have no other declarations, other than this function and the code inside the class module. My program terminates fine when the function below doesn't get called, but when I start the program with a commandline parameter the program crashes on termination every time. I figure that something isn't getting destroyed or set to = nothing etc...
Any help would be greatly appreciated.
VB Code:
Private Function AnalyzeCommandLineParameters(cmd As String) As Boolean '====================================================== ' Analyzes the CommandLine Parameters '====================================================== On Error GoTo ERR With New CommandLineHelper .CommandString = cmd If .HasParameter("-P") Then '// Do stuff here End If End With Exit FunctionERR: MsgBox "Error In AnalyzeCommandLineParameters!" & vbCrLf & vbCrLf & ERR.Description, 64, App.TitleEnd Function
Established Program Crashing - Resolved
We have been running a VB prgram for 4 years with no problems. Another program has been installed on the machine and the VB prgram crashes with an automation error stating "The object invoked has been disconnected fro its clients".
I have checked the dll's installed with the new program and it does install older versions but in its own directory and not in Windows/system. Could this be the problem?
I have been looking at this problem for a while now so any help would be gratefully apprieciated.
Program Crashing Sql Server 2000 [*Not Resolved *]
I have an application, which runs in the same system where the sql server 2000 is installed. When the sql server installed at first time it is working fine. But when i install my server applications, with the help of INNO setup, and when i run it the sql server is crashing... plz help in this, as my client wants the solution immediately...
** RESOLVED ** Program Crashing When Closing Wih Win2000 ?!!
Morning All.
I have a bizarre problem.
I am now the proud owner of a shiny new PC, which is nice !
Unfortunately, I am experiencing a few 'weird' things now that I have moved up to Windows 2000 Professional.
My app, which under Windows 98 worked fine, now crashes when I click a toolbar button to close it.
The code behind the button is "Unload Me", and then it performs the code below for the unload of the MDI master form.
Even more bizarrly, if I step thru in debug mode it doesn't crash, only when I run it normally !!!!
This happens EVERY time as well.
Can anyone give me an idea why this might be ?
Thanks.
Steve.
VB Code:
Private Sub MDIForm_Unload(Cancel As Integer) Screen.MousePointer = vbHourglass #If live = 1 Then RecordTimeOff #End If HtmlHelp Me.hwnd, "", HH_CLOSE_ALL, "" Screen.MousePointer = vbNormal ' Set all connection variables to nothing here to close down cleanly Set conndll = Nothing Set conn = Nothing EndEnd Sub
Listbox + Loading Text File Over 500kb Into It = Program Crashing
I have a listbox in my program, and on program load a text file is loaded into the listbox. The problem, is that if the text file is over 500kb (approx.) then my program crashes. This is the code I am using
----------------------------------------------------------
File = text1.text
Open App.Path & "/list.txt" For Input As 1
Do Until EOF(1)
Line Input #1, File
List1.AddItem File
DoEvents
Loop
Close 1
-----------------------------------------------------------
Can anybody tell me why it crashes if the windows text file is over 500kb?
Exe Crashing But Debug Mode Not Crashing
Hi,
I have a situation where I use Excel reports in Visual Basic on a SQL Server database. I have about 20 reports. When I run the exe of the application and I go into five of the excel reports the VB applcation is closing down automatically, although the excel report opens alright.
When I go into the same reports through the code in Debug mode, the application does not close down and everything is alright.
Can anyone help me understand what are the reasons that could possibly cause this.
Thanks in advance
ourspt
App Crashing
i have a button that prints a specific recordset when pressed, butwhen i click it my app crashes any ideas
Vb Crashing
ok well this is a new thread about the same problem in another thread:
http://www.xtremevbtalk.com/showthread.php?t=157975
nobody seemed to follow the link in that thread and im guessing its because they don't feel like reading the whole thread and simply miss the link so im putting it into this much shorter thread.
vb6 crashes whenever my program runs a D3DXMeshVertexBuffer8SetData call. Nobody seems to know why, other ppl have tried it and their vb crashes as well, so im assuming it is dxwww.websoftproductions.com/game.zip
ok well figured some stuff out. the program crashes if i try to interpolate to mesh 2, 3, 4, 5. 2 and 3 are made from 2 x files, but one x was exported as a shifted version of the other (left arm is right arm x, but exported after it had been moved to the left a few units)
4 and 5 are the legs, which i was lazy and so i just used copies of the arms with different textures.
so it seems the problem may be with setting data to objects with the same number of vertices.
also, it seems that in mesh 0, the vertices are just appended to the existing x, the head remains but is oddly connected to the arm, and they both share a texture. the body tho (mesh(1)) does not appear to remain.
the vert counts are 16 for the body, 538 for the head, and each arm and leg is made up of 2 boxes which each have 8, making the x contain 16.
so the problems that could be causing this crash are:
the same vertex count (unlikely tho)
the fact that setdata seems like it's appending, not replacing vertices
so i think somehow i have to clear the existing object's vertex buffer before i to the setdata call thingy. i have no clue how to tho.
also i tried and cant set the data to an empty mesh, it has to have loaded something in order to be initialized properly.
hasnt ne1 else done keyframe interpolation and encountered this kind of problem with the vertex buffer?
somebody plz help if u can.
OLE Crashing
I have the following code which is part of a VB application to replace text in a word document using ole and the word object model. It is crashing at the '.ClearFormatting' line as if the 'Find' method was returning a null. (The a_.. variables are arguments of the sub this code is in and m_WordApp is a reference to a Word.Application object)
Dim l_Range As Word.Range
Set l_Range = m_WordApp.ActiveDocument.Content
With l_Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.MatchWholeWord = True
.MatchCase = True
.Text = a_TextToReplace
.Format = True
.Replacement.Text = a_ReplacementText
.Replacement.Font.Bold = a_Bold
.Replacement.Font.Italic = a_Italic
If a_UnderlineSingle Then
.Replacement.Font.Underline = wdUnderlineSingle
End If
If a_UnderlineThick Then
.Replacement.Font.Underline = wdUnderlineThick
End If
.Execute Replace:=wdReplaceAll
End With
If I put the code into a word document (so not using ole) it works fine but if I take it out of the VB app and put it into an excel ss it crashes like the vb app so I think it is a problem with ole.
Also I get the following message when it crashes (if I say I want to debug the crash):
"Unhandled exception in Excel.exe(OLEAUT32.dll)..."
The os is Win 2000 and this code worked in Win 98.
Any suggesions would be welcome.
Thanks
IE Crashing
it seems like all the time when i come here it crashes my internet explorer. does anyone know what may be causing this?
VB6 Keeps Crashing
Whilst navigating through my screens (Frames) in VB6, whilst running in code, on several occasions VB6 just crashes, bringing up Doctor watson/or VB Debugger and chucks me out of the application completely.
Has anyone else had this before? Any advice?
Thanks
VB Crashing??
Okay, I just re-installed vb6 on my computer. Whenever i click the .visible property on the properties bar, it crashes. I have no idea whats wrong, I have no add-ons in my IDE, and barely any programs on my computer except McCaffe & Trillian.
Any ideas/fixes?
VB IDE Crashing
My project has 20 forms and accesses ACCESS using ADO objects and methods. The IDE has started to crash frequently. I'm using VB6, SP6 Professional Edition.
Does anyone know how to solve this, or do I have to find it my trial and error?
Tom
VB6(SP6) IDE Crashing
I've got a complex program that I have inherited. My first shot at adding a new module to it has come to a screeching halt.
It is using quite a few UserControls (well the same control over and over). While in design mode it will allow me to debug only once. Once I exit the program it crashes the IDE. Giving this error:
--------------------------
VB6.EXE - Application Error
--------------------------
The instruction at "0x77f69d63" referenced memory at "0x43000000". The memory could not be "written".
Click on OK to terminate the program
This only seems to be happening on this project, however this project is considerably larger than any other project. And, it is the only one that uses the UserControls.
PLEASE HELP!!!
VB Is Crashing
When ever I try to load a form with a control on it, it crashes. Now I can view the code and open the project, also its not any control I can view lines and shapes but thats about it. When ever I put a button on the form and save it next time I open the form and look at it, it crashes. I've tryed reinstalling vb but that does not work. Anyone got any ideas??? I really dont want to have to reformat my hard drive. Thanks.
My VB Is Crashing !
I'm working on a very big application (~7000 lines).
When I forget to declare a variable, and while the program is running, the vb environment stops the program (as it should) and tells me that at that particular line a variable is not declared. So I end the program execution to correct my mistake (declare the variable) and the whole VB will crash! it does that every time I need to end the program execution... it does not matter at what line I end the program (through the VB environment) it's always crashing...
Does anyone know how to fix this ?
VB Crashing
I have created a program and when I try to run it vb crashes. I windows xp error pops up and says that vb must exit. It isnt the computer locally becuase I tried it on like 6 PC's and they all crash. But when I select frmmain from the box on the right I dont get the error. So I open vb and before I can run the app I select the main form. Basically when I compile it crashes the main form does not even appear. Why does it crash...Has anyone had similar problems to mine?
Crashing Help!!!
The below code (C++) causes my VB code to crash with the ' The memory could not be "read" ' error.
BSTR WINAPI FormatID(HWND hWnd, LPCSTR sLine)
{
char *tmp = new char[strlen(sLine)];
int n;
n = <to be calculated>;
strcpy(tmp, sLine);
return BSTR(tmp[n]);
}
What I am trying to do is get the n'th character from sLine.
Any ideas, thanks in advanced.
VB Keeps Crashing!!!
I really doubt there is a solution to this but I'll ask just in case.
Is there a way to keep VB from crashing in the following scenarios?
1. I'm using the API SetParent. When the main form is unloaded it detaches the child form that was previously created. But, if there is an error on the child form and I have to stop the program from the VB interface, the unload code is never executed. This causes VB to crash since the child form wasn't properly detached.
2. I'm using a data environment designer. Some databound controls cause VB to crash depending on the location of the cursor and the cursor type of some record sets.
I am using VB 6 with service pack 5.
VB5 Crashing
Can Do...Loops crash VB5 if I have one of them inside of another, like this:
VB Code:
If IsNumeric(Text1.Text) = False Then MsgBox "Error"Else Open Text2.Text For Output As #1 x = Text1.Text inttemp = x y = x - 1 Do Until (y = 1) Or (y = 0) Do Until (x = 1) Or (x = 0) strtemp = strtemp & ((x) & " v " & (y)) & vbCrLf x = y - 1 Loop Print #1, strtemp strtemp = "" y = y - 1 LoopEnd If
(Text1 = An integer value of the number of teams)
(Text2 = Where to output the list of fixtures to)
VB 5 Keeps Crashing On Me!
Hello. I'm using vb5 professional edition and whenever my program terminates, the entire vb design environment terminates with it! No errors are being generated within my program. It's is accessing a DLL. Here is the code:
Option Explicit
Dim session As Object
Private Sub cmdLogon_Click()
On Error GoTo logon_error
If txtServer.Text = "" Or txtUser.Text = "" Or txtPass.Text = "" Then
MsgBox "Please input server, user and password."
Else
session.CTLogon txtServer.Text, txtUser.Text, txtPass.Text
End If
Exit Sub
logon_error:
MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
Err.Clear
Exit Sub
End Sub
Private Sub Form_Load()
Set session = CreateObject("CTI.Session.1")
End Sub
Private Sub form_terminate()
Set session = Nothing
End Sub
Crashing VB6
Hi all,
As the subject says, serious troubles over here. I hope some of you can help
me out. I am using VB6, CR9, ADO 2.8 and SQL Server 2000.
I have an ActiveX DLL (VB6) which has a method that returns a Crystal
Reports Report (CRAXDRT.Report). This main report consists of several
Subreportobjects. In this method, I open the recordsets and bind them each
subreport. Because the recordsets need to stay open, I put each recordset
object in a Collection.
Besides that, I have a normal VB6 project which contains a form with a
ReportViewer control on it. This application reffers to the ActiveX DLL and
uses it to generate the report which is binded to the CRViewer. The
generation works fine and the report is shown on the screen. But when I try
to close the application VB6 crashes and I get an Acces Violation at
0x00000004. Also when the application is compiled, it crashes the same way.
However when I run in full debug mode (including the DLL in debug mode),
everthing works fine, even closing the application without problems.
Has anyone experienced this problem or do you have suggestions? If
necessary, I post my code in this thread, just ask for it.
Best regards,
Gerry
Crashing
Hi, i've got a form with a few text boxes, adodc sources and a data combo box. it was all doing what it was supposed to and i had run the form a few times with no problem. i then came back to the form later and tried to run the project but it froze my computer (the loading symbol on the pointer came up) and nothing happened for a few minutes until a message saying that there was not enough virtual memory on the system and how the paging was going to be increased or something?
my other forms on my project run fine but as soon as i click the button to open this form the computer freezes then crashes. i can't even view the form in design view without it crashing. there is no code on the form_load command and no coding other than to show the form on the button to open the form. i've tried running the form on 3 different computers, all having the same result.
any ideas?
paul k
VB 6 Keeps Crashing...
I'm working on an OCX with VB 6.0 and it seems like on occasion I'll get done running the program I'm working on and then it'll go back to the coding screen. But the arrow keys won't move the cursor and the tab key doesn't work. Then when I go to run the code again VB just crashes. I'm not in the habit of saving every time I make a change (which is admittedly my fault) but I also don't feel like the program should be consistently crashing. Anybody else experience this and/or have a fix for it? I have SP 5 installed...
Crashing The VB Exe
Hi all,
I am working on the development of ActiveX Control using vc++. When I am adding that Ocx which is in vc++ in the vb6.0 its working with the design time, but when I m creating the exe of the vb application and trying to run that it gets crash. I added some event in my ocx like when the paper is over in the printer it should show the msg, but on the mean time It gets crash. otherwise it working fine with other functions.
Can any one help me . its urgent.
thanks in advance.
Abhishek
VB Crashing
hello, i was attempting to Karl Moore's "Getting the Internet Time" from http://www.developer.com/net/vb/art...10926_1539941_1
it runs fine, but when i goto close the form or if choose end from the toolbar, VB just freezes up. Is this a problem with the Winsock control? anyone else ever experience this? i have had it happen to me on 2 separate machines both running windows xp pro and vb 6.
IDE Crashing After SP5 Install
Hi all,
I'm having a really strange problem. I was working with VB6 fine for a couple of years, never installing any Service Pack (no broadband, it took forever to download). Anyway, I finally got a hold of the latest Service Pack (SP5) and installed it. It works fine, until I start working with Data Environments and Data Reports. Actually, the reports work fine, but every time I try to use the Data Environment, the Visual Basic IDE crashes without any error message, only the Windows XP message box saying the the program has a problem and needs to close. Also, when I'm working with a program that has a Data Environment, whenever I shut down the VB IDE, it closes fine, except the same message ("Visual Basic has encountered a problem and needs to close"). I've tried re-installing the entire Visual Studio suite, but it still has the same problem. Has this happened to anyone before? Any solution would be really appreciated!
(Sorry for the long post!)
Control Crashing
I have an application with several custom controls in it. In general, these controls are working fine and I don't have any problems with them – except for one.
Whenever I add or delete a control, any control, form a form that has one or more of my custom controls on it, all of my custom controls will crash. I.e. they get hatch marks through them and they become non-operative – until I close and re-open the form. After that, they work fine again until I change something else on the form.
Question #1: why would adding another control, such as a command button, to a form have any effect at all on my custom controls, much less cause them to crash?
To try to find the problem, I've riddled my custom controls with Breakpoints and OnError statements to try to find where the problem occurs. But the control is apparently crashing before execution within my control code even starts.
Question #2: how can I debug a problem that seems to be happening outside of my code?
Has anyone had this problem or know what is going on that might be able to give me a hand? Thanks.
Random Crashing DX8
Ohh kay I'm converting a project from directx7 to directx8 and have so far had not too many troubles changing my sprite class from dx7 to dx8 but now, as soon as I add some more information to the program, to cater for meshes,etc I'm getting crash of death errors.
The zip file for this project is 8Mb so I'm not sure exactly what to post... All I get is a Visual basic has encountered a critical error and must close.
Strange thing is, sometimes it loads all the textures perfectly but thats once every 25 odd loads....
My Code Keeps Crashing
Hi.
I'm trying to make a game engine. Its been tough so far. Now my code is crashing, and sending VB with it (it crashes VB as well!)
Can someone help?
It is supposed to display a picture of my wedding as a background (sprite), and a picture of my wifes face (other sprite). It used to do this, then I upgraded it and now I'm lost! I believe that the loadbackground function is causing it as I have tried breakpoints, and it seems to occur around the sprites->drawthe****edthing function. It works fine if you dont display the background (ie rem out loadbackground and drawprimitiveup functions within the draw3d function), but otherwise it crashes.
In order to use the program, open the the nlgSpriteDescrFile.txt, and change the paths in the tilde-separated file so that they read the location of where you unzip to.
Please help
Regards.
VBA Crashing My Template
I have a Word template in which I have placed some VBA code. When executed, the template does create a new document -- as it should. However, Word crashes before any of the code is run (I have a msgbox command as the first line in the Document_New & Document_Open routines which never appears). Instead I just get the "Microsoft Word has encounted a problem and needs to close." message. It seemed to have worked fine until I added an InputBox in the code (which is supposed to run right after the Msgbox command).
Any ideas??
Thanks in advance.
Excel Crashing...
Hello All,
I've already checked out all of the threads with "excel" and "crash" in them and can not find the solution to my problem. I believe it may have something to with the way my code is set up...
The program takes excel files with zip code information and creates maps via ms mappoint...Excel crashes when Excel.Quit is called...
Here's some code to help illustrate te way I have this set up...
Code:
Private Function FirstFunction(fso As FileSystemObject, UserMapFolder As String)
.
.
.
' create instance of Excel
Dim Excel As New Excel.Application
Set Excel = CreateObject("Excel.Application")
' create instance of MapPoint
Dim MapPoint As New MapPoint.Application
Set MapPoint = CreateObject("MapPoint.Application")
For MapCount = 0 To lstLocationsList.ListCount - 1
If lstLocationsList.Selected(MapCount) Then
NeedCount = NeedCount + 1
If chkCancel.Value = 0 Then
MakeMap lstLocationsList.List(MapCount), UserMapFolder, Excel, MapPoint
pbarProgress.Value = (NeedCount / lstLocationsList.SelCount) * 100
sngProgress = Round(pbarProgress.Value, 2)
lblProgress.Caption = sngProgress & "% (" & NeedCount & " of " & lstLocationsList.SelCount & " complete)"
DoEvents
Else
Exit Sub
End If
End If
Next
' Quit Mappoint
MapPoint.Quit
Set MapPoint = Nothing
' Quit Excel
Excel.Quit
Set Excel = Nothing
.
.
.
end function
Private Function MakeMaps(strLocation As String, UserMapFolder As String, Excel As Excel.Application, MapPoint As MapPoint.Application)
.
.
.
' code to open spreadsheet and check for valid data
' code to create map with mappoint
.
.
.
' Destroy MapPoint Objects
Set WebPage = Nothing
Set DataSet = Nothing
Set DataSets = Nothing
Set ActiveMap = Nothing
'Destroy Excel Objects
WorkBook.Close
WorkBooks.Close
Set WorkSheet = Nothing
Set WorkBook = Nothing
Set WorkBooks = Nothing
Those are all of the objects created in the MakeMaps function...did I miss something somewhere?
Any help would be greatly appreciated!
Excel Crashing
I'm working on an application that outputs data into an Excel spreadsheet template. It works fine on my development machine, but when run on other computers (client desktop and my test machine), it crashes as soon as I try to export.
I made a sample application to replicate the problem in its simplest form, and narrowed the problem down to opening the template file. If I write data to a new Excel sheet, it works perfectly. When I try to load the template and write to that instead, it crashes.
The follwing is the code that crashes:
Private Sub Command1_Click()
Dim xlapp As Excel.Application
Dim wbxl As Excel.Workbook
Dim wsxl As Excel.Worksheet
Dim introw As Integer 'counter
Dim intcol As Integer 'counter
Set xlapp = CreateObject("Excel.Application")
xlapp.Visible = True
xlapp.WindowState = xlMaximized
Set wbxl = xlapp.Workbooks.Open("D:ExcelQuoteTemplate.xls")
Set wsxl = xlapp.ActiveSheet
For introw = 1 To 4
For intcol = 1 To 4
wsxl.Cells(introw, intcol).Value = "X"
Next
Next
End Sub
Changing the workbooks.open line to :
Set wbxl = xlapp.Workbooks.Add
makes it work fine in all tests, but with a blank spreadsheet.
All computers, whether development or test, are Windows 98. The development machine is using Excel 2002, while the 2 test machines getting the error are both Excel 2000. I am referencing the Microsoft Excel 10.0 Object Library in the application.
Writing to a premade template is pretty vital to the application. I suppose I could create the template in code within VB itself and write it to a blank Excel sheet if required, but that will be a lot of coding I'd rather avoid.
Any ideas on what I'm doing wrong or why its crashing?
Browser Crashing?
For some odd reason my browser crashes when some pages are open in a new window. This however only happens when it is compiled and not in visual basic. Visual basic returns no errors. Can someone please take a look at my code for me and tell me what i'm doing wrong?
Browser's main window code>
Private Sub LoadHistory()
If Dir$("History.txt") = "" Then
Else
Open "History.txt" For Input As #1
Do Until EOF(1)
Input #1, Hst
Address.AddItem Hst
Loop
Close #1
End If
End Sub
Private Sub Position()
Window.Height = Me.Height - 800
Window.Width = Me.Width - 100
Navshow.Width = Me.Width - 100
Navs.Width = Me.Width - 370
Navs.Height = Address.Height
Buttons.Left = Me.Width - Buttons.Width - 400
Buttons.Height = Address.Height
Address.Width = Me.Width - 1750
End Sub
Private Sub AddBm_Click()
Open "Bookmarks.txt" For Append As #1
Print #1, Window.LocationURL
Close #1
End Sub
Private Sub Address_Click()
Window.Navigate Address.Text
End Sub
Private Sub Address_KeyDown(KeyCode As Integer, Shift As Integer)
Dim NextUrl As String
If KeyCode = vbKeyReturn Then
Call AdjUrl(Address.Text)
NextUrl = Address.Text
Call History
Address.Text = NextUrl
End If
End Sub
Private Sub Back_Click()
On Error Resume Next
Window.GoBack
End Sub
Private Sub BDock_Click()
Load Docked
Docked.Show
Me.Visible = False
End Sub
Private Sub Dock_Click()
Load Docked
Docked.Show
Me.Visible = False
End Sub
Private Sub Downloads_Click()
Call AdjUrl(Options.DownloadPg.Text)
End Sub
Private Sub FindHistory_Click()
Load FindHstr
FindHstr.Visible = True
End Sub
Private Sub Form_Load()
Call Position
Call LoadHistory
Call AdjUrl(Options.HomePg.Text)
Me.Enabled = True
If InternetGetConnectedState(INTERNET_CONNECTION_MODEM, 0) = 1 Then
Me.Caption = "Online."
Else
Me.Caption = "Offline."
End If
End Sub
Private Sub Form_Resize()
If Me.WindowState = 1 Then
'Do nothing
Else
Call Position
End If
End Sub
Private Sub History()
Address.AddItem Address.Text
If Options.NoHstLog.Value = Unchecked Then
Open "History.txt" For Append As #1
Print #1, Address.Text
Close #1
End If
Address.Clear
Call LoadHistory
End Sub
Private Sub AllHistory(URL As String)
If Options.AllHistory.Value = Checked Then
Open "AllHistory.txt" For Append As #1
Print #1, URL
Close #1
End If
End Sub
Private Sub AdjUrl(Add As String)
For Nx = 1 To Len(Add)
If Mid$(Add, Nx, 1) = "." Then
URL = True
GoTo LoopEnd
End If
Next Nx
LoopEnd:
If URL = True Then
' Do nothing
Else
Add = Add & ".com"
End If
If Mid$(Add, 1, 7) = "Http://" Or Mid$(Add, 1, 7) = "http://" Then
Address.Text = Add
Window.Navigate Add
Else
Add = "http://" & Add
Window.Navigate Add
Address.Text = Add
End If
End Sub
Private Sub Form_Terminate()
Unload Me
Unload Options
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub Go_Click()
Call AdjUrl(Address.Text)
Call History
End Sub
Private Sub Home_Click()
Call AdjUrl(Options.HomePg.Text)
End Sub
Private Sub Navshow_Click()
If Navs.Visible = True Then
Navs.Visible = False
Navshow.BackColor = &H0&
ElseIf Navs.Visible = False Then
Navs.Visible = True
Navshow.BackColor = &HFF0000
Address.SetFocus
End If
End Sub
Private Sub NewBrowser_Click()
On Error Resume Next
Shell App.Path & "" & App.EXEName & ".exe", vbNormalFocus
End Sub
Private Sub Optns_Click()
Load Options
Main.Enabled = False
Options.Show
End Sub
Private Sub Popups_Click()
If Popups.Checked = True Then
Popups.Checked = False
ElseIf Popups.Checked = False Then
Popups.Checked = True
End If
End Sub
Private Sub Refrsh_Click()
Window.Refresh
End Sub
Private Sub Search_Click()
Call AdjUrl(Options.SearchPg.Text)
End Sub
Private Sub ShowBm_Click()
Load Bookmarks
Bookmarks.Show
End Sub
Private Sub Stp_Click()
Window.Stop
End Sub
Private Sub Window_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Me.Caption = "Browser: " & Window.LocationName & " -> " & Window.LocationURL
End Sub
Private Sub Window_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Call AllHistory(Window.LocationURL)
End Sub
Private Sub Window_NavigateError(ByVal pDisp As Object, URL As Variant, Frame As Variant, StatusCode As Variant, Cancel As Boolean)
Cancel = True
End Sub
Private Sub Window_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim NewWF As Form
If Popups.Checked = True Then
Cancel = True
DoEvents
ElseIf Popups.Checked = False Then
Cancel = False
Set NewWF = New Newwindow
NewWF.Web.RegisterAsBrowser = True
Set ppDisp = NewWF.Web.Object
NewWF.Visible = True
End If
End Sub
Private Sub Window_StatusTextChange(ByVal Text As String)
If Text = "" Or Text = "Done" Then
Me.Caption = "Browser: " & Window.LocationName & " -> " & Window.LocationURL
Else
Me.Caption = Text
End If
End Sub
Private Sub Window_TitleChange(ByVal Text As String)
Address.Text = Window.LocationURL
End Sub
Bowser's newwindow code>
Private Sub Position()
If Me.WindowState = 1 Then
Else
Web.Width = Me.Width - 125
Web.Height = Me.Height - 400
End If
End Sub
Private Sub Form_Resize()
Call Position
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Me.Caption = Web.LocationName & " -> " & Web.LocationURL
End Sub
Private Sub Web_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
End Sub
Private Sub Web_StatusTextChange(ByVal Text As String)
If Text = "" Or Text = "Done" Then
Me.Caption = Web.LocationName & " -> " & Web.LocationURL
Else
Me.Caption = Text
End If
End Sub
Private Sub Web_WindowSetHeight(ByVal Height As Long)
Me.Height = Height
End Sub
Private Sub Web_WindowSetLeft(ByVal Left As Long)
Me.Left = Left
End Sub
Private Sub Web_WindowSetResizable(ByVal Resizable As Boolean)
Resume Next
End Sub
Private Sub Web_WindowSetTop(ByVal Top As Long)
Me.Top = Top
End Sub
Private Sub Web_WindowSetWidth(ByVal Width As Long)
Me.Width = Width
End Sub
Random Crashing
Since the last version of ym program, it seems to often crash with the win XP "<program name> has encountered a problem and must be closed. We are sorry for this inconvenience".
This doesnt happen after a specific action like a coding error, it happens at random times while usign the program, I dont see what I changed that could be causing this.
How can I get an idea of what is causing this and how to fix it?
Thanks
App Crashing Problem..
This program that I am working on is giving me a real problem, and I don't know why.
While I am in IDE mode, if I end the program, either through a coded 'End', or pressing the stop button in the VB IDE, the program crashes, and VB closes with it. However, while the program is running after I compile it, there are no problems.
Anyone have any idea what might be causing this, or how I could go about tracking the problem down? Sometimes it's hard to remember to do the all important SAVE before I run to test something.
|