Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program crashes as exe but not in design evironment

Status
Not open for further replies.

Motor11

Technical User
Jul 30, 2002
60
US
Hi all,

I am working on a program that reads data from a serial port. I am using a commercial Com-port library (Greenleaf) to poll the port. The program runs fine in design mode but when I try to run the .exe (or an install from the deplotment wizard) the program crashes and returns the following error:

The instruction at "0x66014538" referenced memory at "0x0000000c". The memory could not be "read"

The line of code that I believe causes the crash is when I try to read the port's incoming data buffer using the Greenleaf port-control's "readstring" method.

ie: Data = MyPort.ReadString(max_count)

Data is a string, max_count is a long (I have tried a variety of values for this number with no success).

Is this likely a problem with the 3-rd party library or is there another possible culprit? Has anyone else had a program run properly in the design environment but not as an .exe?

Thanks,
Ryan
 
It sounds to me like you have solved your own riddle. If only using the Greenleaf port-control's readstring seems to cause this, it is possible that that is what is causing the problem.

To me (I've done this type of project for a PBX), it appears that you are experiencing some sort of buffer overflow with the readstring property/function.
 
It's strange that installing the app from a PDW pakage causes the same error. The install program won't be calling the readstring method surely?

Does Greenleaf offer any technical support?

Paul Bent
Northwind IT Systems
 
AkutaSame and Paul,

Thanks for replying. I'm currently framing my question to Greenleaf tech support (and attempting to re-plant the hair I've pulled out this morning).

A little more info: It seems that any method (not just "readstring") executed on Greenleaf's port control causes the problem (but again, not in design mode). I'm 99% sure it's something to do with their stuff.

One thing I do want to rule out however, is that maybe the control is somehow registered on my system incorrectly. Is this possible? If the Greenleaf control wasn't properly registered, the program would also fail in design mode, right?

Thanks again,
Ryan
 
Paul,

I don't think I made myself completely clear in my first post. I don't get a crash with the PD wizard... the program does get installed as expected, but when I run the fully installed version I get the crash.

Ryan
 
How are you doing a dim on the variable data?
Try ....

Dim data as string * 256
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top