Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2004
    Posts
    5

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

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

  3. #3
    Join Date
    Feb 2004
    Posts
    5

    Question

    Hi! Thanks for reply. Can you send me an example program?

  4. #4
    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 Attached Files
    The only failure is not trying to do it.

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

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

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

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

  9. #9
    Join Date
    Feb 2004
    Posts
    5

    Question C++ library?

    Thanks for answer. Do you know C++ library for read/write data to Paradox tables.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •