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




Old Question, But Help, Memory Could Not Be "read"


OK, this is really pissin me off, and i know u all have seen this before.

First off, i have:

VB6 32bit Version 8176

When i open a project and do object view, it crashes, When i add an About form, it crashes, and those are the only 2 instances where i know it WILL crash. Other than that, it crashes so many times i can not complete ANYTHING!

It says the memory could not be "read"

ive read some things, but i never find out how to fix it, HELP ME ASAP plz....


THNX




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder
Hi

[I had to repost it since I have not received any replies for my earlier post]

I have a problem.

Following is the code :

Shell("c:windowscommand.com /c type " & App.path & "matrix.txt >prn")

where App.path is C:XYZ

when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.

So, to find out why, I modified the line thus.

Shell("c:windowscommand.com /K")

The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt >prn", which is what the vbcode does, I get the message "file creation error".

So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?

Thanks for reading through.

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.

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

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.

VB6 SP6 "Memory Cannot Be Written/Read Errors"
I am getting these errors (VB6 SP6 "Memory cannot be written/Read Errors") and crashes in VB6 SP6 IDE, I am unable to work , can anybody help me with this.

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

The Memory Could Not Be "read" - Error
Hello
I'm writing some VB code in outlook VB editor.
I've added one simple thread to the project, and it sometimes couses an error:

The instruction at "0x.." referenced memory as "0x..". The memory could not be "read".
Click on OK to terminate the program
Cancel to debug..


The error doesn't occur all the time i try to run the thread, but some times...

What can be the reason?

Thanks,
anastacia

How To Read Memory For "Text"
Hi all


This code,using readlong,writelong.
Property: Long

I need there a readtext memory.

Long OK,Byte OK,... OK,but I dont read "Text Values"

How to do this?

Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

'||-------------------------------------------------------------------------------------------------||
'|| The two next functions readwrite LONG values. ||
'|| LONG is a 32-bit(4 byte) datatype and can store values from -2,147,483,648 to 2,147,483,647 ||
'||-------------------------------------------------------------------------------------------------||

Public Function ReadLong(Offset As Long, WindowName As String) As Long

Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
Dim Value As Long

'Try to find the window that was passed in the variable WindowName to this function.
hwnd = FindWindow(vbNullString, WindowName)

If hwnd = 0 Then

'This is executed if the window cannot be found.
'You can add or write your own code here to customize your program.

MsgBox "Run The Game First!", vbOKOnly, "Error Reading Game"

Exit Function

End If

'Get the window's process ID.
GetWindowThreadProcessId hwnd, ProcessID

'Get a process handle
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)

If ProcessHandle = 0 Then

'This is executed if a process handle cannot be found.
'You can add or write your own code here to customize your program.

MsgBox "Could not get a process handle!", vbCritical, "Read error"

Exit Function

End If

'Read a LONG from the specified memory offset.
ReadProcessMem ProcessHandle, Offset, Value, 4, 0&

'Return the found memory value.
ReadLong = Value

'It is important to close the current process handle.
CloseHandle ProcessHandle

End Function

Public Function WriteLong(Offset As Long, WindowName As String, Value As Long) As Boolean

Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long

'Try to find the window that was passed in the variable WindowName to this function.
hwnd = FindWindow(vbNullString, WindowName)

If hwnd = 0 Then

'This is executed if the window cannot be found.
'You can add or write your own code here to customize your program.

MsgBox "Run The Game First!", vbOKOnly, "Write error"

Exit Function

End If

'Get the window's process ID.
GetWindowThreadProcessId hwnd, ProcessID

'Get a process handle
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)

If ProcessHandle = 0 Then

'This is executed if a process handle cannot be found.
'You can add or write your own code here to customize your program.

MsgBox "Could not get a process handle!", vbCritical, "Write error"

Exit Function

End If

'Read a LONG from the specified memory offset.
WriteProcessMemory ProcessHandle, Offset, Value, 4, 0&

'It is important to close the current process handle.
CloseHandle ProcessHandle

End Function

Read From Textbox Into "'", Text9.Text, "'", Dont Works
HI

I am traint to read from Text9.Text and this dont works ????

On Error Resume Next
Dim Text7 As Long, editx As Long
Text7 = FindWindow(",text7.text,", vbNullString)
editx = FindWindowEx(Text8.Text, 0&, "'", Text9.Text, "'", vbNullString)
Call SendMessageByString(editx, WM_SETTEXT, 0, Text1)

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

The Memory Could Not Be "read"
Hi,

I created a visual basic program using a webbrowser control and it happens to crash my program alot.. the dll is ole32.dll and it gives me this popup saying

The instruction at "0x7d532a99" referecned memory at "0x0000001". The memory could not be "read"

and then the program dies a painless death( so I hope :P ). Now it's not in a specific area.. it's very random.

Anyone know any clue where I could even begin to start debugging??? or help in understanding what is going on..

Thank you!!

The Memory Could Not Be "read"
Danio, tell me, did u use a line like this in your code:

while web.busy = true

Let me know!

The Memory Cannot Be "read"
Does anyone else get the above error? I get it frequently in VB at design time. It never occurs at run time or in exes. The full message is:

"The instruction at "0x2734535b" referenced memory at "0x00000004". The memory cannot be "read". Click on "OK" to terminate the program."

So I have to close VB, losing anything that I haven't saved. I'm finding this very frustrating, and have even tried reinstalling VB, but with no success. I was wondering if anyone had any suggestions as to how to cure this.

The Memory Could Not Be "read"
Some times when we are running the application in visual basic we get the error message "The memory could not be read" and the application terminates how to fix this problem

Memory Could Not Be "read"
Hi Group,
I have a strange error in my VB.
When I add a control (textbox, label etc) to a form and I save the form, I can not close the form or reopen the project.
I get the errormessage:
"The instruction at "0x004581f1" referenced memory at "0x00000000". the memory could not be "read""

Last month everything worked OK. I have reinstalled VB, but still problems.
Any clues? Thanks in advance!

Open "Read Only" Word Doc As In "Non Read Only" Mode
I have a bunch of "Read Only" word documents that the user has to choose from to open and edit. Since they are read only, upon opening the file I need to change the mode so the document can be saved with the same title. I found an entry by doing a search in this forum but I can't get it to work. This is the code I found.

Code:
wdApp.Documents.Open filename:="C: est.doc", ReadOnly:=True
This is how I am trying to use it with my code. It is giving me the following compiler error:
Expected: end of statement.

Code:
Dim objWdApp As Word.Application
Dim objWdDoc As Word.Document
Dim objWdRange As Word.Range
Set objWdApp = New Word.Application
Set objWdDoc = objWdApp.Documents.Open(DocPath), ReadOnly:=True
Thanks for any help you can give!

gfolz

How Do You Read "smells" And "scents" On Your Computer?
I thought you guys might be interested in the answer.
http://www.digiscents.com

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.............

Grant "List Folder Contents" Instead Of "Read" Permissions On Folder
We can grant a user to "List Folder Contents" by manually editting the Security settings, but if we want to do so with CACLS command, we can only grant "Read" (minimum) permissions to the user.
e.g.
C:>cacls c: est /T /E /C /P Guests:R

How can we grant a user to "List Folder Contents" programmatically?

Method "SaveAs" Or "Save" Of Object "Excel.Workbook" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I don´t find anything.
Any ideas.
Thanks for your time
Jaime

How To Replace "Apple" With "Banana" In A String That Contains "Orange" In A TXT File
Whoa! Long thread title. Basically, how can I search for any string in a text file that contains "Orange", then replace "Apple" with "Banana" in that same string? Is this difficult? Thanks!

Data1.RecordSource = "select * From Salary Where 姓名 Like " + S + " " * ""
Data1.RecordSource = "select * from salary where 姓名 like " + s + " " * ""
thanks in advance gentlemen and ladies..
firstly...I don't know what must add "++" between "s " variant..
who can tell me why?? thanks , ,, I really don't know why it does this..
maybe i am a beginner..please forgive me why add ++ between s..thanks

How To Change Boolean Field From Displaying "0" And "-1" To "Yes" And "No"
Hey there,

I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".

How can I change this so it displays "Yes" if true and "No" if False?

Would be really grateful for any help.
Thanks.

Extract Local Names For "OK", "Cancel" And "Apply"
Hi!

I noticed that some programs written in C++ have an English language, but the captions of the buttons "OK", "Cancel" and "Apply" are in German, Swedish or whatever localized Windows version the user utilizes. Any idea how to obtain the captions of those buttons in VB? The only method which comes into my mind is to get the locale ID and have an array with strings for the the various language versions, but I doubt that those programs do it in that way.

Regards,
Sebastian

<input Type="submit" Name="op-savefile" Value="Save"> - How To S
<input type="submit" name="op-savefile" value="Save"> - How can you submit this button through visual basic in a webbrowser?

Disabling "wake Up", "sleep" && "power" Button
hello there, how to disable "wake up", "sleep" & "power" button with visual basic? thanks

Getting The File "Type" Descriptions (i.e., "doc" = "Microsoft Word Docume
Hello there,
I am creating an Explorer-type Listview to display the files in a directory, and one piece of info I need to know how to obtain is the file "type" (i.e., "doc" = "Mircosoft Word Document", "xls" = "Microsoft Excel Worksheet", etc.). Is there an API, or does anyone have a technique to do this? Thanks.

Changing The "title" Of A VB Created Word Doc From "Document1" 2 "BadgerBai
Ok, when I create a new word doc it automatically takes on the name "DocumentX", where X is a number greater than 1.
What I want to do is change this by using something like:

VB Code:
Dim objWoof As New Word.ApplicationDim objGrowl    As Word.Document    Set objGrowl = objWoof.Documents.Add    objGrowl.[What Property] = "Badger Baiters R Us"

Is this possible?

Oh, and b4 anyone mentions it, I do NOT want to save it, that is NOT an option...just getting that out the way now

Rarararrrrrrrrr

Woka

Resubmitting: "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
----- Original Message -----


From: shankar [ babu ]


To: visualbasic-l@OpenITx.com


Sent: Wednesday, February 26, 2003 12:24 PM
Subject: "BeginTrans" , "CommitTrans" and "Rollback with dataenvironments



hello everybody,
I am using data enviroment designer in my project.


I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties



kindly let me know the solution
thanks in advance
bye
shankar

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

VB6 Memory "leak" When Calling An Oracle Stored Procedure?
Hey,

I would appreciate some help on this one, if possible...

When I call an Oracle 9i stored procedure that returns a REF CURSOR from VB6 I get what seems a memory "leak". Memory is allocated by the .exe to hold the recordset but is not immediately released when the recordset is closed, as expected. Give the machine a half hour or so and the memory alloacted to the exe will slowly drop to normal. However, I require immediate memory deallocation as we're talking about big recordsets of 100s of Megs. Interestingly, if I don't use the Stored proc and query the table directly using a "conn.Execute" then memory will be allocated and then instantly deallocated as per normal.

-------------------------------------------------------------------------------

---Stored proc (returns a large recordset)---

TYPE csResultSet IS REF CURSOR;

PROCEDURE Test (outCursor OUT csResultSet)
IS
BEGIN
OPEN outCursor FOR ('SELECT * FROM X');
END Test;

--- VB calling code ---

Private Sub Command1_Click()
Dim conn As ADODB.Connection

Set conn = New ADODB.Connection
With conn
.Mode = adModeShareDenyNone
.CursorLocation = adUseClient
.ConnectionString = "Provider=MSDAORA.1;User ID=/; Password=; Data Source = xxx"
.Open
End With

Set rs = conn.Execute("Test")

rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End Sub

-------------------------------------------------------------------------------

I hope someone can give us a clue to what is going on because I'm going around the twist even more than I normally am,

cheers,
James

How To Free Memory Occupied By "LONG Or INT TYPE" Variables In VB?
Hii all,

How to free memory when you have too many "LONG or INTEGER" type variables?

I know you can use "ERASE" command to free memory occupied by arrays. But it does not work for "LONG or INTEGER" type variables.

HDave

Memory Usage Of Different Data Types With "MSGBOX"- Resolved
Does the "MSGBOX" function coerce all values into a Variant String Type?

VB Code:
Private Sub Command1_Click()Dim lngVal As Long, intVal As IntegerDim dtVal As Date, strVal As StringstrVal = "ABCD"lngVal = CLng(12345678)intVal = CInt(1234)dtVal = Now MsgBox strValMsgBox lngValMsgBox intValMsgBox dtValEnd Sub

Do the four "Msgbox" functions use the same amount resources or is "Msgbox intVal" the least resource hungry?

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 ...........

How To Deal With "out Of Memory" Problem When Transfering Data To Excel?
When I read data from excel or write a little data to excel using
Automation, everything is OK. But when I write a lot of data to
excel using Automation, it always causes "out of memory" error.
Anybody knows how to solve this problem? Thanks.

Problem With "Direct Memory Access To Do Graphics" By BillSoo Class BCHPicArray
I am trying to use two Knowledge Base articles to printscreen and then to get color of pixels via Direct Memory Access:

http://www.xtremevbtalk.com/showthread.php?t=11040
posted by Derek Stone

http://www.xtremevbtalk.com/showthread.php?t=25347
posted by BillSoo

So, when I try to use method
BCHPicArray.clsPicArray.ReadPixel(X, Y)
the error rises and array
BCHPicArray.clsPicArray.Data()
is not initialised as the compiler tolds me.
If I set preloaded Picture in Picture1 all is OK.
Maybe, I need first to save the pic on disk, but it is not the best workaround.
So, I do not understand where the memory leak occurs.

--------------------------------------------------------------------------
Dim pa As clsPicArray
Dim ps As clsPrintScreen
Dim stdPic As StdPicture


Private Sub Command1_Click()
Dim X&, Y&, t&

Set stdPic = ps.PrintScreen()
pa.LoadPicArray stdPic
'data() array in clsPicArray is OK now!!!

For Y = 0 To pa.UBoundY - 1
For X = 0 To pa.UBoundX - 1

'HERE is the error comes out,
'data() array in clsPicArray is <subscript out of range>!!!
MsgBox pa.ReadPixel(X, Y)
Next X
Next Y

End Sub
--------------------------------------------------------------------------

I have attached small project for testing the error. You need to switch your display in 16bit mode or 24 bit mode to make it working (original BillSoo class not support 32bit modern videocards).

Please, Anybody, can You look at it and help me?
Thank You.

Can Someone Guide Me On How To "PUT" A "CHECKBOX" Inside A "Datagrid" For VB6.0?
Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?
please i need these to complete my program security....................for my thesis? please please!!Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?

"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

Resolution For "Insufficient Memory" In MSWord 2003
Here's the information I've found on this nag message along with working code.

Initial Problem:
Long-running macros in MSWord 2003 fill up the internal UnDo queue, resulting in "word has insufficient memory" messages at intervals. In my case, the messages came up approximately every 15-30 seconds, turning an unattended batch process into an interactive process.

Solution:
1)Clean out the hidden elements of the bookmarks collection at the beginning of the process. (See the StripHiddenBookmarks macro below.) For my purposes I chose to erase all bookmarks so the routine would start fresh.

2)In some routine that is called fairly frequently, insert the following two commands:

Application.ActiveDocument.UndoClear
Application.DisplayAlerts = wdAlertsNone

In my case, I put the commands in the routine that tests for whether the end of the document has been reached. I've included the code below in case someone finds it useful.



macro from Microsoft

Code:
Sub StripHiddenBookmarks()
Dim i As Long
ActiveDocument.Bookmarks.ShowHidden = True
For i = ActiveDocument.Bookmarks.Count to 1 Step -1
If Left$(ActiveDocument.Bookmarks(i).Name, 4) = "_Toc" Then
ActiveDocument.Bookmarks(i).Delete
End If
Application.ActiveDocument.UndoClear
Next i
ActiveDocument.Bookmarks.ShowHidden = False
End Sub

macro from Bob Price

Function testForEOF(Optional decVal As Long) As Long
'
' Function: testForEOF
'
' Description:
'
' Function returns 0 if we're at EOF, otherwise returns count of
' times to skip this call before next test. If decVal < 0 force a
'full test rather than allowing the more efficient skip test.
'
' Inputs:
' decVal Optional value by which to decrement the counter
'
' Outputs:
' See above.
'
'Notes:
'ctrEOF is a public variable.
'
'Typical Usage:
'' loop to remove trailing spaces from the current document
' Do While testForEOF(-1) <> 0' test every time
'If selection.Text <= " " Then
' selection.Delete
' ElseIf selection.Text > " " Then
' Exit Do ' puppies -- do we need this in some case?
' End If
' Loop
'
Dim xx, rval As Long, curPos As Long, endPos As Long, lval As Long
Dim ctr As Integer, funcName As String
On Error GoTo errLabel

funcName = "testForEOF"
ctrEOF = ctrEOF - decVal - 1
lval = ctrEOF

Application.ActiveDocument.UndoClear
Application.DisplayAlerts = wdAlertsNone
If ctrEOF <= 10 Or decVal < 0 Or (ctrEOF / 1000) = Int(ctrEOF / 1000) Then
curPos = getCurPosition: If curPos = 0 Then curPos = 1
endPos = getEndPosition
rval = endPos - curPos
If rval > 100 Then
rval = rval * 0.05
ElseIf rval < 2 Then
rval = 0
End If
ctrEOF = rval
Debug.Print "endPos - curPos: " & endPos - curPos & ", count til next test: " & rval
End If

exitLabel:
testForEOF = ctrEOF
Exit Function

errLabel:
msgbox "Error in " & funcName & ": " & Error
Resume exitLabel

End Function

A Question For Guru - Special Textbox With "Memory"
Dear All Friends,

I have a special interest in an interesting and useful tricky technique that all you may have come across. The textfields in IE can "memorize" commonly / recently typed texts - when you enter the first few characters, the "combo" will drop a list of strings typed in the past. Then the user can just press Tab to complete the sentence or use the mouse to select a suitable item to complete. That's very convenient. I am building a search form for a client record in a database. I think the user would like this much.

I wonder how can this be done? Are there some special controls available for this purpose or the developer needs to use a file or database to cache all those strings entered in the recent past.

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

Memory "Leak" With Accessing Oracle Ref Cursors From VB6
Hey,

I would appreciate some help on this one, if possible...

When I call am Oracle 9i stored procedure that returns a REF CURSOR from VB6 I get what seems a memory "leak". Memory is allocated by the .exe to hold the recordset but is not immediately released when the recordset is closed, as expected. Give the machine a half hour or so and the memory alloacted to the exe will slowly drop to normal. However, I require immediate memory deallocation as we're talking about big recordsets of 100s of Megs. Interestingly, if I don't use the Stored proc and query the table directly using a "conn.Execute" then memory will be allocated and then instantly deallocated as per normal.

-------------------------------------------------------------------------------

---Stored proc (returns a large recordset)---

TYPE csResultSet IS REF CURSOR;

PROCEDURE Test (outCursor OUT csResultSet)
IS
BEGIN
OPEN outCursor FOR ('SELECT * FROM X');
END Test;

--- VB calling code ---

Private Sub Command1_Click()
Dim conn As ADODB.Connection

Set conn = New ADODB.Connection
With conn
.Mode = adModeShareDenyNone
.CursorLocation = adUseClient
.ConnectionString = "Provider=MSDAORA.1;User ID=/; Password=; Data Source = xxx"
.Open
End With

Set rs = conn.Execute("Test")

rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End Sub

-------------------------------------------------------------------------------

I hope someone can give us a clue to what is going on because I'm going around the twist even more than I normally am,

cheers,
James

Combobox Help """""""""""""'Urgent"""""""&&quo
Hi Guys,,,,,,

This may be the stupid way.But i need this.................

   I am using combobox in my form. I set the style to Dropdown combo.

Here we can exter text in combobox b'coz of the style Dropdown combo.
But i don't want to allow user to enter ......allowed only to select.....

For that i can set the style to Dropdownlist.

But i don't want this style. B'coz i can't clear the text at run time.

Tell me if dropdown combo means, User shouldn't enter at runtime
Tell me if dropdown list means, how to clear the text at runtime...


Pls help me out.....Urgent
sangeetha

"BeginTrans" , "CommitTrans" And "Rollback With Data Environments
hello everybody,
I am using data enviroment designer in my project.


I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties



kindly let me know the solution
thanks in advance
bye
shankar

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

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