|
O.G.I. wrote: the moving objects I use are actually windows forms
Yikes! I think that's the heaviest control you could have used. Truthfully, I wouldn't have used anything in the ToolBox, but instead went with either drawing everything myself, or gone with the XNA framework.
O.G.I. wrote: I suspect that using windows forms as units in the playground field is a bad idea
Yep - it is!
O.G.I. wrote: You can try this by yourself
I don't have to. I KNOW it's a really bad idea. Since you just created a small form, removing the borders and titlebar, along with just about everything else, you've essentially made a very heavy-weight Panel control.
O.G.I. wrote: I thought to try C++ with DirectX, but I still don't have money to buy these products. I heard that DirectX is optimized for game programming.
You don't need C++ and DirectX. And, BTW, the DirectX SDK is free and you can pickup the Visual C++ Express Edition for free, here[^].
If I were you, with little experience, I'd start with the XNA Game Studio[^]. It uses C#, but is not that hard to learn if you know VB.NET already.
|
|
|
|
|
|
Wouldn't it be a lot more efficient to actually test each pair of objects for a possible overlap (based on their shapes and coordinates), rather than dealing with 81 million pixels? You can further optimize by:
- sorting the objects to some criterium, say the leftmost x-coordinate
- have a rectangular outline for initial tests; and only when those overlap do a more elaborate test taking actual shape into account.
- not testing pairs of non-moving objects.
It may take a slightly more complex piece of code, but it will be worth it.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Is there a way to bypass the form_load event of vb.net windows application?
and instead it calls a particular function instead.
Rgds,
Rains
|
|
|
|
|
Do you actually need to bypass the calling of the Load-method, or do you want to execute your function instead? 'Real' bypassing is harder, but if you only want to replace the things that get executed during "Load" with an other function then this would suffice;
Form1_Load(object sender, EventArgs e)
{
MyMethod();
return;
InitializeComponent();
DoOtherStuffThatDoesntGetExecuted();
}
I are troll
|
|
|
|
|
yes I want to bypass the load method. As the exe needs to be called from 2 places.
one is through VB5 application i.e. calling a function in vb5 application and the other if it runs itself.
|
|
|
|
|
In that case you'll want to know who started the application, before deciding that you're going to skip the rest of the form_load .
Form1_Load(object sender, EventArgs e)
{
if (StartedFromVB5)
{
return;
}
}
You might add a parameter to the launch of the executable when running it from VB5. You could use this parameter to decide whether or not to skip the load method.
Good luck
I are troll
|
|
|
|
|
Thanks.
one more question. how can you call a vb.net exe from vb5?
|
|
|
|
|
Yup, that's possible. Works just like calling an ordinary executable.
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
This works in VB6, can't give any guarantees for VB5 though.
I are troll
|
|
|
|
|
Hi,
What are you assuming will or will not happen when you "bypass" the form load event?
Alan.
|
|
|
|
|
Scrap everything you have. Your application design is bad from the start. You can't "bypass" the load event in the form. The problem is you combined your app's business logic in with the UI code of the form. Move all of your buiness code to a seperate .DLL that both VB5 and VB.NET project can use and you solve all of your problems.
|
|
|
|
|
Yes true, but it is not possible to make a dll right now as the application is working on for years...
do you have other alternative
|
|
|
|
|
You simply don't have a choice. You cannot just call any function you want in any application. It doesn't work that way.
|
|
|
|
|
Hi, I have two projects doing different thing complied and working fine. I need to combine these two project and use one as main to call the other when you click from menu of the first one.
What i have done:
1. I have successfully add the other project using the project explore
What to do:
I want to call the this other project menu from another.
Please help
thanks.
Emma
|
|
|
|
|
You would create an instance of the main window of the second project and then show it with ShowDialog. Just like any form in your project.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanks for your response. That what i have done but generate error or did not give showDialog method when i call my instance.
see my code
Private Sub RestoreToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestoreToolStripMenuItem.Click
Dim frmSecondMenu As New SecondMainMenu
frmSecondMenu. (this did have showDialog in the list of methods)
End Sub
if i type it as frmSecondMenu.ShowDialog() i have the following error
Error: Error 9 'showDialog' is not a member of 'System.Windows.Forms.SecondMainMenu'.
what will i do
|
|
|
|
|
Hi,
I want to call a private function (We can make the function public.) in VB.Net (The project type is windows application) from visual basic 5. VB.Net application is set up as an exe.
I appreciate your early response.
Rgds,
Rains
|
|
|
|
|
Your options are to make the VB.NET project a COM object ( can that be done with an exe ) or using WM_COPYDATA and interop, or some other messaging mechanism.
Making the function public won't help, VB5 is even more obsolete than VB6, it can't speak .NET.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
VB.Net project is an exe. we cant make it as a dll..it has a user interface...
can we tweak the code so that depending on from where it is called we can either call the form load or the function??
|
|
|
|
|
plz anyone answer my question
|
|
|
|
|
What specifically is your problem?
|
|
|
|
|
take you pick VB6, Crystal Reports, either one is a show stopper. Oh yeah and idiot on the keyboard.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i have developed project in vb 6.0 &report:crystal report database ms access 2007.each and every time report not fully display it ask refresh.then only i got fully report.thats my problem
|
|
|
|
|
You didn't ask one. Configure it, how ? Why would a product released in 2008 have the ability to talk to a product that became obsolete six years before ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have developed project in vb 6.0 &report:crystal report database ms access 2007.each and every time report not fully display it ask refresh.then only i got fully report.thats my problem
|
|
|
|