{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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock Crashing
I've found that my chat/file transfer program seems to crash when transfering files. All I do is read from the file, send a chunk (1024 characters), and wait for the other program to ask for the next. (repeat)
I figure there's just so much data being sent (this is from myself to myself) that it crashes one of the clients, or even the server program in between.
Common problem?
Winsock Problem With VB Crashing
My test code has a single form called Console with a Command Button call Command1 which is used to exit the test, and of course a Winsock control called Socket. The following is the only relvant code - at the moment I do nothing esle with Socket:
Code:sub Load Console()
.
. 'other irrelevant stuff
.
Socket(0).LocalPort = cPortNumber 'an integer value
Socket(0).Listen
end sub
sub Command1_click()
dim i%
for i = 0 to Socket.Ubound
SafeClose i%
next
Unload Me
end sub
Private Sub SafeClose(Index As Integer)
If Socket(Index).State = sckConnected Then
Socket(Index).Close
Unload Socket(Index)
End If
End Sub
I run the test and get the form up, then I press the button to exit and the test exits.
When I run it again, VB itself crashes. I have tracked it to the Socket(0).Listen line in the above code - VB crashes when that statement is executed.
This suggests that I need to make Socket(0) kind of Unlisten, which is what the subroutine SafeClose (got from these forums)
is meant to do.
So why isn't it????
Leo
BTW Merry Xmas all, and Happy New Year (there should be a Santa smiley to put here!!!!)
Leo
-------------------------------------------------------
Time flies like an arrow, Fruit flies like a banana
Edited by - leosuth on 12/25/2003 5:03:00 AM
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.
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.
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.
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
"Ghost" Connections With TCP With Winsock - How Do They Happen?
The whole reason for pings is to see if a computer (which youre connected to) is still responding. But I thought that the TCP protocol guarantees delivery or an error is thrown?
What causes these ghost connections - where the winsock state will show connected.. but its not really connected?
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
Why Would This Happen
Hi all
I have a strange problem and can't seem to figure it out, i have a Vsflexgrid on my form "grdjournal" in col 2 i store currency, i then use the following code to add up the figures and display it in a label "lblTotal".
Code:
Private Sub cmdSubTotal_Click()
lblTotal.Visible = True
grdJournal.SubtotalPosition = flexSTBelow
grdJournal.Subtotal flexSTSum, -1, 2, "$", vbRed
lblTotal.Caption = Format(grdJournal.TextMatrix(50, 2), "Currency")
End Sub
But for some reason it is rounding the total to the nearest whole number, for instance, in col 2
$10,50
$10,50
$10,50
will display $31,00 instead of $31,50.
Please can someone advise me as to what i might be doing wrong.
Many thanks
Why Would This Happen
Hi
I am using an access database, and on my form i have two command buttons, one command button copies data from a Table called "Sales1" into a table called "SalesHist" the other command button then deletes the same data from "Sales1", the part that is confusing me is that the queries work provided i quit my app between buttons. So if i use command1 to copy the data it works fine, if i quit the app and then use command2 the correct records are deleted and all is fine. But if i click on command1 and then 10 seconds later command2 the records are deleted from both tables, and there are'nt many records it does the same with 10 or 2.
Code:
Private Sub cmdCustomers_Click()
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim sSQL As String
Dim tmpSQL As String
Set MyConn = New ADODB.Connection
Set MyRecSet = New ADODB.Recordset
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"
MyConn.Open
tmpSQL = "INSERT INTO SalesHist (Tbl_No, Qty, Description, Price, Dates) SELECT Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & lblTabNo.Caption & "'"
MyConn.Execute tmpSQL
MyConn.Close
End Sub
Code:
Private Sub cmdTender_Click(index As Integer)
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim sSQL As String
Set MyConn = New ADODB.Connection
Set MyRecSet = New ADODB.Recordset
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"
MyConn.Open
sSQL = "DELETE Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & frmMain.lblTabNo.Caption & "'"
MyRecSet.Open sSQL, MyConn, adOpenStatic, adLockReadOnly
Unload Me
End Sub
Many thanks
Why Does This Happen?
Hi all,
I'm having a minor problem with my application. What I have is a progress bar that shows the progress of the current sub being performed. Now, this sub takes 15+ seconds to complete (depending on the listcount in the listbox). It is interacting with a third party app, which is why it takes so long.
Anyway, it works all fine and dandy...until you click on another application. When you try to switch to a new application or anything of the nature, the application temporarily 'locks up' until the sub is finished running. I've attached a picture of what it looks like when it is 'locked up'. The progress bar stops moving and if I was to go back and click on the app again, it would turn all white and say (Not Responding) in the title bar until the sub was finished. Once it finishes, everything goes back to normal. I'm thinking it's some sort of refresh/redraw problem, but I'm not sure. I have a Me.Refresh at the end of each 'Next x' in the sub (The sub runs a full time for each item in the list box) and in my form loud I have a Me.AutoRedraw=True but neither of those work.
Any ideas?
What Happen Here?
Hi, i have a public sub in a module that i call.
when i put this:
call seteatoolbar(1) it doesn't work
when i put this:
msgbox "wait"
call seteatoolbar(1) it work correctly
when i put a message box before or after the call it works right.
do you have an idea of what's happening?
Anybody Else Had This Happen Lately
I'm having some serious difficulties in running Visual Studio/VB98. While compiling and running my project. I get the dreaded "Microsoft has experienced a problem and will now be terminating yada yada yada". This has increasingly become a problem as I work from home and can't find my Visual Studio discs.. Maybe I should have just upgraded to XP Pro and installed .Net. Anyone else that has experienced difficulties feel free to reply and help me correct this problem.
Thanks
Larson
Never Seen This Happen Before ????
Hi there
We have a piece of software that's used by about 700 customers running on over 1500 machines. One particular machine of a 3 workstation network behaves in a strange way to all the others.
Its a pentium 4 running Windows XP with all the latest updates.
Here's an example of the problem
A$ = VAL("3")
but when you look in A$, you get something like 2.99999999997
This happens for nearly every whole number, I can understand if the val operation was performed on a floating point, but not on an integer.
The other machines on their network run fine and they all run the same EXE of a file server.
Appart from replacing the machine, I have no idea on what to do.
Anyone come across this problem?
Cheers
Simon Luce
Why Would This Happen
Hi all
I have a strange problem and can't seem to figure it out, i have a Vsflexgrid on my form "grdjournal" in col 2 i store currency, i then use the following code to add up the figures and display it in a label "lblTotal".
VB Code:
Private Sub cmdSubTotal_Click() lblTotal.Visible = True grdJournal.SubtotalPosition = flexSTBelow grdJournal.Subtotal flexSTSum, -1, 2, "$", vbRed lblTotal.Caption = Format(grdJournal.TextMatrix(50, 2), "Currency")End Sub
But for some reason it is rounding the total to the nearest whole number, for instance, in col 2
$10,50
$10,50
$10,50
will display $31,00 instead of $31,50.
Please can someone advise me as to what i might be doing wrong.
Many thanks
Why Would This Happen?
Hi
I am using an access database, and on my form i have two command buttons, one command button copies data from a Table called "Sales1" into a table called "SalesHist" the other command button then deletes the same data from "Sales1", the part that is confusing me is that the queries work provided i quit my app between buttons. So if i use command1 to copy the data it works fine, if i quit the app and then use command2 the correct records are deleted and all is fine. But if i click on command1 and then 10 seconds later command2 the records are deleted from both tables, and there are'nt many records it does the same with 10 or 2.
VB Code:
Private Sub cmdCustomers_Click() Dim MyConn As ADODB.Connection Dim MyRecSet As ADODB.Recordset Dim sSQL As String Dim tmpSQL As String Set MyConn = New ADODB.Connection Set MyRecSet = New ADODB.Recordset MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;" MyConn.Open tmpSQL = "INSERT INTO SalesHist (Tbl_No, Qty, Description, Price, Dates) SELECT Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & lblTabNo.Caption & "'" MyConn.Execute tmpSQL MyConn.CloseEnd Sub
VB Code:
Private Sub cmdTender_Click(index As Integer) Dim MyConn As ADODB.Connection Dim MyRecSet As ADODB.Recordset Dim sSQL As String Set MyConn = New ADODB.Connection Set MyRecSet = New ADODB.Recordset MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;" MyConn.Open sSQL = "DELETE Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & frmMain.lblTabNo.Caption & "'" MyConn.Execute sSQL Unload MeEnd Sub
Many thanks
Why Does This Happen?
hey guys, i ahve another question:
Option Explicit
Dim x As Long
Private Sub Command1_Click() ....................1
On Error GoTo aa .....................................2
If Form1.Name = "Form1" Then ....................3
x = CDbl(txt.Text) ...............................4
Print "ss" ...........................................5
aa: .................................................6
Call MsgBox("sdfsd") ............................7
Resume Next .................................. 8
End If
End Sub
ok now i will explain what's going on: First in the txt i have a string lateral not numeric, so when i press i get to line 4, an error occures and i get to line 6, msgbox is called then back to line 3, i get to 4 then error then to 6 then back to 5, ss is printed then i get to 6 and a msgbox....so i get 3 times the msgbox.
But in case txt is numeric: i press, reach 4,5,6 and get a msgbox, then resume to where? In this case i am getting the msgbox twice, why? where is the aa: resuming to.
thanks.
Does This Happen To You Too?
try this out. open a new project, maximise the form and put a cmd button or any other ctl right at the bottom of the form. then run it and maximise the form.... what do u see?
Can This Happen??
Can you change someones homepage(default location a browser goes to) without them knowing about it?? Kinda like when you are prompted to set your home page as someones web site except without prompting you just set it? Can that actually be done?? If so How? .......if you tell me how maybe i will tell you why i want to know ......i will not do anything bad with it...I promise
Why Does This Happen?
Put this line of code into a form and tell me what you get. what i get is 6.4583333, but when i do this on a calculator i get .0064583333. Why does this happen, how do i fix this?
lblpaymentout = 7.75 / (12 * 100)
Why Did This Happen?
I did my first deployment via CD today. I went to a client where I had already installed a version of my program via floppy disk.
I popped the CD in the tray, hit setup.exe, and a message appeared saying that some files were missing, and if I wanted to complete setup then I would need to re-boot the computer. I did, and when I re-started setup.exe, I got a series of messages saying that I was trying to install older dll files than what was already on the computer. It gave me the option of keeping these older files, and the setup proceesed okay.
But why did all this happen in the first place? Nothing like this happened with the floppy disks.
Anybody Have This Happen To Them!!!
Last week for no reason that I can figure out, the ability of my IE 6.0 to View the source of any webpage was disabled! How can I fix that?
Why Does His Happen?!
I get a type mismatch error when this occurs:
Private Sub Form_Load()
bActiveSession = False
hOpen = 0
hConnection = 0
optBin.Value = 1
dwType = FTP_TRANSFER_TYPE_BINARY
Dim imgI As ListImage
Set imgI = ImageList1.ListImages.Add(, "open", LoadPicture("open.bmp"))
Set imgI = ImageList1.ListImages.Add(, "closed", LoadPicture("closed.bmp"))
Set imgI = ImageList1.ListImages.Add(, "leaf", LoadPicture("leaf.bmp"))
Set imgI = ImageList1.ListImages.Add(, "root", LoadPicture("root.bmp"))
TreeView1.ImageList = ImageList1
TreeView1.Style = tvwTreelinesPictureText
EnableUI (False)
End Sub
The bolded line is where the error occurs. The thing is, I don't understand it cuz the image is what it is meant to be, and the code and images work somewhere else!!! so why not here? the image is in the right place and is right type etc, but i get this error>?
pls help!
Bob
Why Does This Happen
Hi, when ppl type in a text box I use the Replace command to change the < into another symbol.
However, when it does this (Im using OnChange) the sursor jumps to the begining of the text box (Tex1)
Why does it do this, and how do I stop it?
Why Does This Happen?
This code. Thanks to geoff_xrx and bloodeye!
It goes to the page url and lists the url until the list box has run out of space.
What it's meant to do is go to the url, look to see if the words specified are there if so list the url it is at!
Option Compare Text
Dim site(2) As String
Dim words(2) As String 'just a few words....you'll have to add them all
Dim siteNum As Integer
Private Sub Form_Load()
Web1.Navigate "http://www.riu.com.au/gold/secure"
site(0) = "http://www.riu.com.au/gold/secure"
words(0) = "Resource Service Group"
siteNum = 0
End Sub
Private Sub nextSite()
Web1.Navigate site(siteNum)
Do Until Web1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
siteNum = siteNum + 1
End Sub
Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim itext As String
Dim x As Integer
Me.Caption = "site:" & siteNum & " " & URL
If (pDisp Is Web1.object) Then
itext = Web1.Document.documentElement.innerText
For x = 0 To UBound(words)
If InStr(itext, words(x)) < 0 Then
List1.AddItem Web1.LocationURL
nextSite
Exit Sub
End If
Next x
nextSite
End If
End Sub
Would There Happen To Be...
By any chance, would there happen to be an API function available
that would allow me to terminate a process by name (as it appears
in the task manager list) ?
Why Does This Happen
i my html editor i want to cover up a richtextbox while the html code in it is being colorized, so i have a picturebox over it and when i call the colorize function it sets it as visible and then does all the colorizing and then sets it as invisible. but the picturebox never shows unless i trace through the code. i guess it's just going thru so much code so fast that it never shows, but even when it takes about a minute to color the html it still doesn't. any ideas? maybe some way of pauing after setting it as visible, but i can't use a timer i don't think cause it's in a module, not on the forum. or are there ways of preventing people from clicking in or typing in the rtf box while it's doing this? i can't set it as not visible or as locked or not enabled cause i get errors with those. please help...
What Will Happen With VB?
What is the future like for VB, with the creation of VB.Net. Should I keep on learning VB or should I change to a new language.
What Does It Happen ?
Please show me where I wrong ?
When I want to use RichTextBox control, I must have richtx32.ocx ?
And richtx32.ocx can work if Riched32.dll or riched20.dll has been registered properly ?
Richtextbox control behavior does not depend on platform (win98 and win2k) if we use the same richtx32.ocx and riched20.dll?
If it correct then why I can not set background text color in Windows98 but I can in Windows2000.
(I got a sample at www.vbaccelarator.com)
Code is as follows :
public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hWnd as Long, byval wMsg as Long, byval wParam as Long, byval lParam as Long) as Long
public Type CHARFORMAT2
cbSize as Integer '2
wPad1 as Integer '4
dwMask as Long '8
dwEffects as Long '12
yHeight as Long '16
yOffset as Long '20
crTextColor as Long '24
bCharSet as Byte '25
bPitchAndFamily as Byte '26
szFaceName(0 to LF_FACESIZE - 1) as Byte ' 58
wPad2 as Integer ' 60
' Additional stuff supported by RICHEDIT20
wWeight as Integer ' /* Font weight (LOGFONT value) */
sSpacing as Integer ' /* Amount to space between letters */
crBackColor as Long ' /* Background color */
lLCID as Long ' /* Locale ID */
dwReserved as Long ' /* Reserved. Must be 0 */
sStyle as Integer ' /* Style handle */
wKerning as Integer ' /* Twip size above which to kern char pair*/
bUnderlineType as Byte ' /* Underline type */
bAnimation as Byte ' /* Animated text like marching ants */
bRevAuthor as Byte ' /* Revision author index */
bReserved1 as Byte
End Type
dim charf as CHARFORMAT2
private Sub mnuFontBackColour_Click()
Dim ret as Long
on error GoTo error_cancel
charf.dwMask = CFM_BACKCOLOR
charf.cbSize = LenB(charf) 'setup the size of the character format
charf.crBackColor = vbRed 'value of RGB
ret = SendMessageLong(rtfText1.hWnd, EM_SETCHARFORMAT, SCF_SELECTION, VarPtr(charf))
Exit Sub
error_cancel:
''MsgBox "cancel "
End Sub
Or could you show me any URL about that ?
Thank you very much.
Why Do These Things Happen To Me
I have been developing an exe for some time it has been built and used for months no problems at all I have been working on it all week and running it all fine. Today I have made amendments and run it no problems, BUT all of a sudden when I try and run it or compile it it has decided not to recognise any of my public enumerations and is stating :
'Compile Error: Constant expression required'
AAArrrrgghh whats this all about
How Can I Make This To Happen
i want: when my project loades that if the database is locked (in use by a other copie of the project) that their is a message like "sorry database is in use, try again in a few minutes" and that the project will end itselves
the code
form_load()
if blabla.mdb=locked then
msgbox "sorry..."
end.
endif
end sub
isnt working
What Happen Of Call Sub ?
Code:
Public Sub LockTheForm(ByRef xx As Form)
Dim otext As TextBox
For Each otext In xx
otext.Locked = True
Next
End Sub
Code:
Private Sub Form_Load()
LockTheForm (Me)
End Sub
sub is in module and call form1 in mdiform it said
error 13 type missmatch
|