[QUOTE=raBBish;27543876][cpp]if((x) >= 0 || (x) <= 15 || (y) >= 0 || (y) <= 15)[/cpp]
should be
[cpp]if(x >= 0 && x <= 15 && y >= 0 && y <= 15)[/cpp]
Actually... just change all the || to &&. Otherwise the condition will be true even if only one of them is true.[/QUOTE]
Ah, that's right. My mistake, thanks for pointing that out :)
Ah, much better, it works now.
I've finally decided to learn C++ and, since I've heard its the standard on Windows, I've downloaded Visual Studio 2010.
Are there any guides to learning C++ that are specifically geared towards developing in Visual Studio? There are plenty of guides for Visual Studio, but they all seem to assume that you know C++. Similarly, many C++ guides aren't IDE-specific.
[QUOTE=Larikang;27544356]I've finally decided to learn C++ and, since I've heard its the standard on Windows, I've downloaded Visual Studio 2010.
Are there any guides to learning C++ that are specifically geared towards developing in Visual Studio? There are plenty of guides for Visual Studio, but they all seem to assume that you know C++. Similarly, many C++ guides aren't IDE-specific.[/QUOTE]
I find this mister very informative and easy to follow:
[url]http://www.youtube.com/user/thenewboston#grid/user/F541C2C1F671AEF6[/url]
[QUOTE=Larikang;27544356]I've finally decided to learn C++ and, since I've heard its the standard on Windows, I've downloaded Visual Studio 2010.
Are there any guides to learning C++ that are specifically geared towards developing in Visual Studio? There are plenty of guides for Visual Studio, but they all seem to assume that you know C++. Similarly, many C++ guides aren't IDE-specific.[/QUOTE]
You don't need an IDE specific guide.
[QUOTE=WTF Nuke;27513700]Oh god how do I use boost::multi_arrays? I declared it like this: boost::multi_array<char, 2> maparray; but I can't resize it: maparray.resize(boost::extents[posx][posy]);[/QUOTE]
Repost.
[QUOTE=WTF Nuke;27549249]Repost.[/QUOTE]
Did you ever actually construct the multi_array?
[cpp]boost::multi_array<char, 2> maparray(boost::extents[3][4]); // assuming the initial dimensions are 3x4[/cpp]
but you should use typedefs:
[cpp]typedef boost::multi_array<double, 3> maparray_t;
typedef maparray_t::index maparray_index;
maparray_t maparray(boost::extents[3][4]); //actually constructs the multi array[/cpp]
Not sure what is going on with MSV C++ 08'...
[code] Compiling...
High_Scores.cpp
Linking...
Embedding manifest...
Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.
Build log was saved at "file://e:\C++\Random Classes\High_Scores\High_Scores\Debug\BuildLog.htm"
High_Scores - 1 error(s), 0 warning(s) [/code]
[QUOTE=Werem00se;27550307]Not sure what is going on with MSV C++ 08'...
[code] Compiling...
High_Scores.cpp
Linking...
Embedding manifest...
Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.
Build log was saved at "file://e:\C++\Random Classes\High_Scores\High_Scores\Debug\BuildLog.htm"
High_Scores - 1 error(s), 0 warning(s) [/code][/QUOTE]
Sometimes it fails to embed the manifest for whatever reason and you have to build it multiple times before it 'sticks'.
[QUOTE=yakahughes;27551027]Sometimes it fails to embed the manifest for whatever reason and you have to build it multiple times before it 'sticks'.[/QUOTE]
I did not know that, I'll try a few more times. Thank you very much though!
[editline]20th January 2011[/editline]
/lulz
It worked on the first try.
[QUOTE=shill le 2nd;27550253]Did you ever actually construct the multi_array?
[cpp]boost::multi_array<char, 2> maparray(boost::extents[3][4]); // assuming the initial dimensions are 3x4[/cpp]
but you should use typedefs:
[cpp]typedef boost::multi_array<double, 3> maparray_t;
typedef maparray_t::index maparray_index;
maparray_t maparray(boost::extents[3][4]); //actually constructs the multi array[/cpp][/QUOTE]
Why do I have to use typedefs? Also I get this map.h(31): error C2061: syntax error : identifier 'extents'.
This is in a header for a class by the way.
typedefs reduce the typing and the chance of accidentally typing it wrong. Also that error means there's no such thing as the identifier 'extents' in the namespace 'boost'.
[QUOTE=yakahughes;27554786]typedefs reduce the typing and the chance of accidentally typing it wrong. Also that error means there's no such thing as the identifier 'extents' in the namespace 'boost'.[/QUOTE]
I understand that, but why is it saying that? When I type boost:: the thing gives me a list of the things in the name space, and extents is one of them.
Is there anyway of keeping the text cursor from moving back to the beginning of the text box after I click a button and use:
textBox1.Text = textBox1.Text.Insert(textBox1.SelectionStart, "<Object>" + "</Object>");
[QUOTE=Kidd;27563218]Is there anyway of keeping the text cursor from moving back to the beginning of the text box after I click a button and use:
textBox1.Text = textBox1.Text.Insert(textBox1.SelectionStart, "<Object>" + "</Object>");[/QUOTE]
[url]http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.selectionstart.aspx[/url]
Ahh...good good.
Is it possible to remove the border of a given process? (If so, how?)
Language is C#.
[QUOTE=Dj-J3;27567666]Is it possible to remove the border of a given process? (If so, how?)
Language is C#.[/QUOTE]
What is the border of a process? If you mean the border of a window, yes, you can use SetWindowLong with GWL_STYLE and the appropriate values and flags.
[QUOTE=yakahughes;27571301]What is the border of a process? If you mean the border of a window, yes, you can use SetWindowLong with GWL_STYLE and the appropriate values and flags.[/QUOTE]
Is it possible to get the form of the process?
Example:
[cpp]Form form = Form.FromHandle(proc.MainWindowHandle).FindForm();[/cpp]
Don't have any idea if this is remotely close to what is correct, so correct me if i'm wrong.
My main problem though is that i can't seem to find the handle of the process, it's always null. (or rather, the form from the handle is)
[QUOTE=Dj-J3;27574004]Is it possible to get the form of the process?
Example:
[cpp]Form form = Form.FromHandle(proc.MainWindowHandle).FindForm();[/cpp]
Don't have any idea if this is remotely close to what is correct, so correct me if i'm wrong.
My main problem though is that i can't seem to find the handle of the process, it's always null. (or rather, the form from the handle is)[/QUOTE]
Windows Forms is .NET specific. The Garry's Mod window, for instance, is not a Form, but an HWND.
What are you trying to do, maybe we can help better if we know that.
[media]http://img192.imageshack.us/img192/7495/38830609.png[/media]
How do I get this to stop. I get this no matter what I do. It's stopping me from being able to learn
[QUOTE=yakahughes;27574428]Windows Forms is .NET specific. The Garry's Mod window, for instance, is not a Form, but an HWND.
What are you trying to do, maybe we can help better if we know that.[/QUOTE]
I want to remove the border from Bad Company 2 so that i can play fullscreen in window mode.
AFAIK MainWindowHandle is the hwnd.
[QUOTE=The Great Ghast;27574805][media]http://img192.imageshack.us/img192/7495/38830609.png[/media]
How do I get this to stop. I get this no matter what I do. It's stopping me from being able to learn[/QUOTE]
Open your project properties, go to Linker -> System and select Console as SubSystem.
[QUOTE=The Great Ghast;27574805][media]http://img192.imageshack.us/img192/7495/38830609.png[/media]
How do I get this to stop. I get this no matter what I do. It's stopping me from being able to learn[/QUOTE]
Fixed it for you over teamviewer
Son of a bitch took over my comp while I was eating dinner. How did you not see my porn?
Where should I start with learning Java
Is there any way to get a pointer to a function or method? I want to have an array of commands to execute which I can go through with a for loop.
[QUOTE=Doritos_Man;27576603]Where should I start with learning Java[/QUOTE]
Books are good :V:
[QUOTE=ProWaffle;27578501]Is there any way to get a pointer to a function or method? I want to have an array of commands to execute which I can go through with a for loop.[/QUOTE]
Yes (assuming C/C++), though the syntax is a little tricky:
[cpp]
void foo(int a, char b) {
// ...
}
// Define a pointer to the function
// (Note that the ampersand isn't strictly necessary)
void (*p_foo)(int, char) = &foo;
void bar() {
p_foo(42, 'X');
}
[/cpp]
It's often helpful to declare a typedef for the function pointer type that you want, e.g.
[cpp]typedef void (*StringHandler)(std::string const &)[/cpp]
so that you can easily use it in a function's parameter list:
[cpp]void SetStringHandler(StringHandler handler);[/cpp]
Calling it is pretty straightforward:
[cpp]
void MyStringHandler(std::string const &str);
void blah() {
SetStringHandler(MyStringHandler);
}
[/cpp]
[url=http://www.parashift.com/c++-faq-lite/pointers-to-members.html]Pointers to member functions[/url] are a strange beast: they're not actually pointers.
I've got a python module I'm writing which uses multiprocessing extensively, in particular classes with base class multiprocessing.Process. I would like to be able to, on windows, have a file like this:
[code]import myModule
someInstance = myModule.someClass()
# ... Do stuff[/code]
However, this fails as python attempts to compile both files and ends up spamming processes. I can add "if __name__=='__main__': " to fix this, but is there any way to make the module safe to import as in the example? I assumed that the modules being in seperate files would take care of this issue and I don't intend to expose any of the Process instances to the user.
[editline]22nd January 2011[/editline]
I'm guessing it isn't possible :sigh:
[editline]22nd January 2011[/editline]
Alternatively, a method to detect this happening from the module and exit cleanly (instead of killing the computer with processes) would work.
What does an A* pathfinding algorithm do if the location is unreachable?
Sorry, you need to Log In to post a reply to this thread.