If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > General Protection Violation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-04, 03:12
ssanyi ssanyi is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
General Protection Violation

Hi!
I write dll (in c++) for the comunication via serial port. I use Win2000 and Paradox 8 with SP1. Its working whithout problems, but when I exit paradox, I have message "General Protection Violation". Its don't bear whit cominication.
Reply With Quote
  #2 (permalink)  
Old 04-21-04, 08:24
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
When i've tried doing what you're doing, using external DLLs to control serial ports in paradox, i've found that impossible to be reliable, since ObjectPAL doesn't support callback routines, so i reverted to calling directly Win32 APIs from Pdox, and having an hidden form with a timer which polls the port.

If the polling routine is well tuned and only checks for chars in queue with the appropriate win32 call, all will function well and without excessive CPU utilization.
__________________
The only failure is not trying to do it.
Reply With Quote
  #3 (permalink)  
Old 04-30-04, 05:31
ssanyi ssanyi is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
Question

Hi! Thanks for reply. Can you send me an example program?
Reply With Quote
  #4 (permalink)  
Old 04-30-04, 07:01
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
Sure i can; use the attached library.

Code:
var Comm library endvar
Comm.open("Comm32.lsl")

;open the port
;tmplg1 = Comm.OpenComm(port  ,baud,bits,parity,stopbits)
tmplg1 =  Comm.OpenComm("COM2","96","8" ,"N"   ,"1")

;writing a block of text
tmplg1=Comm.WriteComm(CurrBlock)

;trying to read a block
for tmpli1 from 1 to Maxretry
	sleep()
	if Comm.ReadQueueLen()>0 then
		tmpst1 = fill(" ",NumCharsToRead)
		if Comm.ReadComm(tmpst1) then
			CurrBlock = CurrBlock + tmpst1
		endif
	endif
	sleep()
endfor
Attached Files
File Type: zip Comm32.zip (13.9 KB, 139 views)
__________________
The only failure is not trying to do it.
Reply With Quote
  #5 (permalink)  
Old 05-03-04, 09:15
ssanyi ssanyi is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
Question

Hello! I try to use Your program, but I have that same GPV message when I exit it. You tested it with Paradox 8, or Paradox 8 Runtime? My algorith for use your program:
1. Open Library
2. Open com
3. n X Write/Read
4. Close Library
...
5.Swearing
Reply With Quote
  #6 (permalink)  
Old 05-03-04, 10:13
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
I suppose you don't close the port...

1)Open lib
2)Open comm
3) Read/write
4)Close comm
5)Close lib

6) No swearing at all...!!!!
__________________
The only failure is not trying to do it.
Reply With Quote
  #7 (permalink)  
Old 05-03-04, 10:56
ssanyi ssanyi is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
Question

Hi!
I closed the port. But GPW message appears.
Can You send me your paradox forms, or have you any good idea?
Thanks.
Reply With Quote
  #8 (permalink)  
Old 05-03-04, 12:52
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
The only idea i have is that i'm using the library under Pdox 10 SP3 and Windows 2000 SP4...

I don't get no GPF, ever!
__________________
The only failure is not trying to do it.
Reply With Quote
  #9 (permalink)  
Old 05-07-04, 03:57
ssanyi ssanyi is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
Question C++ library?

Thanks for answer. Do you know C++ library for read/write data to Paradox tables.
Reply With Quote
  #10 (permalink)  
Old 05-20-04, 05:28
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
No, but i think you can find info about that if you search for BDE infos on Borland's site: the BDE is the db engind Pdox is based on, and surely you can call directly the BD form your C++ apps, directly accessing Pdox tables.
__________________
The only failure is not trying to do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On