HashLib errors

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
alan1mtnview
Newbie
Posts: 19
Joined: Tue Jan 29, 2008 3:34 am
Location: Mtn View, Arkansas, USA
Contact:

HashLib errors

Post by alan1mtnview » Mon Feb 04, 2008 7:17 pm

Happy, Monday, everybody. I have a problem using Hashlib that is driving me NUTS. I used the code that Marcus posted from this thread:
http://www.mjtnet.com/usergroup/viewtopic.php?t=4330


//Get MD5 hash of a file
LibFunc>c:\program files\macro scheduler\Hashlib,FileMD5,r1,C:\MD5Test\help-windows.jpg,buf1
Mid>r1_2,1,r1,hash1

mdl>hash1



The only changes I made to the code was to the path to the dll and the path to the image file. I keep getting errors on my mid> statement. Am I missing something obvious? I'm on Version 10.018
Thanks,
Alan

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 04, 2008 7:41 pm

Suspect the path to the DLL is wrong. So the result var (r1) is not set (or is an error msg). Step through with the debugger to see what the value of r1 is immediately after the LibFunc line. Or add a message box:

Code: Select all

//Get MD5 hash of a file
LibFunc>c:\program files\macro scheduler\Hashlib,FileMD5,r1,C:\MD5Test\help-windows.jpg,buf1
MessageModal>r1
Mid>r1_2,1,r1,hash1
mdl>hash1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 04, 2008 7:47 pm

Maybe THey are in earlier parTS of your SCripT, buT I don'T See any definiTionS for THe midSTr VariableS: r1_2, and r1.


(Sorry for mixed CaSe Spelling, HaVing a STrange problem on browSerS THaT do noT reSpond To CerTain leTTerS. STHCV...)
Last edited by Bob Hansen on Mon Feb 04, 2008 10:53 pm, edited 2 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 04, 2008 7:48 pm

Bob Hansen wrote:Maybe THey are in earlier parTS of your SCripT, buT I don'T See any definiTionS for THe midSTr VariableS: r1_2, and r1.
r1 is the return var for the LibFunc function. Which if successful would return r1_2 for the buffer.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 04, 2008 7:57 pm

THankS for SHowing me wHaT I miSSed THere, MarCuS.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
alan1mtnview
Newbie
Posts: 19
Joined: Tue Jan 29, 2008 3:34 am
Location: Mtn View, Arkansas, USA
Contact:

Post by alan1mtnview » Mon Feb 04, 2008 7:58 pm

Thanks for the quick replies Marcus and Bob (even though Bob had me worried about my eyesight momentarily).
Thanks, Marcus. I hadn't used the debugger before. A ton of information in there. It did confirm that the dll didn't load, even though I manually copied the dll to the MS dir. Would I need to register the dll with Windows?

Bob, I linked the discussion where I learned about Hashlib. Marcus had answered a question in it with some sample code that I cut and pasted, then altered as described.
Marcus, the code you supplied there is different than the example in Hashlib.txt. Will both of them work?
Thanks,
Alan

User avatar
alan1mtnview
Newbie
Posts: 19
Joined: Tue Jan 29, 2008 3:34 am
Location: Mtn View, Arkansas, USA
Contact:

Post by alan1mtnview » Mon Feb 04, 2008 9:49 pm

OK, it works now, but I don't have a clue as to why. I re-downloaded the library from mjtnet and overwrote the dll. File size and dates on the two files are identical, as is the md5 hash (Irony, anyone?) :P .
I can copy the dll anywhere and point the script at it, and it works normally as well.

It's too early in the week for Windows Weirdities.

Just wanted to let you know I got it working and how, if not why, and that I really appreciate the prompt feedback from both of you.
Thanks,
Alan

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 04, 2008 10:54 pm

Glad you are working Alan.

I was also having one of those Windows Weirdities.

It is now three hours later, and Case problem is gone. No known cause. Did run SpyBot and AdAware and removed some items. Also restarted the Firefox browser. My problem is gone.....no one cares but me. :roll:
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
alan1mtnview
Newbie
Posts: 19
Joined: Tue Jan 29, 2008 3:34 am
Location: Mtn View, Arkansas, USA
Contact:

Post by alan1mtnview » Tue Feb 05, 2008 10:40 pm

Oh, I wouldn't say that. :-) It's a new one for me. Anybody up your way prone to practical jokes? Gotta go, loud storms blowing through, time to unplug stuff.
Thanks again for your input on this.
Thanks,
Alan

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts