West Wind Internet and Client Tools
wwEncryption Not working from exe file
Gravatar is a globally recognized avatar based on your email address. wwEncryption Not working from exe file
  PAUL WEISBERG
  All
  Dec 14, 2021 @ 07:55pm

I have a really odd issue. wwEncryption works fine in the Foxpro 9 development environment but does not work from the compiled .exe file. Is it possible there is something else that needs to be distributed? I know this is not a lot of information but I am not quite sure how to explain its not working, it just isn't. When I encrypt a string I am not getting back a string - not sure what I am getting back honestly. Messagebox will not display it.

Gravatar is a globally recognized avatar based on your email address. re: wwEncryption Not working from exe file
  Rick Strahl
  PAUL WEISBERG
  Dec 15, 2021 @ 11:42am

Check the error message and log it. Make sure you're not eating errors and that wwDotnetBridge works in your application.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwEncryption Not working from exe file
  PAUL WEISBERG
  Rick Strahl
  Dec 15, 2021 @ 08:15pm

Solved. It was 2 things:

  1. I was indeed eating errors. Fixing that helped a lot
  2. It appears you have to initialize wwDotNewBridge before using wwEncryption. I wasn't clear on that.

Seems to work fine now both in the IDE and the EXE.

Gravatar is a globally recognized avatar based on your email address. re: wwEncryption Not working from exe file
  Rick Strahl
  PAUL WEISBERG
  Dec 16, 2021 @ 11:36am

You shouldn't need to initialize first as wwEncryption creates an instance of wwDotnetBridge internally for you. The only time this can be a problem is if you have a runtime being loaded with a different version from somewhere else (ie. perhaps old code that explicitly loaded .NET 2.0).

It's still a good idea to do just to ensure that the one and only version of .NET is loaded and used right on startup, but I would try and figure out why that particular failure occurred. You should be able to duplicate that scenario by starting your dev environment fresh and then running the app, which in theory should duplicate your application starting clean.

+++ Rick ---

© 1996-2022