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.


Topics - thenewguy

Pages: [1]
1
Programming / Memory leak? Something not being freed?
« on: December 14, 2023, 03:13:39 PM »
Hello,
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!

2
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! :)

3
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.

Thanks!

4
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?

5
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?

Thanks!

6
Language / Excel object commands issue
« on: November 06, 2019, 03:41:18 PM »
Hello,
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]
  let TABLE_RANGE$=DATA_SHEET'NAME$+"!A1"+LASTCOL$+"1:A"+str(LASTROW)+LASTCOL$+str(LASTROW)
  let TABLE_CACHE=EXCEL_OBJ'ACTIVEWORKBOOK'PIVOTCACHES'CREATE(1,TABLE_RANGE$)
  let TABLE=TABLE_CACHE'CREATEPIVOTTABLE("Chart!A1")

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]