Search found 1195 matches

by mc2r
Wed May 06, 2009 3:40 am
Forum: C++ Development
Topic: How to initialize external array?
Replies: 9
Views: 1428

Re: How to initialize external array?

Hi, ALL, I have following code: struct colorEntries { wxString m_name; wxColour m_color; }; colorEntries colourDialogNames[] = { { _T( "Black" ), wxColour( 0x00, 0x00, 0x00 ) } }; This code is not compiling with VC++6 on Windows, giving: f:\projects_new\appbuilder\src\libmisc\colorcombobox.cpp(34) ...
by mc2r
Sat Apr 11, 2009 9:58 pm
Forum: General Development
Topic: C switch statment with nested if's
Replies: 6
Views: 1630

I think that error makes sense since (I believe) that nothing inside the switch block will get executed unless a case value has met the switch expression criteria. This is wrong. The block inside the switch statement(not expression as a switch is not evaluated for a value) only has the requirement ...
by mc2r
Fri Apr 10, 2009 5:56 pm
Forum: General Development
Topic: C switch statment with nested if's
Replies: 6
Views: 1630

put the switches inside the if/else block. Thanks, but that isn't what I am looking for. The above is working valid code by the C standard. The if inside the switch segregates the cases and is valid. I am trying to find a reference going into more details on its use. It has been a long long time si...
by mc2r
Thu Apr 09, 2009 1:16 am
Forum: General Development
Topic: C switch statment with nested if's
Replies: 6
Views: 1630

C switch statment with nested if's

I'm trying to find a C trick but searching google hasn't yielded anything useful and I was hoping someone here might recognize it. int i = 0; char c = 'b'; switch(c){ if(i == 0){ case 'a': break; case 'b': break; } else if(i == 1){ case 'c': break; case 'd': break; } } I am pretty sure I have a refe...
by mc2r
Tue Mar 24, 2009 11:08 pm
Forum: C++ Development
Topic: Missing DLL's
Replies: 13
Views: 2711

statically link the executable.

-Max
by mc2r
Mon Mar 23, 2009 9:19 pm
Forum: General Development
Topic: How to license my software?
Replies: 7
Views: 1800

I'd like to add 2 points. I think a good place to start is deciding what rights you want to grant the users. Should be a pretty short list since you aren't releasing source code. The copyright...all rights reserved blurb posted earlier may be sufficient. No need to make it complicated if you are rel...
by mc2r
Mon Mar 23, 2009 5:28 pm
Forum: C++ Development
Topic: Adding wxApp to "Open With..."
Replies: 6
Views: 1113

Thanks, but can it be done through the application itself ? Yes You have to register the extension with your keychain or Registry. You need the Windows or Cocoa API for that. You can do it through your application, but you will have to use system specific code which isn't portable. wxWidgets doesn'...
by mc2r
Sun Mar 22, 2009 5:05 pm
Forum: C++ Development
Topic: hide GUI or minimize to system tray
Replies: 22
Views: 8024

Here is some code I use that is close to what you are looking for. The icon is always in the system tray, and is used to hide/show the main window. The code for adding the icon to the system try when the app starts and removing it when it ends is there though so you should be able to modify it to do...
by mc2r
Sun Mar 22, 2009 6:19 am
Forum: Platform Related Issues
Topic: Tracking down X11 errors?
Replies: 1
Views: 653

"--sync" is probably ignored by wxWidgets. I don't have a way to test it right now and haven't ever had a need to check to see if it was there. GTK apps call XSynchronize(), when --sync is passed. I'm not sure how you'd go about getting the Display* from wxWidgets. Probably going to have to do more ...
by mc2r
Sat Mar 21, 2009 7:02 pm
Forum: C++ Development
Topic: Disable "DISABLED"-Sound
Replies: 2
Views: 609

Timo, I don't know a way in wxWidgets to disable the bell when clicking on a disabled window. There may be a win32 specific version. What I can suggest is exactly the kind of non-answer I normally hate. That is what is it you are trying to accomplish with the disabled main window? Maybe someone here...
by mc2r
Sat Mar 21, 2009 4:40 pm
Forum: C++ Development
Topic: why block at WaitForAccept
Replies: 5
Views: 1003

Re: why block at WaitForAccept

sms91 wrote:In my Gui project ,before create the thread ,i had use the wxSocketBase::Initialize();
I'm sorry I don't understand what is being asked? What is the problem?

-Max
by mc2r
Sat Mar 21, 2009 4:37 pm
Forum: C++ Development
Topic: memory leaks
Replies: 12
Views: 2887

While Valgrind is a very good tool, it may be frustratingly hard to interpret the result. Ugly and long for the amount of useful content. But, I've not found it that hard to interpret for me its harder to buckle down and wade into it. Those leaks you found might not be in wxWidgets either, they mig...
by mc2r
Fri Mar 20, 2009 9:20 pm
Forum: C++ Development
Topic: Thread taking 100% CPU when empty?!
Replies: 6
Views: 1294

Maybe like doublemax suggested, the system is sleeping for one of those values. I don't think it there will be any sleeps in the code you posted. They all look like assignments, without seeing the code there might be an overloaded operator=() that has a sleep in it, but I really can't imagine that ...
by mc2r
Fri Mar 20, 2009 8:53 pm
Forum: C++ Development
Topic: Major wxFileConfig bug
Replies: 13
Views: 1852

rodrigod wrote:Any one could have any idea why it would not load some random keys? These keys it never loads, but can´t find any pattern.
I've none with out seeing the offending code and the ini file it has problems with.

-Max
by mc2r
Fri Mar 20, 2009 8:48 pm
Forum: C++ Development
Topic: Thread taking 100% CPU when empty?!
Replies: 6
Views: 1294

Thanks for helping. I'm wondering why the CPU doesn't jump to 100% when the code inside the IF statement executes then? It seems like it would take more processing power to do something, then to do nothing... It does take more cpu to do nothing than to do something. The problem is that this kind of...