1. Lisa Willford
  2. PowerBuilder
  3. Wednesday, 13 February 2019 20:22 PM UTC

I have a super odd problem going on with a PowerBuilder program.  We are in the process of testing out all of our existing PowerBuilder programs on a Windows 10 computer.  This particular program is written in PB Classic 12.5.  The program is completely contained in a folder on the network.  We just run the exe and all of the PBDs and DLLs are in that same folder.  Every other PB12.5 program has worked, but not this one.

What is odd is that the program will just spin the cursor, and then do nothing.  No errors, nothing.

BUT, if I rename that folder, the program runs just fine.  In fact, I can make a copy of the folder on the desktop - same behavior.  If the folder is named the same, it will not run.  If it's renamed, it will run just fine.  NO other changes are made, other than renaming the folder.

I can keep the folder name the same, but rename the EXE and it will won't run.

The folder is named "Versigo"

Has anyone ever seen that behavior before?  It makes no sense at all.  And of course this is the most used program in the company.  I have tried recompiling it, no changes.

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 19 February 2019 15:36 PM UTC
  2. PowerBuilder
  3. # Permalink

The proper way to prevent more than one copy of your app is to use a Mutex. I have an example here:

http://www.topwizprogramming.com/freecode_mutex.html

 

Does your app set the window title to the folder it is run from?

 

Comment
  1. Lisa Willford
  2. Tuesday, 19 February 2019 17:18 PM UTC
I just integrated your Mutex code into my program and it worked fine. I do need to tweek it so it brings up the already opened program though, but otherwise it seems to work well. Thanks!!
  1. Helpful
There are no comments made yet.
Lisa Willford Accepted Answer Pending Moderation
  1. Tuesday, 19 February 2019 14:06 PM UTC
  2. PowerBuilder
  3. # 1

As I was reading the responses I started thinking... the program is acting like it wants to start, but then stops.  Then I remembered I have code which will close the program if another instance of the program is already running!  This code is in most of my programs, so I'm not sure (without investigating further) why this program is hung up on it.  BUT, I now know this is the offending code which is making my program stop working from the folder named "versigo"

l_handle = FindWindowA(0, "Versigo")
IF l_handle > 0 THEN
   ShowWindow(l_handle, 9)
   HALT
   RETURN
END IF

Like I said, not sure why this particular program gets hung up on this code, but that's the problem!  When I commented this section out (in the Application Open event), it worked just fine no matter what the folder is named.

How do other people handle this issue?  I don't want people to open more than one instance of the program.  I've been using this code since PB 10.  I'm guessing there's a better way to handle this now?  :)  

Thanks in advance for any suggestions, and for your previous help!

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 20 February 2019 10:53 AM UTC
Glad you found it, typically any issues lead back to your code :o)
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 18 February 2019 15:58 PM UTC
  2. PowerBuilder
  3. # 2

Hi

As you say that copying the folder to the desktop still has the same issues then it is not a networking issue. If all you are doing is renaming the folder then the permissions should be the same.

So here is my random thought, is the folder name actually "Versigo" with a capital, what happens if you rename it to all lower case or indeed all upper case? I'm wondering if there is something in your code that is looking for the folder name and somehow that is getting freaked out.

Cheers

David

Comment
  1. Lisa Willford
  2. Tuesday, 19 February 2019 16:28 PM UTC
I tried changing the upper/lower but this got me thinking about where the word "versigo" might be embedded in the code. I remembered that the application open checks to see if the program is already running, and then makes the program halt if it is already running. Bingo! That was it. The Windows function "FindWindowA" is causing the program to shut down when the folder named "versigo" is used. I will be looking for a replacement for that function.
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Friday, 15 February 2019 01:12 AM UTC
  2. PowerBuilder
  3. # 3

I agree with Chris. This soulds VERY much like a USER ACCESS issue.

START Button --> Control Panel --> User Accounts --> Change User Account Control Settings

See the slider? Move it all the way to the bottom, to "Never Notify".
Then try again.

 

Olan

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 13 February 2019 20:42 PM UTC
  2. PowerBuilder
  3. # 4

Hi Lisa;

  Could this maybe be a network or policy access restriction on that old folder?

Regards ... Chris

Comment
  1. Lisa Willford
  2. Tuesday, 19 February 2019 16:30 PM UTC
I did eliminate all chances of it being a network or security issue by creating a new folder on my desktop to test with, and sure enough I tracked it down to some old code which is "FindWindowA" in the Application Open event. I use that to stop more than one instance of the program being open and I guess it just gets confused (and it's out of date for 64 bit). Time to find a replacement for that process!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.