HBP 3.0 rddRegister yields error 9004 in ported Clipper app

184 views
Skip to first unread message

F McKenney

unread,
Apr 5, 2014, 5:23:55 PM4/5/14
to harbou...@googlegroups.com

Stop me if you've heard this one...  I'm attempting to port a customer written in Clipper (plus a few libraries) into Harbour and running into problems.

Background: The customer app, last modified in 1999, currently runs under WinXP and is experiencing intermittent DOS Error 5 hiccups. ( At one point it seemed to be a conflict with an old virus checking program, but that's less certain now. ).  In order to figure out where the problems are coming from I need to make what would normally be a few minor changes; unfortunately -- it's never easy, is it? -- I'm working with uncommented source code recovered from the EXE file and with a limited exposure to Clipper and xBase. Until I can achieve compilable source code that will create a 32-bit equivalent of the original program, I can't make any changes.

At this point I have successfully installed the Harbour Project 3.0 distribution on a fresh new Windows 8 (Gack!) machine.  After some effort (mostly writing "wrapper" functions which convert the truncated function names into the longer names which Harbour recognizes) I have a set of roughly 30 source code files which compile without error. (Yes, I'm painfully aware that that isn't the same as "working". <grin> )

Unfortunately, as soon as the app attempts to issue this call:

   rddRegister("DBFCDX", 1)

the app dies with these messages:

  Unrecoverable error 9004: RDD invalid or failed to load
  Called from RDDREGISTER(0)
  Called from RDDREGISTE(83) in hb_wrap.prg
  Called from MAIN(233) in hb_grant_main.prg

( These messages also get written to the app's error log, so at least some of the code I've ported executes as expected.... okay, as hoped. )

What's frustrating is that the code is blowing up so early on, even before -- as far as I can tell -- any application files are opened.  If the app were dying on, say, the first file read this would make much more sense; I wouldn't necessarily understand the cause, but at least I'd recognize it as some sort of setup problem for the files.

Can anyone offer any suggestions on what sort of Harbour-new-bee error might cause this? (Or even a hint that I might be asking the wrong question; it has happened before. )

For what it's worth, the original Cliper app invoked (at least) these libraries:

  HP Pro printing library
  FlexFile
  FUNCky
  ? something called "Six Driver" ?

I think I've found equivalents for all the functions I recognize as being from the FUNCky library functions, and I'm -- for now -- ignoring the HP  printing. I also realize that, once FraI get past the rddRegister() problem I'll have to figure out how to deal with some other file-access routines:

  v_superrdd("DBFCDX")
  rddregiste("FLEXFILE", 1)
  rddregiste("FXDBF", 255)


but that's for another day.

The HBP file for hbmk2 has the following parameters:

#####
-b
-otest.exe
-request=DBFCDX
-main=Main
-w0
-es2
-rebuild
-lhbnf
-lhbct
# RDD support: try throwing in everything
-lrddbm
-lrddads
-lrddcdx
-lrddfpt
-lrddnsx
-lrddntx
-lrddsql
#####


Suggestions, comments, and even a bit of pointing-out-the-obvious will be appreciated.


Frank McKenney
McKenney Associates

Francesco Perillo

unread,
Apr 6, 2014, 2:13:16 AM4/6/14
to harbou...@googlegroups.com

Interesting project!

I'd add this line to the source code:
Request dbfcdx

Use harbour from nightly build, 3.0 is quite old.

F McKenney

unread,
Apr 6, 2014, 3:37:50 PM4/6/14
to harbou...@googlegroups.com

Thank you for taking the time to respond.
"Interesting" is definitely the right word. <grin!>
 
Previously I had a REQUEST DBFCDX statement in the PRG file where the rddRegister() was issued, and the error 9004 still occurred.

I then noticed the 'hbmk2' option   -request=DBFCDX   which -- assuming I'm reading the documentation correctly -- should have the same effect. And it does have the same effect: I see the same error 9004. Sigh.

As for building Harbour Project from source, I found this short 2012 tutorial written by Giovanni Di Maria that makes it look fairly straightforward (famous last words):

  How to build HARBOUR from source in 10 minutes - Tutorial

  http://www.elektrosoft.it/tutorials/how-to-build-harbour-for-windows/how-to-build-harbour-for-windows.asp

I may give it a shot this afternoon.


Frank

Francesco Perillo

unread,
Apr 6, 2014, 4:04:35 PM4/6/14
to harbou...@googlegroups.com
Have you tried to just remove that line ?

Go here, click on Browse all files, binaries-windows, nightly and download a full version of latest harbour.




--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

F McKenney

unread,
Apr 6, 2014, 5:02:14 PM4/6/14
to harbou...@googlegroups.com


On Sunday, April 6, 2014 4:04:35 PM UTC-4, fperillo wrote:
Have you tried to just remove that line ?

Go here, click on Browse all files, binaries-windows, nightly and download a full version of latest harbour.

Wow! That was a quick reply. <grin!>

I removed the -request=DBFCDX parameter from my HBP file and it made no difference that I could see.

I appreciate your effort to point me at a more current binary. Unfortunately, my browser (Firefox) does not appear to be able to display the link from "here". Can you include the link in text form?

Thank you.

Frank

Qatan

unread,
Apr 6, 2014, 5:15:33 PM4/6/14
to harbou...@googlegroups.com

F McKenney

unread,
Apr 6, 2014, 10:13:10 PM4/6/14
to harbou...@googlegroups.com
Qatan,

Thank you for joining in.


On Sunday, April 6, 2014 5:15:33 PM UTC-4, Qatan wrote:

I was able to download and install this without difficulty. ( It helped that I remembered to update the PATH setting to point to c:\hb32\bin. )

The good news is that the "nightly build" version works at least as well as the hb30 version, and might even be a bit faster.

The bad news is that my error -- other than the line numbers -- is unchanged:

  Unrecoverable error 9004: RDD invalid or failed to load
  Called from RDDREGISTER(0)
  Called from RDDREGISTE(83) in hb_wrap.prg
  Called from MAIN(255) in hb_grant_main.prg

Adding -request=DBFCDX to the HBP file or removing it made no difference.
 
Adding REQUEST DBFCDX to the PRG file or removing it made no difference.
 
Adding  #include dbinfo.ch  to the PRG file made no difference.

It feels as though I'm missing something extremely simple and obvious. I just have no clue as to what it might be: installing in c:\hb32, running 64-bit Win8-Home, forgetting to sacrifice a chicken at the full moon..

Even worse, it will shortly be Monday. Sigh.

I need to take a break think about this a bit more.

Thanks for all the help, everyone.


Frank

elch

unread,
Apr 7, 2014, 12:49:40 AM4/7/14
to harbou...@googlegroups.com
Hi Frank,


Even worse, it will shortly be Monday. Sigh.

Mondays are good days to fix such ;-)

RDDregister() is used by developers, who *create* new <R>eplaceable <D>atabase <D>river --- complex guru area.

A guess: you just want to set the default driver ?

Therefor e.g. RDDSETDEFAULT( "DBFCDX" ) is used.


This '-request=xyz' is a linker switch:

which RDD(s) should be linked to your executable, so that it later can be used e.g. for the DbUseArea() function -- see second parameter:

http://x-hacker.org/ng/53guide/ng3575a.html


HTH, regards

Rolf


Francesco Perillo

unread,
Apr 7, 2014, 2:29:09 AM4/7/14
to harbou...@googlegroups.com

Remove rddregister line....

Reply all
Reply to author
Forward
0 new messages