I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

August Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCorel Paradox / ObjectPAL Coding BoardParadox Third Party Software, DLLs, and Controls Topic   Print This     

DLL Uses Commands

DLL Uses Commands in Paradox Third Party Software, DLLs, and Controls topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: Commands   DLL Uses   DLL Uses Commands  
Moet
-- USA
Hi,

trying to setup references to DLL file. The DLL has several methods, which i have example code for for Access, VB, ASP not Paradox (surprisingly!) Most of the methods work fine for eg,

Uses afdnn32
GetPostcode(nnRec CPTR, RecNo CLONG, nnFlags CLONG) CLONG
endUses

this method in Access looks like this,
Declare Function GetPostcode Lib "afdnn32.dll" (nnRec As nnRecType, ByVal recNo As Long, ByVal nnFlags As Long) As Long

Not a problem, the problem is the following method, which in MS Access looks like this...

Declare Function FastFindGetFirst Lib "afdnnfind.dll" (ByVal str As String, ByVal oldpcode As String, ByVal pCode As String, addrNo As Long) As Long

In Paradox I have,
FastFindGetFirst(str CPTR, oldPcode CPTR, pcode CPTR, addrNo CLONG) CLONG

the problem with the FastFindGetFirst method in MS Access is the addrNo data type is not declared 'ByVal', my problem is in Paradox I can only seem to declare addrNo as a variable and not a pointer which i think it needs to be.

any ideas appreciated?

Jon
 Posted 13 years ago (Thread Starter)
Comment Quote
About Moet -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #11460, 4 replies
Thread Started 4/28/2006 8:42:00 AM
View Counter=3500
Last Reply Posted 5/4/2006 5:51:00 PM)
Location=-- USA 
Joined=13 years ago   MB Posts=16  
Steve Caple
Steve Caple Company
Sacramento, CA
>> I can only seem to declare addrNo as a variable and not a
>> pointer which i think it needs to be.

If you mean "pass by reference", as opposed to pass by value, you do that in Paradox by making it a var parameter:


method DoThis(var stIn string)
stIn = "Say what?"
endmethod

;; called thusly:
st.blank()

DoThis(st)

st.view()

;; now st will read Say what?

[\CODE]


If that's what you meant.

Steve

Steve Caple
Programmer Analyst
Prestwood Software
http://www.prestwood.com

 Posted 13 years ago
Comment Quote
About Steve Caple -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.
About Steve Caple

Steve Caple I first saw Paradox in 1985 when a guy named Rick Albers came to demo Ansa's new 1.1 release to the Sacramento PC Users Group. The feeling was like going from WordStar to WordPerfect 3.0, a sense of freedom and power.

A long time dBase user had an evaluation copy he let me use for a few weeks.  Going from dBase to Paradox was like finding yourself walking WITHOUT your shoe laces tied together.  I was hooked; within a week I wrote my first useful Paradox DOS program.  It took a few evenings to put together a script to  generate a Basic Bulk Mail sort,  using a series of Paradox queries against a bicycle club Century ride mailing list.  It then used PAL to send text to the printer, printing it out in 5 digit Zip, three digit Zip, and miscellaneous by state groups, including group header labels and spacers on one-across stock  -  just tear it apart at the headers and give it to the mailing volunteers, and a job that used to take 20 people 4 or 5 hours could be done by 5 or 6 in a single hour.  

Later, Paradox for Windows version 5 added many needed structural and indexing and linking features, and as hardware caught up with the needs of a GUI environment it became a powerful database for small companies and divisions or branches within large corporations.  Despite some years of no real changes it remains one of the best products for that purpose.


Post ID #11461 (Level 1.1)  Reply to 11460
Thread Started 4/28/2006 7:00:00 PM
View Counter=2
Location=Sacramento, CA  
Joined=15 years ago   MB Posts=71   KB Posts=3  
Most Recent Post
Steve Caple
Steve Caple Company
Sacramento, CA
I'm glad you found that doc error - I was out of ideas about why it wouldn't work.

Steve

Steve Caple
Programmer Analyst
Prestwood Software
http://www.prestwood.com

 Posted 13 years ago
Comment Quote
About Steve Caple -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.
About Steve Caple

Steve Caple I first saw Paradox in 1985 when a guy named Rick Albers came to demo Ansa's new 1.1 release to the Sacramento PC Users Group. The feeling was like going from WordStar to WordPerfect 3.0, a sense of freedom and power.

A long time dBase user had an evaluation copy he let me use for a few weeks.  Going from dBase to Paradox was like finding yourself walking WITHOUT your shoe laces tied together.  I was hooked; within a week I wrote my first useful Paradox DOS program.  It took a few evenings to put together a script to  generate a Basic Bulk Mail sort,  using a series of Paradox queries against a bicycle club Century ride mailing list.  It then used PAL to send text to the printer, printing it out in 5 digit Zip, three digit Zip, and miscellaneous by state groups, including group header labels and spacers on one-across stock  -  just tear it apart at the headers and give it to the mailing volunteers, and a job that used to take 20 people 4 or 5 hours could be done by 5 or 6 in a single hour.  

Later, Paradox for Windows version 5 added many needed structural and indexing and linking features, and as hardware caught up with the needs of a GUI environment it became a powerful database for small companies and divisions or branches within large corporations.  Despite some years of no real changes it remains one of the best products for that purpose.


Post ID #11464 (Level 1.2)  Reply to 11460
Reply Posted 5/4/2006 5:51:00 PM
Location=Sacramento, CA  
Joined=15 years ago   MB Posts=71   KB Posts=3  
Moet
-- USA
Steve,

Many thanks for your reply. The problem refers specifically to a function within a DLL. From your post I believe the AddrNo variable should be passed by reference, so I have changed my Uses statement to read the following

Uses afdnnfind
FastFindGetFirst(str CPTR, oldPcode CPTR, pcode CPTR, var addrNo CLONG) CLONG
endUses

In my run event the code reads,

var
findStr, oldPcode, pcode String
retVal longint
addrNo longint
endvar

oldPcode = Space(8)
pcode = Space(8)
findStr = "B1 1AA" + Space(2048)
addrNo=1
retVal = FastFindGetFirst(findStr, oldPcode, pcode, addrNo)

When executing this script I am still getting a 'Unexpected: General Protection Error'

I need to know how to pass that addrNo variable by reference to the DLL Uses Function (I think)
 Posted 13 years ago (Thread Starter)
Comment Quote
About Moet -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #11462 (Level 1.3)  Reply to 11460
Reply Posted 5/2/2006 12:56:00 AM
Location=-- USA 
Joined=13 years ago   MB Posts=16  
Moet
-- USA
Steve,

sorted the problem now, turns out the documentation was wrong and the addrNo variable should be declared as a CPTR not a CLONG.

Thanks for your help

Jon
 Posted 13 years ago (Thread Starter)
Comment Quote
About Moet -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #11463 (Level 1.4)  Reply to 11460
Reply Posted 5/3/2006 1:07:00 AM
Location=-- USA 
Joined=13 years ago   MB Posts=16  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1251A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #11460 Counter
3500
Since 4/2/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech