|
Hi
I wish to have fun a little with the 3D under VB.net, and for some time I get information a little to know what to use.
Until recently, I thought that there were only Direct3D or OpenGL, but I have just discovered XNA and SlimDX, but I am lost a little.
Apparently, XNA is not supported by VB, and as I do not know too C#, it is apparently not the good solution for me.
In many forum topics, one can read that DirectX is not supported any more.
Consequently, I am lost, and I wonder what is the best solution. I do not wish to make a game, only a mesh viewer and some calculations on the position of the points of the mesh.
My true goal would be to make a 3D scanner, but already, a mesh viewer would be already well.
What would advise me to be used? Especially, that is what will be simplest?
It is really disadvised using Direct3D as many examples of it are found?
Thanks in advance for your advises ... and sorry for my bad english
edit:
I have forgotten WPF. I don't know WPF very well,I am more at ease with the winforms.
is this an good idea to make a component WPF and to import it in a winform?
that annoys to me to pass in WPF right for the 3D.
|
|
|
|
|
There isn't any good VB.NET solution for 3D. Everything that uses managed code uses C#. There are other solutions out there that use a flavor of BASIC though.
As far as C#, you know more about it than you realize. VB.NET and C# are not all that different. Most of what you're typing is using .NET classes and methods anyway and the structure of each of those statements is very similar almost like you're typing VB.NET and putting a semicolon on the end.
Seriously, if you want to pigeon-hole yourself into VB.NET, that's fine. But if you want to expand your skills beyond just VB.NET, then now is the perfect time to learn C#. You'll find a ton of XNA samples and examples, all written in C#.
norrisMiou wrote: I have forgotten WPF. I don't know WPF very well,I am more at ease with the winforms.
is this an good idea to make a component WPF and to import it in a winform?
that annoys to me to pass in WPF right for the 3D.
Pickup a book on WPF. It's the best way to go to learn it in an organized manner.
|
|
|
|
|
norrisMiou wrote: and sorry for my bad english
Don't appologise for trying.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks for your replies.
I know that I should upgrade to C#, but I hate this semicolons and brackets ... I am just a small "sunday programmer" as we say in France
Some people on others forums say that XNA works with VB.Net ... that's right ? It seemed me to have read that many functions of XNA were not supported by VB.
|
|
|
|
|
Ok. I tested XNA with C#, and I acknowledge that it is not so hard which I thought it. In 5 minutes, I succeeded with loading a 3D mesh and that seems easier to set up than with MDX.
I then sought how to load an XNA window in a traditional winform while following the examples on their site.
That doesn't seems as simple as I tought it. There is a whole package of additional classes of which I did not really understand the utility. Ok, it is not very serious, I could spend a little time understanding them.
It would seem that one is obliged to install XNA Game Studio to make function these examples and that the redistribuable DLL is not enough.
What I believed to understand, which it is XNA or WPF, both function with DirectX? Therefore, I don't understand why we could not continue to use it.
Therefore, if MDX is deprecated and that XNA needs the Game Studio to function, there does remain only WPF which would be even sufficed for him?
What does we have to use if we just want to reach information of the graphic card ?
I am thus say “Ok, continuous with MDX”. But I have upgraded to .Net 4 and this have not DirectX in .Net references
Very crazy thing ! no ? Or then there is something which I did not understand.
|
|
|
|
|
You do NOT need XNA Studio to run the finished .EXE. Read this[^].
|
|
|
|
|
Thanks for the link.
But I can read this ...
"Also, the XNA Framework Redistributable file does not contain the Content Pipeline Build Runtime. Building content at run time is supported only when XNA Game Studio has been installed on the Windows-based development computer."
For my app, I think I need loading content at runtime. Is there something that I did not understand?
|
|
|
|
|
Your LOADING content at runtime, not BUILDING it at runtime. Unless you're providing the user the ability to create their own content for your app you don't need it.
|
|
|
|
|
I need to detect when the print button is clicked in a 3rd party app. I've used Spy++ and can return the hWnd of the toolbar but I'm not able to get the hWnd of the individual buttons. In fact, Spy++ does not return any messages when the/any button is clicked.
What I want to do is intercept the Print button click and destroy the messages and launch my own Print/Report App.
I've considered and tried allowing the Apps Print Preview to launch and used WM_SYSCOMMAND with SC_CLOSE to close the window before it has a chance to open. Unfortunately it causes the App to crash.(that is the the app with the button used to launch the Print Preview)
I've considered programatically (using api's) setting the focus to the Print Preview and using SendKeys to send an "Alt F4" but I have the problem of timing as the Print Preview window varies it's opening time depending on how much data it is processing.
I would/could check for a mouse click if I new the hWnd of the individual buttons. This brings me full circle to my original problem and that is finding the hWnd of the toolbar buttons.
I'm using VB9 (vb 2008). I don't have any problems using API's and could write (with help) a c++ dll for subclassing if I had to. (I don't mind learning new things). I just need to have someone discuss this with me and help by pointing me in the correct direction.
|
|
|
|
|
You probably can fix the timing problem (before sending Alt/F4) by using a loop that gets and checks the WindowText of the current foreground window. Make sure to waste some time too, say 33 msec, on each iteration.
|
|
|
|
|
Thanks for your reply. Alt/F4 is the very last thing I want to use.
In VB6 we had DoEvents. We no longer have this with vb.net. I looked at Sleep.Thread (not sure of syntax right now) and this appears to have problems as well when it comes to allowing other threads to process while in a loop.
There must be a way to use API's to accomplish what I need to do.
|
|
|
|
|
drh6558 wrote: In VB6 we had DoEvents. We no longer have this with vb.net
Application.DoEvents() is available; it seldom is the correct way to solve any problem.
drh6558 wrote: I looked at Sleep.Thread (not sure of syntax right now) and this appears to have problems
Thread.Sleep() works just fine for me; it needs to be used correctly, i.e. in some thread, and not inside an event handler.
|
|
|
|
|
Again, thanks for your reply.
I tried the "Alt/F4" senario this morning and found another problem that I was not aware of. If there is any data missing when the "Print" button is pressed, the application will open another window letting the user know that there is data missing.
Unfortunately, this brings me back to detecting the Toobar button click and destroying the subsequent messages. Doing it this way prevents any further surprise windows from opening.
So how do I enumerate the Toolbar child windows (enumerate the buttons to find the hWnd)?
|
|
|
|
|
You'll probably need to look around a lot. I assume you already have a handle to the main window, if not one way of getting it is by enumerating all top-level windows (EnumWindows[^]); for each window you can enumerate all child windows (EnumChildWindows[^]); doing this hierarchically will in the end lead to each and every window.
Using SPY++ may help you in identifying which ChildWindow it is you want.
If your button is a real Windows button, that should do it; if it is just a rectangle drawn by an app, which also reacts on that area being clicked, then nothing you try may help you.
|
|
|
|
|
If it creates a new process then Kill that process
SOFTDEV
If you have knowledge, let others light their candles at it. [ Let's work to help developers, not make them feel stupid ]
|
|
|
|
|
Yes, this is what I want to do but I'm having trouble finding the Toolbar Button to do this.
When I use Spy++ and select the button, the whole toolbar becomes selected. So when I try and enumerate the child windows no children are returned.
In order to return any real messages, I’ve ended up selecting the Main Window, “All windows in System” and “Non-Client” message group.
Yesterday, just before I started driving, (btw, I'm a commercial truck driver in this life. In my last life I was a vb6 programmer), I was trying different things using Spy++. I clicked on a toolbar button then moved off the button before releasing the left mouse button (button down only), I think I was able to see each toolbar buttons window. However, I don't know which child is which. Each button uses a bmp and contains no identifiable text. I will try and replicate this again and see if it can be of use.
Any ideas would be help and greatly appreciated.
|
|
|
|
|
My point of view was that when that message appears does it creates any new process in CPU tasks , if so then kill that task or use send keys if that task is running
SOFTDEV
If you have knowledge, let others light their candles at it. [ Let's work to help developers, not make them feel stupid ]
|
|
|
|
|
This is a Windows Print Preview window that gets loaded from the Main window/app. When I end the process in the Task manager, task manager responds with application not responding for both the main app and the print preview. Task manager then shut both down, main app and print preview.
|
|
|
|
|
I want to pick a value from a DateTimePicker in 'MM/dd/yyyy hh:mm tt' format, add 00 as second with it, store it in a DateTime variable and save it to database. Suppose if I pick the value 05/28/2010 9:25 AM or 05/28/2010 9:25:34 AM from the DateTimePicker, it'll be stored in the variable and saved to database as 05/28/2010 9:25:00 AM irrespective of what value is chosen from the DateTimePicker for second. I'm using the following statement but it's getting failed during the format conversion while storing it in the DateTime variable generating an error.
Dim dtmReminderTime As DateTime
dtmReminderTime = DateTime.Parse(Format(dtpReminderTime.Value, "MM/dd/yyyy hh:mm") + ":00 " + Format(dtpReminderTime.Value, "tt"))
I tried the other way but failed:
dtmReminderTime = Convert.ToDateTime(Format(dtpReminderTime.Value, "MM/dd/yyyy hh:mm") + ":00 " + Format(dtpReminderTime.Value, "tt"))
I have also tried using culture specific information but of no avail. Please help.
|
|
|
|
|
Don't convert datetimes (or floats or anything that isn't really a string) to strings just for performing some operation on it, there always is a better way.
If your DateTime holds some seconds, and you want to get rid of them, try this (example is C# code, VB is similar):
DateTime dt1=myDateTimePicker.Value;
DateTime dtWithoutSeconds=dt1.AddSeconds(-dt1.Second);
Warning: if the initial DateTime holds fractions of a millisecond (e.g. when it comes from DateTime.Now) then this technique won't work, as there is no easy way to get the amount of ticks that corresponds to that fraction of a millisecond.
|
|
|
|
|
Dim dtmReminderTime As Date = Nothing
With dtpReminderTime.Value
dtmReminderTime = New Date(.Year, .Month, .Day, .Hour, .Minute, 0)
End With
Debug.Writeline(dtmReminderTime.ToString)
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
I'm trying to match a certain DateTime value with the current system DateTime. I have a timer and a label on a form. Timer interval is set to 1000. When the form loads, the timer starts ticking. As soon as the current DateTime matches the value of the variable, it shows a message in the label.
When I'm writing the following code, the values don't match even if the current system DateTime is equal to the variable. Label1 isn't showing 'Times Matched':
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim dtmNow As DateTime
dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#
dtmNow = Now
If dtmVar = dtmNow Then Label1.Text = "Times Matched"
End Sub
But when I'm writing the same code by parsing 'Now' into DateTime it's working fine.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim dtmNow As DateTime
dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#
dtmNow = DateTime.Parse(Now.ToString)
If dtmVar = dtmNow Then Label1.Text = "Times Matched"
End Sub
Why is it so? The default format of 'Now' is the same as I have stored in dtmVar variable. So there's no question of format mismatch. Does that mean 'Now' is not actually a DateTime property?
Provided, my O.S. is Windows Vista Ultimate and all date/time settings are set to default.
Regards.
|
|
|
|
|
DateTime has a resolution of 1 tick, i.e. one 10 millionth of a second.
DateTime.ToString() shows time to some resolution, probably up to a second or so; this means two DateTimes that look the same (as they produce the same ToString result) may be actually quite different.
It is in general a bad idea to compare two DateTimes for equality.
Have you ever done floating point calculations? There too it is a bad idea to test for equality.
Either you need to allow some tolerance, as in If value1 < value2+somethingSmall (pretty common in floating-point algorithms), or you really need an inequality test, as in if Now>=alarmTime
|
|
|
|
|
Hi:
I have an application, which I can only change via script. I need to find a way to clean the keyboard buffer and then block it, because sometimes press the keys too fast and run events in the application that should not run. I can not change the hard code. Hopefully I can help
|
|
|
|
|
What do you mean "only change via script"? Are you saying that this application has it's own scripting language? Are yousaying that you can only use VBScript? What?
|
|
|
|