Search found 2662 matches

by PB
Fri Feb 17, 2012 4:51 pm
Forum: C++ Development
Topic: Out of ideas...
Replies: 16
Views: 2965

Re: Out of ideas...

The code you have posted is very likely not the code you debug. u64* buff = OldV(searchNo, false); delete oldBuff; oldBuff is not declared anywhere in the scope, so this function is not going to compile (unless it's a global variable or a member variable without a prefix, which I hope it is not). By...
by PB
Fri Feb 17, 2012 1:49 pm
Forum: C++ Development
Topic: Out of ideas...
Replies: 16
Views: 2965

Re: Out of ideas...

I refrain from replying to your posts, but I have to make an exception. Follow doublemax's advice and make yourself familiar with the debugger in your IDE of choice. Debugger isn't a disassembly window. In the first place, learn how to: 1. step through the code 2. use watch/locals variable, call sta...
by PB
Fri Feb 17, 2012 1:32 pm
Forum: C++ Development
Topic: Problems using rand() in wxThreads
Replies: 5
Views: 1928

Re: Problems using rand() in wxThreads

1. Can't you use a different (pseudo)random number generator implementation, like Boost's? 2. I believe that seeding must be done in every thread separately, at least on MSVC, as it appears the seed is stored in TLS. This is dependent on CRT implementation, which might differ between compiler vendor...
by PB
Fri Feb 17, 2012 11:36 am
Forum: General Forum Issues
Topic: C++ syntax highligting in posts
Replies: 4
Views: 15167

C++ syntax highligting in posts

Am I the only one who misses the code highlighting in the "code" section of forum posts? I think it improves a code readability a lot and IIRC you could also click on a wxWidgets' function or type to get the official documentation for it. I know that the feature was removed during the forum upgrade ...
by PB
Fri Feb 17, 2012 10:17 am
Forum: C++ Development
Topic: measure wxTextCtrl
Replies: 2
Views: 822

Re: measure wxTextCtrl

Can't you just use GetSize() ? Returns the size of the entire window in pixels, including title bar, border, scrollbars, etc. If it does and there can be scrollbars shown and you need only client size, than the you have to use a different approach . Hard to tell if we don't know what you need the si...
by PB
Fri Feb 17, 2012 6:38 am
Forum: C++ Development
Topic: error: multiple definition of function
Replies: 4
Views: 11061

Re: error: multiple definition of function

PS Would you have a recommendation for a good beginner C++ book?' Sorry, I learnt C++ almost 20 years ago, so I can't really personally recommend any such book that would be of relevance today. But if you're really proficient at C already, learning C++ shouldn't be that hard, just focus on: * learn...
by PB
Thu Feb 16, 2012 8:34 pm
Forum: C++ Development
Topic: error: multiple definition of function
Replies: 4
Views: 11061

Re: error: multiple definition of function

You do not #include .cpp files. You add them to the project/make file. Add the declarations you want to be visible from multiple files to a header file and include that one, so it would look like this File png.h #ifndef _PNG_H__ // prevent multiple includes #define _PNG_H__ struct structPng{ long fi...
by PB
Tue Feb 14, 2012 1:41 pm
Forum: C++ Development
Topic: SetInsertionPoint() does not funzion
Replies: 2
Views: 4303

Re: SetInsertionPoint() does not funzion

I believe that the insertion point can not be greater than the value returned by wxTextCtrl::GetLastPosition(), which in your case is 0 ( testo is empty).
by PB
Tue Feb 14, 2012 9:26 am
Forum: C++ Development
Topic: Need to speed up loop
Replies: 6
Views: 1233

Re: Need to speed up loop

Mhm, the code you posted in your original post doesn't even include HCRead() call? :S It's very hard to provide a useful advice when such information is missing. If you meant HCReadH(), I'm curious: how do you "stuck a function into an array" to significantly improve its execution time (it doesn't m...
by PB
Mon Feb 13, 2012 8:43 pm
Forum: C++ Development
Topic: Need to speed up loop
Replies: 6
Views: 1233

Re: Need to speed up loop

1. Use a profiler to learn what parts of the code are most time expensive, focus on these. 2. Best speed achievements are often gained when designing proper algorithm, instead of just focusing on improving the current solution. But I guess this might not be the case. Generic advice; I've just skimme...
by PB
Wed Feb 08, 2012 4:43 pm
Forum: Platform Related Issues
Topic: no show icon
Replies: 2
Views: 1207

Re: no show icon

Well, I see at least two possible causes for that, there are sure to be more. I'm assuming you mean a frame icon you set by SetIcon(), not the application icon shown by Windows Explorer and such. Is the icon file available on that PC with Windows 7 - how do you load it? From a resource file linked i...
by PB
Wed Feb 08, 2012 7:22 am
Forum: C++ Development
Topic: wxApp::OnExit()
Replies: 4
Views: 3983

Re: wxApp::OnExit()

I also notice that even if I create some variable on stack in wxApp::OnInit(), it has already been destroyed before the application reaches wxApp::OnExit(). For example, wxApp::OnInit() { static int a = 0; } wxApp::OnExit() { ...... a is not accessible here ...... } Variables local to a function ar...
by PB
Mon Feb 06, 2012 8:45 am
Forum: Compiler / Linking / IDE Related
Topic: Linker issues
Replies: 2
Views: 1306

Re: Linker issues

I would recommend finding a tutorial dealing with wxWidgets 2.9 and following it, should make your life a bit easier. ;) Have you managed to build the library itself? wxWidgets 2.9 are not usually built in non-Unicode targets, so you should have only files like wxmsw29 u _core.lib (Unicode release) ...
by PB
Thu Feb 02, 2012 8:22 pm
Forum: C++ Development
Topic: wxAuiManager with wxAuiNotebook on MDIchild frame trouble
Replies: 2
Views: 961

Re: wxAuiManager with wxAuiNotebook on MDIchild frame troubl

Do you call

Code: Select all

 m_mgr.UnInit();
in the JanelaFilha destructor? Forgetting to do that is a very common reason for crashes like this when using AUI.
by PB
Mon Jan 16, 2012 1:00 pm
Forum: Component Writing
Topic: how do I get native settings to use in a custom control?
Replies: 3
Views: 9634

Re: how do I get native settings to use in a custom control?

I haven't used it myself and it's a long shot, but can't you use wxDelegateRendererNative::DrawTreeItemButton? It seems the method is overridden for Windows XP at least.