PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - thenewguy

Pages: [1]
Programming / Re: Memory leak? Something not being freed?
« on: December 14, 2023, 04:10:32 PM »
Cancel this question. I wasn't dropping the XML objects.  :o

Although, I'm still curious if there are any tools to monitor or analyze memory usage within pxplus. Anyone know of anything?

Programming / Re: Memory leak? Something not being freed?
« on: December 14, 2023, 04:01:43 PM »
Neither program uses the LOCAL command even once!  :(

Programming / Memory leak? Something not being freed?
« on: December 14, 2023, 03:13:39 PM »
I have a program that I run from the command line, in it, it does a whole bunch of stuff, including generating an XML file, and calling another program to get info for that XML file. I think this called program is the culprit.

It generates a certain number of xml documents and then RUNs the main menu. For some reason my program keeps taking more and more memory the more documents it has to make, and then never releases that memory.

I ran Process Explorer to watch the memory usage, see attachment.
#1 is where my program starts
#2 is where my program gives me an error 31 and i use set_param 'iz' to give it more memory
#3 is where my program is done, and runs our "main menu", but pxplus.exe stays at that amount of memory usage.

When I first launch our software, its sitting at about 8 MB of ram in use.
By the end of generating 300 documents, it's at 356.5 MB.

It goes back to the menu and there's no indication that anything is wrong.
No open channels to anything, no variables in the dump that are huge...

My current hunch is that the called program i mentioned dims a half dozen 999,999 arrays and somehow those are getting stuck in memory?
The program does an EXIT to return to the calling program, and the dims are no longer in the dump at that point. But something tells me that's what's happening?

I know I left a lot of detail out, I'm happy to provide more info.

Also, if anyone has any memory debugging tools, like "show me what in pxplus is taking all this RAM", I'd love that!

Wish List / Re: Mass comment out and uncomment in IT editor
« on: September 22, 2022, 08:45:58 AM »
Thanks for the additional info!

(Can I still add this to the wishlist for the IT editor?  :D )

Wish List / Re: Mass comment out and uncomment in IT editor
« on: September 22, 2022, 08:27:14 AM »
Good to know! I'm just reading about the ED+ editor right now.

Is one better/newer than the other, or are they just different ways of accomplishing the same task and I should use the one I'm most comfortable with?

Wish List / Mass comment out and uncomment in IT editor
« on: September 21, 2022, 04:26:17 PM »
Hi all,
It'd be neat to be able to highlight a bunch of lines and do some sort of keyboard command that would comment or uncomment those lines. This is very helpful in debugging massive programs and is a standard in most IDE's.

Thanks! :)

Nomads / Re: Response when clicking on inactive panel
« on: September 18, 2020, 08:33:04 AM »
Sorry for not being clear, these panels are displayed using the "process" command.
Is that modal?

Nomads / Response when clicking on inactive panel
« on: September 17, 2020, 07:42:37 PM »
Hi all,

I've had an interesting situation come up that I'm not sure if there's an answer for.

So you have a main menu, you click a button and a smaller panel pops up in front. Instead of doing anything with this new panel, you minimize it, so you're just looking at the main menu again, even though it's not "active."

The user then clicks around on this panel and thinks the program has frozen, because they don't realize they've minimized the "front" panel.

Is there any way to, when you click on an inactive panel, bring whatever one has control up to the front again?

Long shot, but I thought I'd ask.


Language / Re: using dll()
« on: July 20, 2020, 11:33:32 AM »
Brilliant. Thank you!

Language / Re: using dll()
« on: July 20, 2020, 10:48:08 AM »
Ah! I know the difference between passing by reference and passing by value but I didn't know the details you posted about how to tell the program which one you're giving it. That WORKED!!

Quick follow up question though, regarding the access rights page, the process-specific rights all have hex values that I at least understand (0x0080, 0x0002, 0x0001), but the "standard access rights" all have values like 0x00010000L, 0x00020000L, etc. Those (afaik) are not standard hex numbers. I'm not sure how I would convert those to decimal to pass them in.

I really appreciate the (very fast!) assistance!

Language / using dll()
« on: July 20, 2020, 10:15:06 AM »
Hi all,

I'm still trying to wrap my brain around the usage of the dll() function.

I've managed to get a result using some of the examples in documentation, but then attempting to apply that to my own needs, I keep just getting a 0 back, which to me means I'm doing something wrong.

So, I'm trying to use Kernel32 -> OpenProcess

The link above says the format is:

Code: [Select]
HANDLE OpenProcess(
  DWORD dwDesiredAccess,
  BOOL  bInheritHandle,
  DWORD dwProcessId

For dwDesiredAccess, you're supposed to use the Process Security and Access Rights list. So if I wanted to get, for example PROCESS_TERMINATE rights, I would use 0x0001.
My understanding of how to pass that along is:
Code: [Select]
a$ = swp(bin(1,4))
For bInheritHandle I just gave it a 0, for FALSE.

For dwProcessId, I got the process ID of a Notepad window that I had opened (so i should definitely have rights to PROCESS_TERMINATE): 40364, but since it's looking for a DWORD, I did the bin/swap thing:
Code: [Select]
b$ = swp(bin(40364,4))
but then:

Code: [Select]
output = dll("Kernel32","OpenProcess",a$,0,b$)
output = 0 every time.

Does anyone have any idea what I might be doing wrong here?

Programming / Re: find files/records extracted by other users?
« on: February 11, 2020, 04:02:08 PM »
Occasionally someone will have a file locked and we'll have to do digging to figure out who it is. It's possible, but sometimes a little time consuming. I was just wondering if it was possible to see who has what file locked from inside pxplus. :)

Programming / find files/records extracted by other users?
« on: February 11, 2020, 01:45:49 PM »
I can get a list of the files I have open, and then can tell if they have a record extracted by iterating through the "chn" variable, and using fin(chan_num,"EXTRACT")

I'm wondering if it's possible to do that, but for other users besides yourself? Can I get someone else's chn variable and fin info?


Language / Re: Excel object commands issue
« on: November 07, 2019, 08:39:55 AM »
The double quotes didn't work, but using:

Code: [Select]
does something kind of odd?
It throws an error 88 (like everything else I've tried does), but instead of saying "Exception occurred (err/ret=2/0)" it says something new (to me):

"The server threw an exception (err/ret=2/0)"

If I try the same line 2 or 3 more times, it eventually works! It doesn't seem to be lag from creating the table_cache in the previous line. I sat waiting at the create pivot table line for a couple minutes once, and still had to retry it three times before it magically worked.
Very strange.

I'd bandage it with an err=*same but I don't think you can do that with LET statements...

Language / Excel object commands issue
« on: November 06, 2019, 03:41:18 PM »
I'm messing with the VBA Excel commands within PxPlus. I'm having a moderate amount of success, but have run into a wall.
In my current test, I'm trying to create a pivot table.
I've managed to put all data into the sheet, but trying to create the pivot table gets me stuck. Here's the three relevant lines:

Code: [Select]

It's specifically the last line. I'm able to create TABLE_RANGE$ and TABLE_CACHE without error, but it simply does not like any variables for CREATEPIVOTTABLE.

("Chart" is the name of the first sheet of the workbook)

Other things I've tried:
  • excel_obj'cells(1,1)
  • "A1"
  • excel_obj'range("A1")

Here's the documentation for CreatePivotTable: https://docs.microsoft.com/en-us/office/vba/api/excel.pivotcache.createpivottable

I'm genuinely lost. Any insight would be amazing. Thanks!

Pages: [1]