Search found 31 matches
- Sun Mar 08, 2009 3:40 pm
- Forum: C++ Development
- Topic: New to the crew, Virtual ListControl blues.
- Replies: 7
- Views: 1879
Thanks guys, we're getting there. Now, when I compile, I get two errors: undefined reference to `VirtualListCtrl::GetEventTable() const' undefined reference to `VirtualListCtrl::GetEventHashTable() const' Are you sure you get this error at compile time? I suppose this is returned by the linker. And...
- Sun Mar 08, 2009 1:19 pm
- Forum: C++ Development
- Topic: byte to bits
- Replies: 7
- Views: 1516
You are partially right. I know some older compilers do not support templates. But if look at the code, and you know a bit about templates, you see that the recursion is executed at compiletime, not at runntime! Its obvious, that this function is more efficient. Among the compilers that supported t...
- Sun Mar 08, 2009 10:42 am
- Forum: C++ Development
- Topic: byte to bits
- Replies: 7
- Views: 1516
Here is my way to compute this, its a bit more efficient :-): It will really depend on the optimizer. For each array item you get a (almost) recursive call (which is not efficient at all) unless the optimizer is able to inline such a complex template construction. But it may even not compile with s...
- Sun Mar 08, 2009 10:20 am
- Forum: C++ Development
- Topic: change the color of the scrollbars and picture distance
- Replies: 2
- Views: 896
- Sat Mar 07, 2009 11:49 pm
- Forum: C++ Development
- Topic: New to the crew, Virtual ListControl blues.
- Replies: 7
- Views: 1879
The error you got means that at least one of the virtual functions redefined by your VirtualListCtrl class is not found by the linker. So check that all the methods declared in VirtualListCtrl are correctly defined, and that the file(s) where they are defined are included in the link command. Edited...
- Sat Mar 07, 2009 8:02 pm
- Forum: C++ Development
- Topic: New to the crew, Virtual ListControl blues.
- Replies: 7
- Views: 1879
It seems that you are trying to implement your list following the sample but using wxSmith. Unfortunately using wxSmith brings you constraints in your design that does not allow you to write any code you want. So I am not sure you will be able to code the sample the exact way you want. Though your p...
- Sat Mar 07, 2009 5:26 pm
- Forum: C++ Development
- Topic: byte to bits
- Replies: 7
- Views: 1516
Re: byte to bits
Just little shorter way to do the same... int MyProjectFrame::Byte2Bits(int number){ int *bits = new int[8]; for (int i = 7; i >= 0; --i) { bits[i] = number & 1; number >>= 1; } return bits; } Or int MyProjectFrame::Byte2Bits(int number){ int *bits = new int[8]; for (int *CurBit = bits + 8; CurB...
- Sat Mar 07, 2009 4:47 pm
- Forum: C++ Development
- Topic: How to call attached and detached threads
- Replies: 2
- Views: 863
- Sat Mar 07, 2009 11:08 am
- Forum: C++ Development
- Topic: Cannot resume thread, handle is invalid?
- Replies: 2
- Views: 1787
Check the manual: a wxThread must be contructed, created and then run. You have constructed yours in the static function you have called Create. Correct though the function name may be confusing because it exists the function Create that is member of the wxThread base class. Then you try to run the ...
- Fri Mar 06, 2009 10:37 pm
- Forum: C++ Development
- Topic: Why cant I access my thread?
- Replies: 7
- Views: 2335
- Fri Mar 06, 2009 10:27 pm
- Forum: C++ Development
- Topic: Wait until a wxFrame has been destroyed
- Replies: 3
- Views: 2148
I realize that your code misses the
So you will get memory leaks. Warning: you must NOT use delete oMyFrame; in the onClose
When destroying the frame, wxWidgets should correctly perform the event disconnection I think. So try to replace the disconnect with the Destroy.
Code: Select all
oMyFrame->Destroy();
When destroying the frame, wxWidgets should correctly perform the event disconnection I think. So try to replace the disconnect with the Destroy.
- Fri Mar 06, 2009 9:21 pm
- Forum: C++ Development
- Topic: Why cant I access my thread?
- Replies: 7
- Views: 2335
It is not clear if your thread is a singleton created by one of the 3 classes or if there can be several threads one per bar instance created. If you want a singleton, declare the pointer as a static pointer variable in fooThread class If you want as many threads as bar class instances, you have to ...
- Fri Mar 06, 2009 8:06 pm
- Forum: C++ Development
- Topic: Wait until a wxFrame has been destroyed
- Replies: 3
- Views: 2148
- Wed Mar 04, 2009 11:18 pm
- Forum: C++ Development
- Topic: Button Shape
- Replies: 6
- Views: 3266
- Tue Mar 03, 2009 7:27 pm
- Forum: C++ Development
- Topic: Button Shape
- Replies: 6
- Views: 3266
I am using the wxBitmapButton and I'd never set wxNO_BORDER and I have no border drawn :?: But you MUST avoid setting wxBU_AUTODRAW (which is the default value). This flag generates a 3D rectangular border that changes when the button is pressed. To summarize: with style=0 my button looks exactly li...