Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




HELP: &"Out Of Memory&" Error (and More) When Starting Visual Basic 6.0


Let me first start by saying that I am using WinXP and have been working with Visual Basic 6.0 for a few weeks now without any problems. Everytime I am done with it, I save the project and close the Visual Basic 6.0 window.

I wanted to work on my project last night, so I double-clicked on my desktop icon for Visual Basic V6.0 to open it up which I always did before) but this time I get the following errors (shown in order as they come up):

Error 1) Out of Memory : Continue? (I click YES button)
Error 2) Object Variable or With Block Variable Not Set: Continue? (I click YES button)
Error 3) Object Variable or With Block Variable Not Set: Continue? (I click YES button)
Error 4) Object Variable or With Block Variable Not Set: Continue? (I click YES button)
Error 5) Automation Error Catastrophic Failure (I click OK button)
Error 6) Object Variable or With Block Variable Not Set: Continue? (I click YES button)

After error (6), the Visual Basic 6.0 window does come up and I can open my project, edit the project, click RUN to test/debug my project and save my project.

Can someone please tell me what in the world is going on? Why do I have these errors all of sudden on opening up the application and what should I do to correct the problems?


Also, there were two other things I noticed:

- I tried to access the MSDN Library for Visual Basic 6.0 (via the Help menu) but discovered that the help library has disappeared. The other MSDN libraries (Visual C++ , etc..) were still there, but the Visual Basic 6.0 one was gone. A window gets displayed telling me to reinstall the library from disc

- When I first started my project, I added some controls via the Components menu option. Two of these controls(RICHTX32.OCX and COMDLG32.OCX) I added but never used yet. I decided to use a richTextBox last night and realized that the richTextBox icon in the control window (or is it called the component window), as well as the Common Dialog icon, were changed to a plain white folder icon. Usually these icons would be seen as image icons. Anyway, I tried to drag a richTextBox in the Form and was told that it could not found (or something like that).








Edited by - uncletr on 6/19/2004 3:41:59 PM




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Visual Basic &"The Memory Could Not Be Written&"
I am automating a batch print process (50 reports) using Excel/VB. The process aborts partially through the procedure with the following error message...

The instruction at "0x77fcbb5c" referenced memory at "0xffe00037".  The memory count not be "written".  

The instruction and memory location vary each time I run the procedure.  The point at which the procedure aborts is different each time.

The latest Crystal SP's have been applied.  Crystal Reports 8.5 ActiveX Designer Run Time Library and Crystal Reports 8.5 ActiveX Designer Design and Runtime Libraryreferences are included in the VB project.

Here is a sample of the code...  Any Help will be appreciated.  The frustration level increases geometrically with time!... Thanks!

============================================================

Dim crreport As CRAXDRT.Report
Dim crapplication As New CRAXDRT.Application

Dim reportfile As String                         
Dim FromPeriod As String                        
Dim ToPeriod As String                          
Dim Account As String  
Dim Orientation As Integer                      
Dim PaperSize As Integer
Dim Copies As Integer

Sheets("PrintGandA").Activate    
FromPeriod = Range("$C$7").Value
ToPeriod = Range("$C$8").Value
Copies = Range("$C$9").Value

crapplication.LogOnServer "pdsodbc.dll", "APP", "USR", "APP", "APPPWD"

' FIRST REPORT...
' ===============

Account = "751020"

reportfile = "S:T0_T4.rpt"   
Set crreport = crapplication.OpenReport(reportfile)

Orientation = crreport.PaperOrientation
PaperSize = crreport.PaperSize

' Clear Parms
' ===========

crreport.ParameterFields.GetItemByName("FromPeriod").ClearCurrentValueAndRange
crreport.ParameterFields.GetItemByName("ToPeriod").ClearCurrentValueAndRange
crreport.ParameterFields.GetItemByName("AccountCode").ClearCurrentValueAndRange

' Add Parms
' =========
crreport.ParameterFields.GetItemByName("FromPeriod").AddCurrentValue (FromPeriod)
crreport.ParameterFields.GetItemByName("ToPeriod").AddCurrentValue (ToPeriod)
crreport.ParameterFields.GetItemByName("AccountCode").AddCurrentValue (Account)
        
crreport.PrintOut False, Copies, True


Etc.....

OPENING VISUAL BASIC 6.0 ERROR, DAO350.DLL, &"Unexpected Error; Quitting&"
Hi,

I could really use some help. I am not the most knowledgable and would appreciate any guidance... I did a web search already at some sites including Microsoft, but I have not found a soultion yet.

Problem: CANNOT OPEN VISUAL BASIC 6.0; Says "Unexpected error; quitting"
Machine/Software:
OS: XP Media Center (although system info says XP Professional 5.1.2600 Service Pack2 Build 2600)
PC: Acer AspireE36
SW:Microsoft Visual Studio 6.0 Enterprise Edition

History:
1. Could not open visual basic 6.0. I got the an error that the DAO350.DLL could not be found.

2. So following some suggestions from the web:
a) Renamed old DAO350.DLL as DAO350.DLLOLD
b) I took this file from Visual Studio Disk 1 and copied it into the
C:Program FilesCommon FilesMicrosoft SharedDAO
c) Regsvr32 "C:Program FilesCommon FilesMicrosoft SharedDAODAO350.DLL"
d) Then I got a successful message that it registered
e) It did not work. When I tried to open the visual basic 6.0 now I get:
"Unexpected error; quitting" message.

WHAT DO I DO PLEASE?

I even loaded the component checker 2.0 as suggest via microsoft website to look up the Microsoft Data Access Components (MDAC).
(see Article ID: 304230 and 301202 on http://support.microsoft.com/kb/304230 and htpp://support.microsoft.com/default.aspx?kbid=301202))

It says MDAC 2.8 SP1 ON WINDOWS XP SP2. I am not sure what this MDAC does for me, but I looked at it anyways.

&"Can't Lock File&" Error For Database Using Visual Basic
Ok, I have searched this board for a while now trying to find the answer, and it seems that no one has really answered the problem at hand. I am running a vb6.0 app on serveral windows 2000 boxes that all must connect to an access database. i have tested the program here on my local machine (as a single user on the database) and the program runs fine, not a bug in site.

I installed the same program on another machine here on the network, and it worked fine as well. We both opened the program at the same time, modified the database at the same time, and everything, and still everything works fine. these tests were run on windows xp boxes.

The solution I need is this. I am delivering this software to another company where like i said, they are using 2000 boxes. when one user tries to open the program, they get the can't lock file error. they now have full control of the database (the it guys over there were big on security and had the security controls down to basically read-only). yet still, it doesn't work. the catch is this, the it guys who have administrative privileges, as well as the supervisor, run the program with no gliches.

Does anyone have an answer to any of this. Is it because of the Windows xp deal? is it because of the visual basic way of dealing with the database (I am dao for this one, i could change to ado if necessary), or is it because the users don't have admin privileges (as a side note, i do not have admin privileges on the network here at work, and in fact the database was stored in a very secured folder on the network when it was running here)

any help would be great

thanx

Error With Multithreading In Visual Basic: &"CoInitialize Has Not Been Called&"
I've got this error with a COM object during a multithreading project. So I go insane on researching in web with visual basic. And the researchments give me a NULL POINT. So I've decided to make some own ways. In visual basic there's no way to cut this error out. So I've wrote a DLL in C++ and decided to share with people. Here is the codes below and the DLL attached.

// COMDLL.cpp : Defines the entry point for the DLL application.
//

#include "objbase.h"

BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    return TRUE;
}

void __stdcall coinitialize()
{
    CoInitialize(NULL);
}
void __stdcall couninitialize()
{
    CoUninitialize();
}

thats all.. short huh but makes insane people



Edited by - sonerkoksal on 7/20/2005 12:38:10 AM

All Visual Basic's .exe Files Say: &"Unexpected Error&"!
hi!

When i open Visual Basic 4 ( i have only 4... ...) it's open a window message that say: "Unexpected Error" and tells me to click OK, when i clicked on it, Visual Basic 4 colse.

The same thing is when i try to run a visual basic's .exe file it say the same.

(and close...) what to do?!?!?

i tryed to reinstall - didn't successful.

i tryed to uninstall and reinstall again - didn't successful.

HELP!!!!

Thanks.

Visual Basic 6.0 - &"Internal Error&" - Help Please
Hi,

Recently I upgraded my Windows XP to SP 1 Build 1097.
After that, the project I was working will return with an error which states:

"Internal Error"

And nothing would appear.

Also, when I run *.frm file from the project directory, it would say *.dll and *.ocx could not be loaded, and also didn't run. In the log it says:

Line 35: Control 'stbMAin' class couldn't load. It's not control class.
Line 63: Control 'tabOptions' class couldn't load. It's not control class.
Line 135: Control 'imgAccounts' class couldn't load. It's not control class.
Line 157: Control 'lvwAccounts' class couldn't load. It's not control class.
Line 224: Control 'WinSock' class couldn't load. It's not control class.

Any ideas? Thank you.

P.S. It works on every other computer.

Solution> Error: &"&"&"&"&H8007007E (-2147024770) The Specified Module Cannot Be Found&"&"&"
Hello

This is the error what i am getting after installing a package of one of my module on user testing machine.
The same module being working fine on others.


What can be the reason for this and what can be the probable solution for this?

Sandeep

&"Error During Loading&",&"Out Of Memory&" :O(
I programmed my graduation project by visual basic and after 6 months of work ,suddenly the program didn't run

i got a massege saying "Errors during load .refer to 'D:......form1.log' for details" ,after clicking ok another message appears saying "out of memory" ,then nothing happened and the program didn't run.........
the program was working well, all what have been changed is that i installed a fresh copy of windows xp, then the problem happened........
does anyone can help ,my graduation project test is in the coming 3 weeks, i am in a very difficult attitude.............

&"ERROR&" This Is Starting To Annoy Me
Row cannot be located for updating. Some values may have been changed since it was last read.

That is the error message that i keep getting, and i cannot figure out what to do about it, i get the message on any attempt i make at updating an ado recordset, moveing it, resync, i can do a cancelupdate, but of course that clears the last changes i have just made to it.
I have checked the editmode and it is '1' or adEditInProgress.

Can any one tell me how i can update the record set and then move to the next one with out getting an error.

I am doing this all throughout my program but only on this one spot am i getting this error.

Here is the code i use

Code:
adoalarm("MsgSent") = True

adoalarm.update
if not adoalarm.eof then adoalarm.movenext
any help would be great thanks

&"Clipboard Object Not Upgraded To Visual Basic .NET By The Upgrade Wizard&"
I am getting a "run-time error '5'" when trying to run this old vb program in vb 6. When I click debug it highlights the statement "AppActivate ReturnValue" underlined below. When I run code advisor it writes the following under the statement: "FIXIT: Clipboard object not upgraded to Visual Basic .NET by the Upgrade Wizard." I am not a vb programmer, so I appologize if this information is insufficient. But, any help you could give on how to modify this code to run properly would be greatly appreciated.
Thanks!

Option Explicit
'FIXIT: Non Zero lowerbound arrays are not supported in Visual Basic .NET FixIT90210ae-R9815-H1984
Public Dist59(1 To 60) As Double 'distances for 59 gage bands
'FIXIT: Non Zero lowerbound arrays are not supported in Visual Basic .NET FixIT90210ae-R9815-H1984
Public Dist40(1 To 41) As Double 'distances for 40 gage bands

'converts impax files to utility files (works on win 98, but not later, should be changed to use dll if XP becomes prevelant)
Public Function ImpaxConversion(path As String, runnumber As Integer, L_or_U As String, TestName As String, Comment As String, EventNumber As Integer, NumOfGages As Integer) As String
Dim ReturnValue As Long
Dim start As Long
Dim TempInt As Long
Dim FileName As String
Dim runnumberstr As String
runnumberstr = CStr(runnumber)
While Len(runnumberstr) < 3
runnumberstr = "0" + runnumberstr
Wend
FileName = path + "ASLDATAS" + runnumberstr + L_or_U + "XXX"
If Dir(path & "ASLDATA", 16) = "" Then
MkDir path & "ASLDATA"
End If
'Call CopyFile(path, App.path + "impax.ini")
'Call CopyFile(path, App.path + " est.dbd")
'Call CopyFile(path, App.path + "xdcr.txt")
ReturnValue = Shell(App.path + "Impx_cnv.exe", vbMinimizedNoFocus)
AppActivate ReturnValue
'FIXIT: Clipboard object not upgraded to Visual Basic .NET by the Upgrade Wizard. FixIT90210ae-R6194-H1984
Clipboard.Clear
'FIXIT: Clipboard object not upgraded to Visual Basic .NET by the Upgrade Wizard. FixIT90210ae-R6194-H1984
Clipboard.SetText path + vbCr + "S" + vbCr + vbCr + CStr(runnumber) + vbCr + L_or_U + vbCr + vbCr + TestName + vbCr + "0.0" + vbCr + Comment + vbCr + "No" + vbCr + "No" + vbCr + CStr(EventNumber) + vbCr
SendKeys "% ep", 1
MsgBox "Please wait for the console window to read ''Finished'', and click on Ok.", vbInformation, "Done"
ImpaxConversion = FileName
End Function

Private Sub CopyFile(path As String, FileName As String)
'FIXIT: Declare 'FSO' with an early-bound data type FixIT90210ae-R1672-R1B8ZE
Dim FSO As Object
'FIXIT: Declare 'File' with an early-bound data type FixIT90210ae-R1672-R1B8ZE
Dim File As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
End Sub

'initalizes distance arrays
Public Sub InitDist()
Dist59(1) = 0
Dist40(1) = 0
Dim i As Integer
For i = 2 To 59
If i <= 12 Or i >= 49 Then
Dist59(i) = Round(Dist59(i - 1) + 25.4, 9)
Else
Dist59(i) = Round(Dist59(i - 1) + 12.7, 9)
End If
If i <= 40 Then
Dist40(i) = Round(Dist40(i - 1) + 25.4, 9)
End If
Next i
Dist59(60) = Dist59(59)
Dist40(41) = Dist40(40)
End Sub

Crystal Reports 8.5 And Visual Basic 6--Err Message&" Server Has Not Yet Been Opened&"
I have been trying to get a pre-developed crystal report to display in a VB6 app at runtime. I can get the report to display with saved data, but when ever I use the .DiscardSavedData method and try to refresh the data I get an error message. The message is this "Server has not been opened". This is my first encounter with this version of Crystal 8.5, so I am sure that I am not using a certain method that is needed. Another question I had is do I even need to open an ADO recordset to populate the report?

Also, one other thing to point out is that my report is using to different tables from with in the same database.

=======================================================
'Declare GS Connection
Public cnGS As New ADODB.Connection

'Declare Connection String Variable
Public sGSConString As String

'Declare ADO record set
Public rsSelect As New ADODB.Recordset
Public rsExec As New ADODB.Recordset

'Declare SQL query string
Public sSQLSelect As String
Public sSQLExec As String

' Declare the application object
Public crxApplication As New CRAXDRT.Application

' Declare report object
Public crxReport As CRAXDRT.Report

Private Sub cmdViewReport_Click()

Call LoadReport

End Sub

Private Sub Form_Load()

Call OpenDatabase

End Sub

Public Function LoadReport()

Set crxReport = New CRAXDRT.Report
Set crxApplication = CreateObject("crystalruntime.application")

Set crxReport = crxApplication.OpenReport("C:Report1Test.rpt", 1)

crxReport.DiscardSavedData
crxReport.Database.SetDataSource rsSelect

crvViewer.ReportSource = crxReport
crvViewer.ViewReport


End Function


Public Function OpenDatabase()

'Setup the GS database connection
Set cnGOS = New ADODB.Connection
sGSConString = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=noway;Password=nohow;Initial Catalog=GR;Data Source=GS"
cnGS.ConnectionString = sGSConString
cnGS.Open
cnGS.CursorLocation = adUseClient

sSQLSelect = "SELECT * FROM OMDR"

rsSelect.Open sSQLSelect, cnGS, adOpenDynamic, adLockReadOnly
rsSelect.MoveFirst

End Function
========================================================

Any suggestions would be appreciated!

Why My &"new Thread&" Doesnt Show Up In Clasic Visual Basic?
Hi

Whirt for today.
My "new tread" doesnt show up in clasic visual basic, but other can replay to my tread.

appreciate if there is a any of information,thanks

Visual Basic 2005 &"express&" / Properties Stuck!
I get the properties window stuck on Procedure attributes of the control I click, rather than it's properties... Maybe it's just something about VB ever since the first .NET version that I don't get... Please help!

I don't know if this beta error, but I doubt it, because it happens all the time and would be a too obvious bug not to be fixed...

Free VB Express:
http://lab.msdn.microsoft.com/express/vbasic/default.aspx




Edited by - WillKoh on 2/17/2005 1:53:18 AM

Registry Key For &"Trust Access To Visual Basic Project&"
Where can I find the registry key for the setting of "Trust access to Visual Basic project" This is found under Tools/Options/Security/macro Security/Trusted Sources in Excel 2003.

Have not found it under Polices under HKEY_CURRENT_USER /Software/Polices. But I do not know where or what to look for anyway?

Function &"Like&" In Database In Visual Basic Doesn't Work
How to use function "Like '' in ADO database?
I used it , but it didn't work.

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim str As String
str = "Driver=Microsoft Access Driver (*.mdb); DBQ=" & App.Path & "information.mdb"
Set cn = New ADODB.Connection
cn.Open str

Adodc.ConnectionString = str
Adodc.CommandType = adCmdText
Adodc.RecordSource = "SELECT DISTINCTROW WORKER.ID, WORKER.NAME from WORKER where [WORKER].[Name] LIKE '*' "
Adodc.Refresh

Getting The &"selection&" Object (from Word) In Visual Basic 6
Is the selection Object of Microsoft Word available in VB?

When I record a macro in Microsoft word that types some text and some carriage returns, and then go into VBA and look at the code that was generated, It uses an object entitled "Selection". I.e.:

Sub Demo()
'
' Demo Macro
' Macro recorded 5/5/2005 by Gareth
'
Selection.Font.Bold = wdToggle
Selection.Font.Size = 14
Selection.TypeText Text:="This is the title"
Selection.Font.Bold = wdToggle
Selection.Font.Size = 12
Selection.TypeParagraph
Selection.TypeParagraph
Selection.Font.Bold = wdToggle
Selection.TypeText Text:="Year: "
Selection.Font.Bold = wdToggle
Selection.TypeText Text:="2005"

End Sub

But what I want to do is write code from a VB6 application that writes a report in Word. I have already got the code that creates a new word app and have had a little succes typing to it using the "range" object. But if I could get hold of the selection object, it would be a lot easier, that way I could just record the macros of what I want to type and then paste the code into VB.

The strange thing about the "selection" object in word's VBA is that it is not declared or set anywhere in the code, it seems to just be an automatically available object like the "thisDocument" object. I would therefore assume that it is not possible to obtain a reference to the selection object from VB. But it would be awesome if it was, it would make my work a hell of a lot easier. So if anyone knows how to get a reference to the "selection" object it would be REALLY REALLY helpful.

Visual Basic Code Runs During &"Save As&"
Please help - I have an excel form that has code attached to hide rows when a combobox changes. This works fine - the problem I am having is that whenever you "save as" the form to rename it, it launches the code again and takes a long time to save. I have tried everything and I am sure that it is probably a simple explanation! Here is an example of the code:

Private Sub New_Renewal_Change()
ActiveSheet.Unprotect ("loan2006")
If Worksheets("Codes").Cells(10, 19) = "CHOOSE TYPE OF OBLIGOR." Then
Worksheets("Commercial Loan Header").Select
Rows("6:300").Select
Selection.EntireRow.Hidden = True
ElseIf Worksheets("Codes").Cells(10, 19) = "NEW OBLIGOR" Then
Worksheets("Commercial Loan Header").Select
Rows("6:6").Select
Selection.EntireRow.Hidden = True
Rows("7:8").Select
Selection.EntireRow.Hidden = False
Rows("10:12").Select
Selection.EntireRow.Hidden = True
Rows("13:21").Select
Selection.EntireRow.Hidden = False
Rows("22:24").Select
Selection.EntireRow.Hidden = False
Cells(13, 9).Select
ElseIf Worksheets("codes").Cells(10, 19) = "NEW LOAN ON EXISTING OBLIGOR" Then
Worksheets("Commercial Loan Header").Select
Rows("6:6").Select
Selection.EntireRow.Hidden = True
Rows("7:11").Select
Selection.EntireRow.Hidden = False
Rows("12:289").Select
Selection.EntireRow.Hidden = True
Cells(10, 9).Select
ElseIf Worksheets("Codes").Cells(10, 19) = "RENEWAL ON EXISTING OBLIGOR" Then
Worksheets("Commercial Loan Header").Select
Rows("6:6").Select
Selection.EntireRow.Hidden = False
Rows("8:11").Select
Selection.EntireRow.Hidden = False
Rows("12:24").Select
Selection.EntireRow.Hidden = True
Rows("41:42").Select
Selection.EntireRow.Hidden = False
Rows("61:61").Select
Selection.EntireRow.Hidden = False
Rows("128:131").Select
Selection.EntireRow.Hidden = False
Rows("253:289").Select
Selection.EntireRow.Hidden = True
Cells(6, 3).Select
ElseIf Worksheets("Codes").Cells(10, 19) = "AMENDMENT/MODIFICATION" Then
Worksheets("Commercial Loan Header").Select
Rows("6:6").Select
Selection.EntireRow.Hidden = True
Rows("7:12").Select
Selection.EntireRow.Hidden = False
Rows("13:21").Select
Selection.EntireRow.Hidden = True
Rows("22:24").Select
Selection.EntireRow.Hidden = False
Cells(10, 9).Select
End If
Exit Sub
ActiveSheet.Protect ("loan2006")
End Sub

Thanks!

How Can I Make Visual Basic &"Read My Screen&"
Hi Everyone,
Recently, i came up with an idea which I do not know if it is possible or not.
Here is just an example of the situation:
Pretend I am scanning my computer for viruses.(Pretend) It takes 5 hours for it to complete the scan and I dont feel like waiting. I know that when the scan is completed, a messagebox with a blue flower will appear saying the scan is complete!
I want to write a program (macro) that allows Visual Basic to read my screen and when it sees that window with the blue flower saying "scan is complete" has appeared, turn off my computer.
I know how to do the turn off computer part but just not the reading screen part. Maybe I could take a screen shot of the flower and give it to visual basic saying "Hey, if u see this, i want you to turn off my computer "

Thanks

What Happened To Free &"Visual Basic 5.0 CEE&" Download
Visual Basic 5.0 CEE used to be offered for free to download from the microsoft site. But now it is gone. Any one has any knowlege as to where I can find this program?

Including &"&amp;&" In Visual Basic Header Code
I want to include a "&" sign in my visual basic code for my page header and am having difficulty. The following is my header code that retrieves the proper header within my excel worksheet:

UnitHeaderName = Application.WorksheetFunction.VLookup(UnitName, Worksheets("ReportSetup").Range("pagesetup"), 2, False)

The text in my columns within the "pagesetup" range shows "Finance & Accounting", however, when I view through a print preview the header shows up as "Finance Accounting". Please let me know what in my code can fix this.

How Can I Use &"DoCmd.Transferdatabase Method&" In Visual Basic?
I want import a .DBF table to a .mdb by using DoCmd.Transferdatabase method in visual basic. I looked up in msn and other refrences but unfortunately I can not find any useful sample.

I would be glad if someone could help me in this field and send me a sample copy .

Thanks,
Mehdi Eghbal

Forms In Visual Basic Minimize When I Use An &"about&" Form
I am developing a small application. Everything seems to work fine. I have on my menu a "Help" menu and under it I have "About" This menu will open a smal form that will give information about the program, the programmer and the version. Every time I click on the About menu the forms that I already have open get smaller rather than keep their size. Does anyone know why is doing this or how I can avoid it?

Thanks

Visual Basic Runtime Error "Error Saving Document
Dear all,
I am saving a document from vb. While saving I get this error. This error occurs only when I run the exe file. This problem doesnt occur while developing the project.
There is no problem with the path. What else may be the problem?

How to rectify this error " Error saving Document" in visual basic 6.0

Pls Help, this is very urgent.

Thanks to all.

Rgds,
Visha

Terminal Em To Embedded Device, Runtime Error 7 &"Out Of Memory&"
All,

I've had to get a terminal emulator together for work, supporting an embedded device. I've got everything working, but keep getting a "Runtime Errror 7, Out of Memory" any time I "stress test" the terminal or the terminal is left running for a long time. My stress test involves repeatedly sending a string from an embedded device at a high rate.

To start, I grabbed the example terminal emulator code from the VB6 pro examples section and modified it to my needs. As I run and stress test the program, I get the Out of Memmory error in the MSComm comEvReceive. Here is my code in this case statement.

**********************************************************
Select Case MSComm1.CommEvent
' Event messages.
Case comEvReceive
Dim Buffer As Variant

Do While MSComm1.InBufferCount > 0

Buffer = MSComm1.Input
error here ===>> ShowData txtTerm, (StrConv(Buffer, vbUnicode))


If LCase((StrConv(Buffer, vbUnicode))) = "b" Then trapsig = True
If trapsig Then
bootmsg = bootmsg & Buffer
charcnt = charcnt + 1
End If

If charcnt > 4 Then
If LCase((StrConv(bootmsg, vbUnicode))) = "boot" Then
Call bootbuddy
trapsig = False
bootmsg = ""
Command1.Caption = "BootLoader Trap Disabled"
Else
bootmsg = ""
Command1.Caption = "BootLoader Trap Disabled"
End If
End If
Loop

**********************************************************

I've tried a variety of things to inclued:

1. Install the ActiveX Control Pad for FM20.DLL(SP?) problem.
2. Initialized the common controls on form load. (InitCommonControls)
Private Declare Sub InitCommonControls Lib comctl32.dll"()
3. Used PDW to install executable locally.
4. Compiled the executable to PCode and Native

Any help will be greatly appreciated and I will post more code on request.

Steve

Error Message &"Memory Cannot Be Read&" After Run Macros In Word.
Hi,
I have a word template which is composed of a series of macros to create documents with standard format. However, after I execute those macros, I will get error message about memory allocation problem such as "The instruction at xxxxx referenced memory at xxxxx. The memory could not be read. Click OK to terminate the program. " in windows 2000 or page fault error in windows 98.
I would like to know how I can solve this problem by (maybe) redoing the macro or by other solution. I don't have a clue where should I start. Please could somebody help me? Thank you.

I Use HOVERBUTTONS And On RUN TIME MODE, There Are Times Where An Error,&"OUT OF MEMORY!&"..
Hi, I'm new here and a newbie on programming VB ver 6.0 ... i am from the philippines and on my way to understanding the basic foundation of VB ... I am currently programming a system ... with this, I am using a HOVERBUTTON as one of my object tool ... whenever I run the program , while on RUN MODE/RUN TIME, there are instances that the compiler gives a message,"OUT OF MEMORY", can you tell me what's the main problem ? ... On my form, I use BITMAP pictures as my background .. and on the part of my COMMAND BUTTON TOOLBARS, I always insert a PICTURE BITMAP on each of them. Attached is an OUTPUT FORM of my system ...

&"Out Of Memory - Too Many Global Symbols , Constant And Variables &" Error In VB 3.0
I am facing some problem in Compiling a VB 3.0 project . When I try compliling the project then I am getting the following error -

"Out of Memory - too many global symbols"


Apart from this , another error that I am getting that says -
"The *.FRM files cannot add any more lines of code" . ( the exact words may be wrong - but this was the intent of the Message )


I have observed that I get these error if I try to add some EVENT HANDLERS , SUBROUTINES or FUNCTIONS to a *.FRM file .


I have never faced these problems while working on small sized VB 3.0 projects but for large sized projects as this particular one ( 4.25 MB - 28 FRM files & 25 BAS files) this problem is easily reproducable ( is it that in VB3.0 there is a limit to the size of code that we can add in *.FRM files for large sized projects )

I was building my project by keeping all the source files ( FRM , FRX , BAS ) and the MAK file directly under c:/ ( Root directory ) - but still I am facing this problem .
Even Restarting the System , trying it out in different machines & different O.S ( WIN 95 , WIN NT & WIN 2000 ) gives the same problem.


Can someone help me ...........

A &"GOOD&" Visual Basic Guide
hey peeps

i was wondering if anyone knew of a good tutorial website for newbys in visual basic

something online, which is free, as i dont have the money to afford a £30/£40 book right now.

i just want something to show me how i can load forms in the same window using a command button
then pass variables from a form to load a application on the users os

and also to store some basic config files in a inf/cfg file in an installation directory

if no such tutorial exists i would gladly apreciate any help or pointers on how to achieve this goal

thanks very much

Comms

Does There Exist A &"visual Basic Introductory Ed&"?
hi all.

ok, so far i've got visual basic 4.0 standard edition which i bought some years ago and never used till now.
but there are some really helpful codes missing in this old win95-package, so i wondered if there exists an "introductory edition" of visual basic 6 or .net like there exists one of visual c++ 6?! dont wanna buy a new version right now, maybe later.
the introductory edition should have all the basic codes and possibilities, the one i have from c++ 6 only shows a message box at the start of every compiled .exe that it was created with the introductory edition and isnt allowed to be distributed or sth like that.
anyone knows where i could get such a version of vb6/.net?

thx for answers!

j0sh

&"Advanced Visual Basic 6&" Vista Fix
Anyone who owns a copy of "Advanced Visual Basic 6" by Matthew Curland and is running Windows Vista probably noticed:
The VBoost dll stopped working.

Turns out that whilst registering, the dll allocates a string buffer then fills it and adds that to the registry. No problem of course, but Vista tries to read the whole string and doesn't stop at the null terminated char!
To verify, open regedit and go to the CSLID and then select 'view binary data'

Anyway, here's a simple fix
Add this to a .reg file and doubleclick.
It simply re-adds the key overwriting the 'corrupted' string.


Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTCLSID{20708EE2-24E3-11D3-AB5C-D41203C10000}InprocServer32]
@="C:\Windows\System32\VBoost6.dll"
"ThreadingModel"="Apartment"
P.S.
I know this is not be the place to post these kind of fixes, but considering there are many true hardcore vb people here and this book is considered some sort of VB6 bible by many of them, I thought I'd share after figuring this all out.

Visual Basic Problem &"Do Without Loop&"
Okay i've got this piece of code thats not working. Each time i run it it says, do without loop.


VB Code:
Private Sub Form_Load()    Dim Day As Date    Dim Correct As Boolean    Dim index As Integer        Correct = False    Do While Correct = False        Day = InputBox("Please enter todays date, in this fasion 01/01/2006")        If Len(Day) <> 10 Then            MsgBox ("The date you entered wasn't the correct length, please reenter it")        Else            Correct = True        End If        Do While index <> Len(Day)        If Mid(Day, index, 1) > Chr(64) Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "!" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "@" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "#" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "$" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "%" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "^" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "&" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "*" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "(" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = ")" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "_" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "-" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "+" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "=" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "|" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "?" Then            MsgBox ("Dates don't contain letters")            Correct = False        ElseIf Mid(Day, index, 1) = "|" Then            MsgBox ("Dates don't contain letters")            Correct = False        Else            Correct = True        End If        Loop            Extra(1).TodaysDate = DayEnd Sub


Now i've checked to see if the loop was in an if satment, but its not.

So can anyone help me?

&"Algorithmic File I/O In Visual Basic&"
Is it possible to do this? For example, I have a standard format
TEXT file which looks like this:

Date, ColumnA, ColumnB, ColumnC, ColumnD...
1/2002, 10, 25, 5, 7...
2/2002, 20, 50, 10, 14...
3/2002, 30, 75, 23, 15...
4/2002, 45, 9, 11, 27...
5/2002, 3, 22, 17, 54...

Then, recreates an output file ("deleting ColumnA"):

Date, ColumnB, ColumnC, ColumnD...
1/2002, 25, 5, 7...
2/2002, 50, 10, 14...
3/2002, 75, 23, 15...
4/2002, 9, 11, 27...
5/2002, 22, 17, 54...

it is basically deleting the column which immediately follows
the Date column (in this example).

GOOD LUCK & THANK YOU!

How To &"Map&" A Network Drive Using Visual Basic
I have written the following VBScript program. It is stored into a
file "map_drive.vbs". It successfully mapped to a network drive
\server1data.

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
sPwd = inputbox("Enter password")
WshNetwork.MapNetworkDrive "J:", "\server1data", false,
"xyz_netJohn", sPwd
Msgbox "Drives has been map successful"

Could anyone teach me how to convert it to a Visual Basic program such
that it can be compiled to an .exe file?
I tried to use Active X Control – Windows Script Control 1.0. But I
couldn't make it work. Perhaps, I do not know how to use the Script
Control, or it is a totally wrong approach. It will be nice if you can
give Step-by-step instructions.
Please help. Thanks a lot.

Can I Still Buy &"Visual Basic 6 -Enterprise&" From Microsoft?
I have the student version of Visual Basic 6. Unfortunately ,as much as i know it is not allowed to write commercial code with it. So i want to buy the Visual Basic6 enterprise version. Do you know where i can find it ? I search and it was out of stock.
Will Microsoft sue me if i write a commercial shareware application
with my student edition ?

thanks !

&"Out Of Memory&" Error Using Excel Sheet Component
I'm getting an "Out of Memory" error when trying to access an Excel object. I've added a reference to "ExcelCtl Type Library" which adds an Excel component to the Toolbox. I add this component to my form. Now any time I try to access the componenet via code (i.e. Ole1.object) I get the "Out of Memory" error. Any help with this is greatly appreciated.

Crystal Report &"Memory Full&" Error
hi,
I am using Crystal Reports 8.0 . When I try to print 2 reports one after the other from VB 6 i get the error "Memory Full" . I then have to close the form and load it again to print the other report.
What is the problem ?

Thanks

If I Use "SaveSetting App.Title, "Settings", "Font", "001122"" - Save Date In The Registry, Where Ca
If i use "SaveSetting App.Title, "Settings", "Font", "001122"" - save date in the registry, where can i find the value saved in the registry? Thanks

Corrupt Variables And &"memory Error&"
Hi People

I would REALLY like comments on the following, even if no one can give me a solution!

Further to my other post about Word corrupting variables, I have modified the code, but not changed anything to do with variables i.e. I still use:

ActiveDocument.Variables.Add name:="xxx", Value:=yyy
(where yyy is a value generated by the code)

The new code gives slightly different results i.e. Word crashes with the following message:

Winword.EXE Application Error

The instruction at “0x308e05a0” referenced memory at “0x0182a27a”. The memory could not be “written”. Click OK to terminate etc.

Note this is NOT my code, it is Word. I understand this message appears when Word tries to access a memory area where it is not allowed i.e. Word wants to save my variables where it shouldn’t. My previous post’s error description ties up with this, as it is obvious that Word is not sorting the variables out properly.

Sorry, I should have said this only occurs at work on 4 computers, using XP, NT4, Win2000. Three computers at home (XP, Me) are all fine.

Some more interesting things:

I transferred the dot file with the code to a work’s machine, double clicked on it, Word opened. Even if I don’t run the code (or even touch any key!) when I close Word I get the above error message. I close Word, but the computer is stuffed and I have to restart (so much for Win 2000 stable memory management!).

With great difficulty (this long post would be much worse if I went into all that!) I have added my code to two of the work’s computers. I did this by commenting out the “variable add name lines”, opening the dot file, going in to VBA and copying over the code/form to the normal.dot template. Save VBA, close Word. Open Word, remove comments from variable line, save VBA. Code works fine (yes, it all works perfectly). Opening documents I have made on other machines reveals the correctly stored variables!

Thus, the mere presence of the “add variable lines” will cause a crash (i.e. without compiling or running), unless they are “made” in the machine that then runs the code.

The only differences between work and home is home has Office 2000 SP3 and I think work SP1. Work is also networked.

Someone commented that similar problems occurred with Office 97, but surely 2000 (all versions) has it sorted??

I don’t fancy personally visiting all the computers I was hoping this would be used on to carefully integrate the code!!!

Skeletal

Excel VBA Error &"memory Could Not Be Read&"
Dear friends,
I have the simplest of the forms I created using VBA in excel. The file is attached for reference.
It works fine. The problem arises when I close the file after I have run the form 6-7 times.
I get the error "The instruction 0x0202a877 referenced memory at 0x0202a877. The memory could not be read"
Please suggest what I should do to get rid of this error.
Thanks a bunch

Clipboard.GetData Gets &"Out Of Memory&" Error
To All:

I have a program which captures a graphic image currently in the clipboard and saves it to a file. Most of the time it works perfectly. Occasionally, the image which has been copied to the clipboard is quite large. When the image is large, I sometimes get an "Out Of Memory" error. The statement having the problem is:

imgSave.Picture = Clipboard.GetData(vbCFBitmap)

I've isolated the problem further to just:

Clipboard.GetData(vbCFBitmap)

What is causing the problem? I can manually paste the image into word, etc., so I know that it is sitting in the clipboard (in fact, my program checks to make sure the clipboard is containing an image)

On a couple instances where it failed, I rebooted the system and it worked, but I have one example where no matter what I do, it still has the "Out Of Memory" problem ...

FWIW: I have 1.5GB of swap, 1GB of memory and not a lot going on with the machine and I still sometimes get the error.

Any help would be greatly appreciated.

Thanks in advance,

Jim

How To Trace VB6 Error &"memory Could Not Be Read&".
From a few (not all) of my clients, I'm getting the old:

The instruction as "0x..." referenced memory at "0x00000000". The memory could not be "read".

This is an OS trapped error and not a trapable error in my VB6 app. Which usually indicates some dependancy (DLL) along the way is not installed or registered correctly on the client machine and/or that DLL has crashed and failed. I'm not able to reproduce in my dev environment so I'm certain this is a deployment/install problem -- aka DLL Hell.

Is there any tool I can install on my client PC to help me trace more specifically what the trigger is for this error? About the only other option I can think of is to hard code a trace option that logs every method function that is entered to a file (a huge file at that).

If someone knows of any tools that can help with situations like this, please let me know.

Thanks, Rob.

MS Word App, Memory &"read&" Error
I was commissioned to write a VB6 App that takes an ASCII data file, parses it then create a MS Word file.
I got it working perfectly with the help of some people here.

I sent a demo to by the buyer who says it works in his comp.
But when he sent it to his users they report this error:

Code:
TidesToMSWord.exe Application Error
The instruction at "0x00000000" referenced memory at "0x0000000". The memory
could not be "read"
Click on Ok to terminate the program
Click on Cancel to debug the program


Checking on this type of error I've found these possibilities:
1. Users comp has a bad memory stick
2. Users comp has a virus
3. Users OS is corrupt
4. A required component is missing.

Could there be more causes?

I'm looking at the only one I can do anything about, number 4.

Could they be getting this error because they don't have the needed VB6 files?

I'm programming on WinXP with OfficeXP.
The buyer says that he and his users have Win2k and Office2K.

The application is using the Microsoft Word 10.0 Object Library.
Is that lib compatible with Office2K?

If it isn't, my only other choice is to recompile on a comp running Word97 with the Word 8.0 Object Library.
And I've already found problems converting the code.

Would the Word 8.0 Object Library work with Office2K?
Should I fight my way through changing the app or have the buy check his comps for the 1st three possibilities first?

Any info/ suggestions are welcome.

&"REferenced Memory Can Not Be Read&" Error
Can anybody tell me what this error eans and how I can debug it?

Compile Error &"Out Of Memory&" *Resolved*
When I try to compile my project it goes fine until it get's to the "Writing EXE" pahse and it says "Out of Memory". I think this is because I have alot of images in my project. Does anyone know how I can get around this?



Edited by - msg555 on 5/10/2004 12:30:16 PM

ExcelCtl Object - &"Out Of Memory&" Error
I'm getting an "Out of Memory" error when trying to access an Excel object. I've added a reference to "ExcelCtl Type Library" which adds an Excel component to the Toolbox. I add this component to my form. Now any time I try to access the componenet via code (i.e. Ole1.object) I get the "Out of Memory" error. Any help with this is greatly appreciated.

Getting "Out Of Memory" Error With Database Operations...
After I Add a record, populate it with a string, and Update it, and when I click on my new record in my DataList, I get an error saying "Out of Memory". I have two tables that are linked by an AutoNumber field. Can anyone figure out why I am getting this error? It is not my computer that is out of memory, just an error within VB. Thanks!

Please &"To Put Gifs In Visual Basic&"
I have some gifs to put in my project at Visual Basic....but i don't know how to put...and they HAVE TO MOVE!!!TO ANIMATE!!!i tried to put in a normal way...propieties...picture...blablabla...but...didn't work...they did go...but DIDN'T MOVE...


PLEASE...WHAT CAN I DO??...WHAT I HAVE TO DO???....IF SOMEONE KNOW...PLEASE...I HAVE TO FINISH MY PROJECT AND I HAVE TO DO IT MORE QUICKY!!!



THANKS!!!

HOW TO USE &"F2&" FUNCTION IN VISUAL BASIC
[highlight=VB] I Can't Understand How To Use The "f2" Edit Or
The Double Click Feature In A Macro

When I Use "macro Record" It Just Comes Back With The Actual Number I Entered After Using F2 To Add 7 Days Into A Date Field

My Real Goal Is To Goto A Cell That Has A Date In It And Update It By +7 As To Go From
W/e 10/14/06 To 10/21/06

I Use =39004 (that Is 10/14/06) In That Cell And Then Wish To Update It To =39004+7 ( That Is 10/21/06)

Visual Basic &"Addon&" ?
on another visualbasic forum i noticed an eye-catching post, which is:

Quote:





There *IS* an addon for Visual Basic that allows you to compile native DLLs, or if it's ActiveX DLLs with exports.





but i can't find it. anyone know or ever heard of this?

Copyright © 2005-08 www.BigResource.com, All rights reserved