Search found 211 matches

by Frank
Wed Jul 01, 2009 2:53 pm
Forum: C++ Development
Topic: Crash with boost::thread
Replies: 16
Views: 2920

You can either use boost::any_cast or the template-function: // Option 1 std::string str = event.GetData<std::string>(); // Option 2 boost::any data = event.GetData(); std::string str = boost::any_cast<std::string>(data); // When you need to check the type of the data you can use typeid: if (data.ty...
by Frank
Tue Jun 30, 2009 11:08 am
Forum: C++ Development
Topic: Crash with boost::thread
Replies: 16
Views: 2920

Since you're using Boost, maybe I can help you out with a generic event, wich uses boost::any, so you can post every data you want: class DataEvent : public wxEvent { boost::any data; public: DataEvent () : wxEvent(0, wxEVT_DATA) { } DataEvent (const boost::any& data) : wxEvent(0, wxEVT_DATA), data(...
by Frank
Fri Jun 26, 2009 12:07 pm
Forum: C++ Development
Topic: wxMessageQueue for Inter-thread communication
Replies: 3
Views: 976

you could use std::array or std::vector instead of a naked array.

If you must use a POD-Array, try wxMessageQueue<std::string*> instead.
by Frank
Fri Jun 26, 2009 12:00 pm
Forum: C++ Development
Topic: Unwanted scrolling operations in wxScrolledWindow
Replies: 2
Views: 443

I have the same problem.

Don't know if it helps you in any way, but in my application the scrolling happens when the scrolled windows get's/loses the focus.

Please let me know when you find something.
by Frank
Thu Jun 25, 2009 1:09 pm
Forum: C++ Development
Topic: Library with wxWidgets support?
Replies: 1
Views: 376

No, it's no problem.

I use some external libraries (PDF-Renderer, Word-Processor, Charting-Lib, DBase-Lib and then some). No problems whatsoever.
by Frank
Wed Jun 24, 2009 10:20 am
Forum: Open Discussion
Topic: How sort an container with boost::shared_ptr
Replies: 2
Views: 1084

Code: Select all

static bool MySortFunc (const boost::shared_ptr<Rawfile>& l, const boost::shared_ptr<Rawfile>& r)
{
   return l->operator<(*r);
}

// Use it like this:

sort(filesraw.begin(), filesraw.end(), MySortFunc);
by Frank
Sat Jun 20, 2009 2:33 pm
Forum: C++ Development
Topic: wxString vs wxArrayString vs wxString array
Replies: 8
Views: 1665

Best of both Worlds:

std::array<wxString, 100> myArray;
by Frank
Thu Jun 18, 2009 9:49 am
Forum: C++ Development
Topic: Strange Function Error
Replies: 5
Views: 1084

As Muetdhiver said, the error is slef explaining. Your calling a function with another calling convention then the function is compiled. Eg. an OPTLINK function with SYSTEM linkage. The calling convention tells the compiler how to remove the parameters from the stack. eg. the function cleans up, lik...
by Frank
Wed Jun 03, 2009 9:16 am
Forum: C++ Development
Topic: How to convert a wxClientDC to HDC?
Replies: 4
Views: 1576

Try

wxDC::GetHDC()

This works for me (Copy from a working PDF-Viewer):

Code: Select all

HRESULT hr = PXCV_DrawPageToDC(doc, page, (HDC)dc.GetHDC(), &rp);
by Frank
Mon May 25, 2009 6:21 pm
Forum: General Development
Topic: Does select() lock a thread?
Replies: 1
Views: 745

It only blocks the calling thread.
by Frank
Fri May 22, 2009 12:40 pm
Forum: C++ Development
Topic: wxZipInputStream will not parse zip files greater than 2GB
Replies: 5
Views: 534

kittymaguire wrote:
Frank wrote:As has the ZIP-Format.
I believe that zip format now has a limit of 4GB, as 7-zip can extract the files contained in the zip file.
Yeah, but that's an extension. The orginal ZIP-Spec uses a signed integer.

So my guess would be that wx implemented it's Zip-Routines from the original Zip-Docs.
by Frank
Thu May 21, 2009 8:11 am
Forum: C++ Development
Topic: wxZipInputStream will not parse zip files greater than 2GB
Replies: 5
Views: 534

As has the ZIP-Format.
by Frank
Tue May 12, 2009 12:04 pm
Forum: Component Writing
Topic: Semaphore
Replies: 4
Views: 2462

With WX? Not that I'm aware of.

Outside of WX? Yeah, many. For starters there's boost::interprocess
by Frank
Fri May 08, 2009 4:01 pm
Forum: Component Writing
Topic: Semaphore
Replies: 4
Views: 2462

Never used them, but after reading the docs: No, they don't.

For interprocess use you need a named mutex, wich is not supported by wx.
by Frank
Mon Apr 20, 2009 2:58 pm
Forum: C++ Development
Topic: Does wx have any functionality for app/user files?
Replies: 2
Views: 586

wxStandardPaths::GetUserConfigDir()
and
wxStandardPaths::GetUserLocalDataDir()

seems to be what your're looking for.