EDIT:
Point taken. Thanks.
I'm gonna refactor this.
Thanks for the help everyone. :)
Type: Posts; User: sethjackson
EDIT:
Point taken. Thanks.
I'm gonna refactor this.
Thanks for the help everyone. :)
Aha! Thanks laserlight. I've got it working now.
Yeah I don't know why I was getting unresolved symbols.
I probably did something dumb with my build.
Thanks for the help. :)
Mind explaining why?
Because that doesn't make sense to me and when I tried it it didn't work.
Thanks for the reply though.
Umm so I ran into this weird problem today.
It's probably my own ignorance but I wanted to know why this happens
and if it's supposed to.
Say I have this code:
(Using MinGW/GCC 4.5 compiler on...
LOL I'm an idiot. Thanks.
Ok so I have this function that will let you switch whether a window can be resized or not.
void Window::SetResizable(bool resizable)
{
DWORD dwStyles;
if (resizable)
...
Figured it out.
I was wrapping the platform specific data types in #ifdef PLATFORM_FOO(s)/#endif pairs in my library.
I defined them upon building the library but not the app.
Once I defined...
Ugh. This just keeps getting weirder.
So I decided to statically link my code into the app to test.
No go. Same old crash.
However, stepping through the calls after the crash in GDB will cause...
Hmm on a hunch I compiled the code directly into my app instead of using a DLL for the Widget/Window/Button/Application classes.
Now everything works fine.
However, this isn't a solution.
I want...
Yes.
The button isn't created with the WS_OVERLAPPED style...
It is a child of the main window...
base class for all UI elements is Widget. Window represents a top level window, not a button or text entry, those are derived directly from Widget.
So top level windows need the WS_OVERLAPPEDWINDOW...
While I *could* use MFC/Gtk+/Qt/wxWidgets/WinForms/whatever else, I choose not to.
Anyone gather any ideas from the backtrace??
The class "MyClassName" is only registered once, the first time the Widget constructor is called. It's lazy initialized (actually this technique isn't thread-safe but I'm not concerned about that...
I'm trying to make a simple C++ wrapper around the Windows UI library but I'm getting some weird crashes that I can't seem to debug.
I have a base class Widget that does all the...
You have to tell the compiler that you are compiling a Windows GUI program.
Otherwise it thinks you are trying to compile a console program and you will get the above error.
Add this to your...
Also, why are you taking a string by const value? Do you really want a *copy* of it?
Since you are passing a const value you can't modify the value anyway. Might as well pass by ref and save some...
I use something along the lines of the .NET/Gtk+/Qt documentation style...
Like so:
/**
* Removes the specified item from the list if it exists.
*
* This function requires the value...
We already have those (well unless your compiler doesn't support C99).
int8_t
int16_t
:)
Well it uses XML for one, and it is more akin to Makefiles than other systems IMO....
I can't tell you if it is "better" than other systems, but I do know that it is simple, and easy to use (for me...
Not quite....
You would have to change Run() everytime you want to do something different....
Something like this is what I was saying.....
virtual void Run() = 0;
Bakefile!!!
http://www.bakefile.org/
I love it. :D
Check this out.
DWORD WINAPI ThreadProxy(void* arg)
{
Thread* thread = static_cast<Thread* >(arg);
thread->Run();
Why didn't I think of that, must have not read the man page thoroughly....
Thanks CornedBee. :)
How do I get the current file position from a file descriptor?
I don't see anything like ftell(), for file descriptors.....
Thanks!
Heh yep. Thanks mats!!