Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » invalid memory access
invalid memory access [message #53737] Sun, 26 April 2020 07:50 Go to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hi all-

I'm running my very small application (it only has 5 or 6 dialogs so far). If I run code from my menu, I can run it with sql until I am blue in the face. When I start to open up other dialogs and switch back I get a msg. that says something about invalid memory access. I run a gui with a main section for my main window. This is the menu system to launch other forms. I'm using Ubuntu xfce. Any ideas why it works and then crashes when I am switching dialogs? Thnx - roboloki

 bar.Add("check master", [=] { showmaster();});
    bar.Add("check detail", [=] { showdetail();});
    bar.Add("Account Maint.", [=] { showaccounts();});
    bar.Add("Subsidiary", [=] { showciti();});
    bar.Add("Purch. Journal", [=] { showpj();});
    bar.Add("Exit", [=] { Exit(); });
    }
    void MyMain::MainMenu(Bar& bar) {
        bar.Sub("Menu", [=](Bar& bar) { SubMenu(bar); });	
    }

 	void MyMain::showaccounts() {
 		
 		// show check master
         
        App2 app2;
        switch(app2.Run()) {
        case IDOK:
              break;
        case IDCANCEL:
        Exclamation("Canceled");

    }
     }


I use this code for each dialog with an okay and cancel button:

ok.Ok() <<= Acceptor(IDOK);

cancel.Cancel() <<= Rejector(IDCANCEL);
  • Attachment: pj
    (Size: 2.45KB, Downloaded 153 times)

[Updated on: Sun, 26 April 2020 08:10]

Report message to a moderator

Re: invalid memory access [message #53738 is a reply to message #53737] Sun, 26 April 2020 08:42 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hey guys,

It is really cool. I am using the debugger for the first time ever. It is telling me it is a connection issue with my postgres.

I will have to check into that.

Thanks,
roboloki
Re: invalid memory access [message #53740 is a reply to message #53737] Sun, 26 April 2020 09:25 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hi,

One quick observation about your code.

You are calling OpenDB3() in every function.

Generally it should be enough once in init phase.


Warm Regards

Deepak
Re: invalid memory access [message #53744 is a reply to message #53740] Sun, 26 April 2020 12:28 Go to previous message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

HI deep-

Yeah, I figured that out since the last time I checked in. Another thing I did is when using the grid, I have to use SQL instead of like Sql sql(m3_session) ... and I can't use if(!OkCommit(m3_session, "Unable to delete transaction data.")) with the grid either. I need to use a regular Commit();

The debugger put me on to what I did wrong, and it is exactly like you said.

I've got my little programming running with no invalid memory access now. HOoray !

I obviously have more work to do though.

As always, thanks for the cool help Smile

Previous Topic: How to link libeay32, libssl32 and ssleay32 statically in Windows?
Next Topic: Full recompile of single package only
Goto Forum:
  


Current Time: Tue Mar 19 11:30:46 CET 2024

Total time taken to generate the page: 0.01323 seconds