NetTalk Central

Author Topic: Cryptonite in hand coded project  (Read 3441 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Cryptonite in hand coded project
« on: December 01, 2013, 11:42:22 AM »
Hi,

Cryptonite works fine for hashing passwords in an NT app, but our data conversion program is a hand coded project.  When

   include('StringTheory.Inc'),ONCE
   include('Cryptonite.inc'),Once

is put in the data section of the procedure/module in question,  the project compiles but there is an access violation error when it runs.   What are the steps for including Cryptonite in a hand coded project?

Many thanks.


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Cryptonite in hand coded project
« Reply #1 on: December 01, 2013, 09:48:47 PM »
When using a class in a hand-coded project you want to read the INC file to see what DEFINES are required.
In this case CryptoNite.Inc. The line you're looking for is the class declaration;

csError Class(),Type, Module('CryptoNite.clw'),Link('CryptoNite.clw',StringTheoryLinkMode),DLL(StringTheoryDLLMode)

the two defines are listed there;
StringTheoryLinkMode
and
StringTheoryDLLMode

These need to be set appropriately. If this is a "single app" or Data DLL app, then they should be
StringTheoryLinkMode=>1
StringTheoryDLLMode=>0


for other apps in a multi-app suite they should be
StringTheoryLinkMode=>0
StringTheoryDLLMode=>1


** Note ** Cryptonite is using the same settings as StringTheory. This is because of a limitation in Clarion 6. Early next year it will likely change to using it's own defines, so make a mental note to come back and chack when your app starts crashing next time again....

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Cryptonite in hand coded project
« Reply #2 on: December 08, 2013, 02:28:57 PM »
Thanks, Bruce.   I use DEFINES (or as they are now known Conditional Compilation Symbols) a lot in apps,  but this is a hand coded project without an app.   Where do you set the symbol values without an app?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Cryptonite in hand coded project
« Reply #3 on: December 08, 2013, 09:21:57 PM »
same place as you set them when you do have an app.
Project / Project Options / Compiling tab.

cheers
Bruce

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Cryptonite in hand coded project
« Reply #4 on: December 09, 2013, 11:38:59 AM »
Thanks, Bruce.  Sorry, I was looking at the solution IDE menu.   I put

StringTheoryLinkMode=>1; StringTheoryDLLMode=>0 as the Conditional Compilation Symbols, but I am still getting the same run time access violation.  Thanks.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Cryptonite in hand coded project
« Reply #5 on: December 09, 2013, 09:48:22 PM »
You may well have another class in the app with the same problem. Also check the spelling.

cheers
Bruce