|
Hi,
I have checked quite a few sites and articles but am not able to figure out how to solve my problem. The problem is:
I am creating a setup for a project. In that I want to include 2 more EXEs which will perform while the setup is run. 1. Wirting Serial number into the registry and 2. Installation of MySql.
I have tried with Custom Action but it copies the Serial Number Registration EXE in the folder where the installation is taking place. This I don't want. It should run the file and then remove it.
If anybody can help me in this I will be obliged.
|
|
|
|
|
SPSandy wrote: it copies the Serial Number Registration EXE in the folder where the installation is taking place That's OK - add another custom action which runs that executable, and one more which removes it.
As for the MySQL installation, you could try a precondition for your setup.
|
|
|
|
|
Thanks for the suggestion. I did that but the setup gets abandoned once I remove the EXE.
|
|
|
|
|
I think he meant add an action that removes the exe after set-up is complete..
|
|
|
|
|
I just found out a VB.NET DLL application was not, as I thought, put into SourceSafe. I do have the complied code (DLL, PDB, XML). Is there anyway I can recover the bulk of the original .NET code?
The folders were supposed to be backed up, but obviously weren't...
Thanks in advance,
Tim
|
|
|
|
|
Download JetBrains DotPeek[^], it has an option for decompiling back to a project. As long as the original project wasn't obfuscated it should produce workable (or close to it) code.
Edit: JetBrains produces C# code, you can use any number of C# to VB converters to convert it back to VB.
|
|
|
|
|
Thanks for the information; working on the recovery and will advise of my results.
|
|
|
|
|
How to plot sin wave in vb.net
|
|
|
|
|
Try this link[^]
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
What is the exact use of data repeater??
|
|
|
|
|
|
how to fill the values from a sqldataadapter to datagridview in vb.net
|
|
|
|
|
|
|
I have using 64 bit system. i am using crystal report but report viewer not supported in 64 bit system. (Server 2008 R2)please tell me any answer.
Pankaj tripathi
|
|
|
|
|
|
Dim Query = From T1 In DataTable1 _
Join T2 In DataTable2 On T1("ID_DataTable1") Equals T1("ID_DataTable2") _
Select (Function(p, index) New With {.RowNumber = index+1})
no row get

|
|
|
|
|
You already posted this in the LINQ forum; please do not cross post.
Veni, vidi, abiit domum
|
|
|
|
|
Hello all!
I am working on a program that I hope will get me more familiar with Visual Basic. I have done lots of programming in other languages, and tons of VBA programming, but this is the first time I am trying to make something completely in VB.
The project is a screensaver that displays photos from a specified folder. The photos should pan and zoom in a pleasing fashion. Eventually I would like to add a fade effect between photos.
To get started I found an excellent photo screensaver project here:
http://blogs.msdn.com/b/vbteam/archive/2009/01/23/an-updated-screensaver-example-matt-gertz.aspx?Redirected=true[^]
Matt Gertz put together a fantastic project that does almost exactly what I want. So I modified the code a bit and use a second timer(1ms) on the form to control the animation of the images. Clearly I have no idea what I am doing, but I did get the basic sliding and zooming effects using things like:
Me.PictureBox1.Left = Me.PictureBox1.Left - 1
Me.PictureBox1.Height = Me.PictureBox1.Height + 1
Me.PictureBox1.Width = CInt(Me.PictureBox1.Height * SizeRatio)
Now that I have thoroughly wet my toes in VB, I wanted to stop in and ask the experts. I know that I am going about this image moving thing all wrong. I should probably be using some kind of ActiveX or OpenGL, or some other graphics engine.
Would any of you be kind enough to point me in the right direction?
Some sample VB projects would be immensely helpful.
In the meantime I will continue to play around with this. There are many flaws that I am happy to discuss if anyone wants. I could send the entire project I have edited if it would be helpful.
Thanks for your time and I look forward to your replies.
Nate
(It's probably worth mentioning that I am running VB Express 2010 on Windows 7 64 Pro.)
|
|
|
|
|
Member 10488758 wrote: I know that I am going about this image moving thing all wrong. Nope, sounds like a good idea to use controls for this purpose. They're not optimized to be animated though. There's a different set that is, but more on that at the end of this post.
Alternatively, you could check out the forms' properties; it has an OnPaint[^] handler that you can override. You could nicely draw a bitmap offscreen (in a separate thread) and paint it when ready.
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
Using b = _generation.GenerateBitmap()
e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor
e.Graphics.PixelOffsetMode = PixelOffsetMode.Half
e.Graphics.DrawImage(b, 0, 0, Width, Height)
End Using
End Sub
Member 10488758 wrote: I should probably be using some kind of ActiveX or OpenGL You'd like to dive into the world of WPF[^]. It also uses Forms and Controls, but these are a bit more modern, and rendered using DirectX. Additionally there'll be easier animations, gradients and more of the like
Found two articles on CodeProject related to WPF Screensavers, but both are aiming at C#. There's no specific example for VB.NET (hint, hint)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the info Eddy! Are you suggesting that VB probably isn't the best way to program a screensaver? LOL I have always hated C, but I can pick it back up if I need to. If I can make this program work it would be much easier since the majority of it has already been written for me!
|
|
|
|
|
You're welcome
Nate Schoonover wrote: Are you suggesting that VB probably isn't the best way to program a screensaver? Depends on what you are doing; it's not VB that's slowing your graphics down, but WinForms.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks again. Can you help me understand this a bit more? How is WinForms slowing the graphics, and how can I skip it?
I think that I should not be using the form timer for animations this seems hacky, and there is not much control over speed or framerate.
I would love to get this working in an ideal way with VB. I already have a solid working example that I would love to post for critique. Is anyone willing to help me fine tune this program a bit? And how can I post an example project here (if that is allowed)?
|
|
|
|
|
Nate Schoonover wrote: How is WinForms slowing the graphics, and how can I skip it? The WinForm api is a set of controls, not designed with great graphics in mind - graphics cards didn't require dedicated coolers in those days. It doesn't use DirectX like WPF would, it would use the CPU for drawing.
Nate Schoonover wrote: there is not much control over speed or framerate. One doesn't control the framerate under Windows; Windows dictates how much CPU time your app will get, and then you go for the maximum amount of frames.
Now, you could draw yourself on a (base) WinForm, which means that it'll speed up a bit, since it requires one less picturebox is resources.
Nate Schoonover wrote: And how can I post an example project here (if that is allowed)? If you're planning to write an article on the subject, then that would be the place to upload the code. It'd be "in draft" and invisible, until it's working ofc
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks Eddy! I will get rid of the picturebox as you suggested, one less thing to slow things down. I think writing up a draft would be a good idea. I will post it in a few days.
I have a few other things I need to sort out first. I am having trouble with loading settings using the base code I borrowed from Gertz. http://blogs.msdn.com/b/vbteam/archive/2009/01/23/an-updated-screensaver-example-matt-gertz.aspx?[^]
Most of the example code works great, but when I install the screensaver and use the config mode to define the source folder and other settings, the final settings are not used when the screen saver executes via Windows.
This is strange because the settings are used correctly in preview mode. However, when the Windows timer sets off the screensaver all the settings go back to default. This is the correct behavior if the screensaver does not detect any previous settings, but I can't figure out why it would load settings correctly in preview mode and not the regular mode.
The settings are being stored correctly in the User\AppData folder. There is nothing obviously wrong with the code, I am afraid I am missing something stupid.
For what it's worth I posted the code to the Options form below, but I recon you will have to see it all together to really understand it.
Options.vb
Option Strict On
Imports System.Collections.ObjectModel
Public Class Options
#Region "Member variables"
Private m_Speed As Integer = 3
Private m_ShowTags As Boolean = True
Private m_ShowDates As Boolean = True
Private m_UseSubdirectories As Boolean = True
Private m_Directory As String = ""
Private m_files As ReadOnlyCollection(Of String)
#End Region
#Region "Class Properties"
Public Property ShowDate() As Boolean
Get
Return m_ShowDates
End Get
Set(ByVal Value As Boolean)
m_ShowDates = Value
End Set
End Property
Public Property UseSubdirectories() As Boolean
Get
Return m_UseSubdirectories
End Get
Set(ByVal Value As Boolean)
m_UseSubdirectories = Value
End Set
End Property
Public Property ShowTags() As Boolean
Get
Return m_ShowTags
End Get
Set(ByVal Value As Boolean)
m_ShowTags = Value
End Set
End Property
Public Property Directory() As String
Get
Return m_Directory
End Get
Set(ByVal Value As String)
m_Directory = Value
End Set
End Property
Public Property Speed() As Integer
Get
Return m_Speed
End Get
Set(ByVal Value As Integer)
m_Speed = Value
End Set
End Property
#End Region
#Region "Class Methods"
Public Sub LoadOptions()
Me.Speed = 16
Me.ShowDate = My.Settings.ShowDate
Me.ShowTags = My.Settings.ShowTags
Me.Directory = My.Settings.Directory
Me.UseSubdirectories = My.Settings.UseSubdirectories
If String.IsNullOrEmpty(Me.Directory) Then
Me.Directory = My.Computer.FileSystem.SpecialDirectories.MyPictures
end If
If Me.UseSubdirectories = True Then
m_files = My.Computer.FileSystem.GetFiles(Me.Directory, FileIO.SearchOption.SearchAllSubDirectories, "*.jpg")
Else
m_files = My.Computer.FileSystem.GetFiles(Me.Directory, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
End If
End Sub
Public Sub SaveOptions()
My.Settings.Speed = Me.Speed
My.Settings.ShowDate = Me.ShowDate
My.Settings.ShowTags = Me.ShowTags
If Not String.IsNullOrEmpty(Directory) Then
My.Settings.Directory = Me.Directory
My.Settings.Save()
End If
My.Settings.UseSubdirectories = Me.UseSubdirectories
My.Settings.Save()
If Me.UseSubdirectories = True Then
m_files = My.Computer.FileSystem.GetFiles(Me.Directory, FileIO.SearchOption.SearchAllSubDirectories, "*.jpg")
Else
m_files = My.Computer.FileSystem.GetFiles(Me.Directory, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
End If
End Sub
#End Region
End Class
And here is where the screensaver form is supposed to load the saved settings using the form's Load event:
Option Strict On
Imports System.Windows.Media.Imaging
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.Collections.Generic
Public Class frmScreenSaver
#Region "Variables"
Private m_Options As New Options()
Private m_Random As New Random()
Private m_IsActive As Boolean = False
Private m_MouseLocation As Point
Private m_files As ReadOnlyCollection(Of String)
Private m_fileCount As Integer = 0
#End Region
#Region "Events"
Private Sub frmSceenSaver_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Debug = False
m_Options.LoadOptions()
SetLabelLocation()
Me.tmrUpdateScreen.Interval = m_Options.Speed * 1000
Me.tmrUpdateScreen.Enabled = True
Me.AnimationTimer.Enabled = True
If m_Options.UseSubdirectories = True Then
m_files = My.Computer.FileSystem.GetFiles(m_Options.Directory, FileIO.SearchOption.SearchAllSubDirectories, "*.jpg")
Else
m_files = My.Computer.FileSystem.GetFiles(m_Options.Directory, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
End If
If m_files IsNot Nothing Then
m_fileCount = m_files.Count
Else
Me.lblDescription.Text = "No pictures found!"
SetLabelLocation()
End If
Windows.Forms.Cursor.Hide()
If m_fileCount <> 0 Then
DrawPicture()
End If
End Sub
I left off the rest of the event handles that control the picture drawing and animation, but if you think it would be helpful I can throw that up here too.
Thanks again for your time here! Just let me know if you have any questions about the code. I just can't figure out why the saved settings won't load when executing the screensaver in regular mode.
Nate
|
|
|
|