1. C K
  2. PowerBuilder
  3. Wednesday, 17 January 2024 06:42 AM UTC

Hello,

I have a custom menu item in the PowerBar, my item command runs an  EXE (with parameters).

The exe application run correctly via RUN, but when I try to run it from menu item the PB IDE crashes.

Event log details:

Faulting application name: pb220.exe, version: 22.1.0.2819, time stamp: 0x64c36da2
Faulting module name: clr.dll, version: 4.8.4645.0, time stamp: 0x648f709e
Exception code: 0xc00000fd
Fault offset: 0x004c328a
Faulting process id: 0xba78
Faulting application start time: 0x01da487d7faa653d
Faulting application path: C:\Program Files (x86)\Appeon\PowerBuilder 22.0\pb220.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

 

In powerbuilder 12.5 its runs fine, but the problem is in pb22

* When I run this program with other parameter it's running without a proplem.

 

Thanjs,

Chava

Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 25 January 2024 13:44 PM UTC
  2. PowerBuilder
  3. # 1

You could create an IDE wizard instead of an external program.

I did a presentation about this at Elevate 2019, you can download it from here:

https://www.topwizprogramming.com/tools.html

Scroll down to 'IDE Wizards' and click the link to download the zip file.

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 24 January 2024 19:36 PM UTC
  2. PowerBuilder
  3. # 2

Hi C K;

   Looks like all your command line App is trying to do is add comments to the PB IDE where you are coding.

   I am not sure how your C# code crashing PB but, I have had a "Commenter" feature working a long time ago and it also including with more features ...

   FYI: http://chrispollach.blogspot.com/2023/10/commenter.html

PS: All written in PB BTW.  ;-)

HTH

Regards ... Chris 

Comment
  1. C K
  2. Thursday, 25 January 2024 07:22 AM UTC
Hello,

I saw the commenter program, and I read the sources code' its very beautiful,

but I want to insert inline comment with text from file,

And this only example to custom item menu that crashing the PB,

Thanks,

Chava.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 25 January 2024 13:55 PM UTC
Hi Chava;

The commenter inserts the actual comment(s) from a file (one of three actually). So, all you need to do is modify the external file(s) as you need - as documented in the ReadMe file. ;-)

Regards... Chris
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 24 January 2024 14:22 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Chava -

Because you are wanting to supply two space-delimited arguments, try encapsulating both arguments in double-quotes:

    G:\Comment\Comments.exe "Chava new"

Best regards, John

Comment
  1. C K
  2. Thursday, 25 January 2024 07:14 AM UTC
Hello,

I tried, but PB crashing too

In PB12.5 it was send OK with two parameters

Thanks,

Chava
  1. Helpful
There are no comments made yet.
Chava Kunshtat Accepted Answer Pending Moderation
  1. Wednesday, 24 January 2024 06:46 AM UTC
  2. PowerBuilder
  3. # 4

Hello,

When I run command:

G:\Comment\Comments.exe DeveloperName is runs OK:

But if I run the following command, the PB crashes:

G:\Comment\Comments.exe Chava new

* As I sent, the program sent a response to edit PowerBuilder code

When I send the second parameter "new", the form opens, to insert a new task (which will be in the comment.

 

Comment
There are no comments made yet.
C K Accepted Answer Pending Moderation
  1. Thursday, 18 January 2024 07:41 AM UTC
  2. PowerBuilder
  3. # 5

Heloo,

My program, (window application in C#)

Thanks,

Chava

       static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (args.Count() > 1)
            {
                if (args[1].ToLower() == "new")
                {
                    Application.Run(new AddTask());
                }
            }

            string[] lines = System.IO.File.ReadAllLines(@"H:\משימות שונות\task.txt", System.Text.Encoding.GetEncoding("windows-1255"));
            
            string comment = "/*" + args[0] + " - " + DateTime.Today.ToShortDateString() + " - " + lines[0] + "*/";

            SendKeys.SendWait(comment);
            SendKeys.SendWait("{Enter}");
        }
        public AddTask()
        {
            InitializeComponent();
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                System.IO.File.WriteAllText(@"H:\משימות שונות\task.txt", textBox1.Text , System.Text.Encoding.GetEncoding("windows-1255"));
                Close();
            }
        }
Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 17 January 2024 14:21 PM UTC
  2. PowerBuilder
  3. # 6

Is the program being run also PowerBuilder? If PowerBuilder, is it the same version/build as the IDE?

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 17 January 2024 13:10 PM UTC
  2. PowerBuilder
  3. # 7

Hi C K;

  Can you give us a lot more details about the "Other" program's composition & how it processes?

Regards... Chris 

Comment
  1. John Fauss
  2. Wednesday, 17 January 2024 14:22 PM UTC
@CK - It would also be helpful for us to see EXACTLY the command you are specifying for the toolbar button. The more information you can supply, the better the chance that someone will be able to help you.
  1. Helpful 1
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.