Volte
*Experts*-
Posts
2372 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Volte
-
Included with the Windows Common Controls package is an Animation control; it plays AVI animations (it's not a real AVI player) such as the "file moving" and "file deleting" animations that are included with Visual Studio in the <VS Dir>/Common7/Graphics/Videos directory. VB6's Common Controls package had this control wrapped so you could use it in VB; .NET does not. That's why I wrote this control. It's a basic wrapper for the animation control for .NET, written in C#. The code is commented, so it shouldn't be that hard to figure out. To use it simply set the Filename property to the AVI animation (no sound can be in the file) you wish to play, and set the AutoPlay property to the desired value; True means it will start playing on load (or, if you set the Filename in code, as soon as you do so). You can control the number of iterations and the portion of the animation to play further by starting the file manually with the Play method: Play #1 (int repeat, int from, int to) This function will repeat a certain portion of the animation a specified number of times. repeat - the number of times to repeat the animation. -1 means repeat forever. from - the frame you wish to start playing from. 0 means start from the beginning. to - the frame you wish to play to. -1 means play to the end. Play #2 (int repeat) This function will play the whole animation a certain number of times. repeat - the number of times to repeat the animation. -1 means repeat forever. Play #3 (int from, int to) This function will play a certain portion of the animation forever. from - the frame you wish to start playing from. 0 means start from the beginning. to - the frame you wish to play to. -1 means play to the end. Play #4 () This function will play the whole animation forever. Please direct all comments and bugs to me in private message. [edit]Fixed an error that has been bothering me for awhile[/edit] animationcontrol.zip
-
Can C++ .net make completely unmanaged app easily?
Volte replied to aewarnick's topic in Visual C++ .NET
C++ isn't exactly "hard" like climbing a mountain is hard. It's mostly just tedious, tiring work. It's heavily based on logic and structure so if you plan ahead, you'll be fine. However, I think C++.NET removes some of the tedium from low-level programming, but still gives you the control you may need with C++. So, no, I don't think C++.NET is "harder". -
myNum = Int32.Parse(stringVar);Note that you should put this inside a Try..Catch block, because that will raise an error if the input string is not a valid number.
-
Is it crashing at the same point every time? Do you have some sort of anti-virus program or something that could be attempting to stop your program's thread (unlikely...).
-
There's no easy answer to that. AI is a very very complicated task. For my end-of-year project in QuickBASIC I made a 2 player chess game, and that was very hard even without a computer player. Having AI would have made it incredibly hard. To design chess AI that is half-decent, you need to understand the senarios completely; what moves take precedence, when the consequences down the road will be. Very advanced stuff. They managed even to make a chess AI that beat Gary Kasparov, but only in 2 of 7 games or something, and that was an IBM super computer that a team of skilled logicians and chess players worked at creating. Checkers won't be so hard, but AI of any kind will be a big challenge. I suggest you do some searching of Google, and some intensive reading.
-
Paste your code here, please. We really can't help you without knowing even vaguely what could be causing the problem.
-
As a militant coding-standard follower, I would never use a Module in my program. It defeats the entire purpose of VB (to provide a full OOP programming language) by allowing you to use old, obselete modular programming practices. You should do this: Public Class SomeClass Public Shared Sub MySub() 'do stuff! End Sub End Classand call it like this: SomeClass.MySub()Just as easy to do as a module, but it keeps your code fully framework compliant, object-oriented, and organized. Shared allows you to access members of class without first creating an instance.
-
If he is using Application.DoEvents it will. You can do this: Private keeplooping As Boolean = True Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Do While keeplooping Application.DoEvents() 'other stuff Loop End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click keeplooping = False End IfThat'll turn off the boolean variable which will cause the loop to stop after its next iteration (it will not break out of the middle of the loop).
-
If CheckBox1.Checked = True Then
-
You need to use the NotifyIcon control. Look in the MSDN for more information.
-
In the form you wish to minimize: Me.WindowState = FormWindowState.Minimized
-
What do you mean? You mean the program does something when it starts and then exits? I don't understand what you mean by "the program never shows up in the folder" and "the whole program was located in the Form_Load section".
-
You don't need DoEvents in this case. At the point of their execution, the machine is already free to do anything it might need to do. You may want to look into threading to do this though, as it will cause these commands to run separately from the rest of your program, so it may be faster.
-
It should work. Are you sure the error is not somewhere else (or is it maybe a logic error resulting in that code never being executed)?
-
You need to create a design-time designer for your control and assign it a designer verb (those little links at the bottom of the property window). divil has written an excellent tutorial or two on the subject, available in the Tutors Corner or at his site.
-
The MDIClient is the part of the form which can hold children; an MDI window is made of two parts: the main window, same as all the other windows, and an MDI client window, which is the part with the (usually) gray background that can hold other forms. In C#, preceding a string with @ tells it not to process escape codes (they are in this format: \x where x can be a number of different things). Without it, divil would have had to change the path to "C:\\windows\\coffee bean.bmp", because \\ is the escape code for \. However, telling it not to look at escape codes allows him to use \ without error. To use an image from a resource file: private Bitmap GetResourceImage(String name) { return new Bitmap(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(name)); }Now as long as you've marked the image you want in your resource file as "Embedded Resource" (for Build Action), you can replace the line myBitmap = new Bitmap(@"c:\windows\coffee Bean.bmp");with this: myBitmap = GetResourceImage("MyNamespaceName.ImageIdentifier");
-
They may not, but they can in theory. Code from either language, as long as it stays within the framework, can compile to be the same if you use the same structure. There is a code decompiler available (can't remember the URL, but they had an online demo, which I tried one of my DLLs on) which can decompile any component to both C# and VB.NET, and the structure is the same either way. This concept works both ways.
-
D'oh! I completely midunderstood the question. :o
-
-edit- I was referring to starwiz's post -- Derek snuck in whilst I was typing. -/edit- They may do, I'm not sure. I know that this is what #define does in C++, but then again, const also exists in C++. I'm not exactly sure. Regardless, I doubt you'll see a different either way.
-
MessageBox's don't contain TextBoxes... do you mean you want to include images? If you do, you can use the predefined icons in a MessageBox (Exclamation, Question, etc). By setting the appropriate parameter of the .Show() method. Anything above that and you'll need to design your own form to look like a message box.
-
No, not really. You can't make a constant with an array type (or any class type, for that matter). Don't worry though, having an array which is dynamic rather than static won't exactly hit your program with a speed decrease. You won't notice anything at all. And a constant doesn't use less memory anyway (as far as I know, anyway)... a constant integer takes up 4 bytes, just as a regular integer does.
-
I think Photoshop 7 has a COM component for VB6 to use, but that would be a large overhead. You should try changing the SmoothingMode of the Graphics object you are drawing on to 'None' before you draw the text, as the anti-aliasing may be causing the characters to look distorted.
-
You could make the variable a publically Shared/static one of the class you are talking about (meaning, of course, that you can access it without needing an instance of the class). Then you just increase it in the constructor and decrease it in the destructor. Much like the way COM classes work with AddRef and Release. Public Class MyClass Public Shared refCount As Integer Public Sub New() refCount += 1 End Sub Protected Overrides Sub Finalize() MyBase.Finalize() refCount -= 1 End Sub End Class
-
The board is for discussing things that are not necessarily programming related. It's not a post-whatever-is-on-your-mind-at-any-given-time forum.