
Denaes
Avatar/Signature-
Posts
975 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Denaes
-
This line: System.Diagnostics.Process.Start(Path) is used for vb to start another application. Apparently, this starts up the application with its' current directory being your applications directory. ex: your program is starting in "C:\MyVBNetDirectory\" System.Diagnostics.Process.Start(C:\ApplicationDirectory\Application.exe") It looks like this will result in the files 'working directory' being "C:\MyVBNetDirectory" If the application you're running uses absolute paths, then all works pretty well. Also having the dll's registered with the system makes it happy. Apparently I found a piece of professional (Novell) software which this isn't the case. I try to run a Novel Backup from another directory and I get an error that it can't find the Dll's, which are located in this applications directory. It works when I move my VB.Net application over to the Novell Directory, but when its in its own directory, I get the error. I'd much rather have one directory with ALL of my .net applications in it, rather than having them all spread to the winds in random directories. Is there another way to start an application or to insure the application starts in its own directory?
-
Yes, thank you :) Thats what I mean to do
-
Sorry to rehash this and bring it back up again, but if me.close and me.dispose are the preferred and professional way to exit an application and cleanup, what about a formless application. I don't have a me. I tried application.close. I tried: dim x as form = new form x.close but the program freaked and threw an exception. Right now I'm still using application.exit() to close on error.
-
oh, ok. I guess you can declare shared variables then... I think the module is easier. well for me its slightly annoying because I forgot like 5 xml fields, which ment I needed to add 5 more variables and 5 more lines of XMLRead code. Of course I realized it one at a time, so thats like 10 cycles through the xml, main and module :p
-
I saw this thread: ZIP using VB.NET and the reply was something about C# using J# modules. I'm doing vb.net, and actually I just have VB.Net Standard, not the whole studio. I'd like to "zip" or something else, for two reasons: 1. Compression 2. Grouping multiple files together First I don't care that its zipping. It could be RAR, ACE or even just my own lil deal not compatable with anything else. Now I'd like a vb.net solution, but short of that, can that C# using J# be done with VB.Net instead? Also is having Visual Studio required or can I pull something off with just VB Standard? I'd consider the winzip commandline like the other fella did, but I'm in a work environment and this program could be used on any of 6 dozen computers. I think you have to have the registered and paid for version of WinZip to do that, which would involve budgeting and finances and headaches, then the annoyance of having to have winZip installed on all these PCs, the majority of which have XP (already can zip). Any help?
-
I need to use sendkeys in a formless application and heres my code: Imports System.Windows.Forms Public Class Main Inherits System.Windows.Forms.Form Shared Sub Main() System.Windows.Forms.SendKeys.Send("mooo") End Sub End Class I know you have to inherit from the forms class to get this to work, but its giving me this error and asking me to use SendKeys.SendWait or change my application Sendkeys.Send is what I want. I really don't know if Sendkeys.SendWait is what I want. Is there a solution or a way to enable a formless app to "handle messages"?
-
I'm using XML as an input file for my INI type settings. I just want a sub procedure on form load to open the XML, get the settings and throw them into variables, then ditch the dataset and just keep the variables. Heres the code: Shared Sub XMLRead() 'This sub opens a dataset and loads it with information from a XML 'document. It then loads the data into variables and closes the dataset. Dim ds As DataSet = New DataSet ds.ReadXml((Application.StartupPath) & "\data.xml", XmlReadMode.Auto) sDestination = ds.Tables(0).Rows(0).Item("destinationDirectory").ToString sSource = ds.Tables(0).Rows(0).Item("sourceDirectory").ToString sProcess = ds.Tables(0).Rows(0).Item("processName").ToString MsgBox("Process: " & sProcess & vbCrLf & "Source: " & sSource & vbCrLf & "Destination: " & sDestination) End Sub [\vb] The message box is just a test that its working properly right now. I noticed that Dataset doesn't have a .Close method. Do you need to this up? I realize this is tiny, with only one table and one row and three items, but I'd assume on a larger database you'd want to close it out when you're done. I just want this code to be fully compartmentalized, get its job done and leave nothing behind. Thanks :)
-
Formless Application: Ok, you need a sub Main. I read elsewhere that your Main needs to be Shared like so: Shared Sub Main Now I want to declare my variables, which I normally do on the class level, not inside of a sub procedure, unless they're going to be used only in a single procedure. This got me errors. I have another sub for reading data (ini type settings) from a XML file and transferring everything to a variable. This sub also had to be Shared to get it to work. Also since both the Sub Main and Sub XMLRead were both shared, variables on the Class level wouldn't work with each other. I even tried making the variables public on the Class level, and it was a no go. So I made a Module and made the variables public in there, and that worked. Is all of this common to formless programming or am I missing some key elements. Its working, but I'd prefer to do things the more proper way instead of just "patchworking" it. f I'm assuming its doing this because there isn't a Form to tie the subs together. If theres a better or more proper way to do this sort of thing I'd really like to know :)
-
I don't see what would be so hard, so long as there's interest. You just have to get the ball rolling and make sure people are aware. in the Extreme VB6 boards they just got their own forum for it. I'd think that would make it really easy and stand out. Otherwise just make a post under Announcements maybe? Those that make submissions could also make suggestions for future challenges. Just make a sticky post for the uploaded projects. I miss that. I got into some on the other boards, but I've been learning .net like crazy, I don't want to reset any of my habits right now and start doing projects in vb6 again.
-
Distribution to .Net without the framework, looking for a REAL solution
Denaes replied to Denaes's topic in Deployment
Yeah at work, I install the framework when I install all of the patches on all the PCs I put together, just in the off chance they'll need to run software I created. It just looks extremely unprofessional to say, here's my program, but you have to install this 20mb program to run my 1mb program. To someone who knows about programming it wouldn't be a big deal, but these aren't very computer saavy people. Then the boss is like "what the hell do you mean we have to install this on all the computers to use the inventory software". I was just hoping for an easy fix. Heck, its only 20mb? I swear, this .Net stuff must be like quintuple compressed. VB.Net Is the longest I've ever seen a single cd take to install and the .net framework is the longest upgrade of the bunch behind IE6. -
How about a "Coding Challenge"? They have them on the extreme vb boards, heck, they just got their own forum! I liked those, but I was starting to learn vb.net at the time and my spare programming hours is in .net mode. I'd love to see a .net programming challenge. Heck, I think we have more to offer, you can see how vb.net stacks up against C# and C++.Net for the same challenges.
-
Ok, some people have the .net framework. Most people don't. I want others to use my applications. I know that many people don't want to download a large file just to run a small app, some people don't have administrator access and some people want to put their program on a disc and run it wherever they want to (within reason). This also applies to custom controls really. They're all references to .dlls. Is there a way to just put the .dll's that you need in the directory with your application without installing them on someones computer for everything to use? Like just tell vb: "These 5 dll's will be in the programs directory, or a subdirectory." If all you're using is the forms .dll, it seems to me that you could drop the other references (like xml and drawing) that you're not using.
-
I'd heard about a framework for OSX (mac) and for Linux, but not recently. I also know that linux has a build thats basically JUST the framework, which was created to be a server that is Linux AND .Net compatable. I don't think .Net can ever stand a chance as internet programming so long as the users have to have .Net and not all of them can. If it were my choice as a webmaster I'd just choose a language that everyone could use. I'm just curious, it would be nice if .Nets compatability ever showed up and it wasn't just a pipe dream.
-
Oh, so they are called tool tips... it adds to the property window of existing tools. Thats neat :) Thank you
-
I see them all over on almost every application, where you hold your mouse over a control (label, button, etc) and a lil (usually yellow, white or bauge) rectangle pops up with a few words of wisdom, or sometimes a whole slew of lines explaining the function of the control. I just didn't notice any way to do this that jumped out at me and I'm not even sure exactly what its called, so my searches yeilded no results. This isn't imperitive, but it would be neat to learn how to do if anyone knows :)
-
Maybe one should be posted with a 'sticky' in each forum, for what the forum handles. I noticed theres a 'sticky' post called "Tutorials" in the Tutors Corner, but there are only like 4 links in it and they seem fairly broad. I noticed because its hard to find an XML tutorial. Try Googling that one, you get 999,999 hits of all sorts of random stuff. It would be a good spot for people to check out in their forums subject. The database forum would have links to tutorials/articles on different kinds of databases, interacting with servers, XML, Crystal Reports, etc It would be pretty cool to have all of the info in one spot rather than floating about in posts you may or may not find on a search.
-
Where Can I find an XML Tutorial? Well, I can't change the title of this post, but I did find a link to a XML tutorial in another post: http://www.w3schools.com/xml/default.asp It looks pretty promising :)
-
How do you do windows (forms) that "Snap"together?
Denaes replied to Denaes's topic in Windows Forms
Schizznit! Thats even better than what I was looking for. I was looking for the basic WinAmp type of "docking". I thought it might have been a basic feature nowadays for .Net, but I guess not. Divils control looks friggin awesome. Its more like the docking they have in Macromedia products with windows becomming tabs and you can tear them off :) Thank you for showing me the way, with any luck I'll have that sucker in my program soon :D -
I have to look into that. A formless program is definately what I want. I'm just not sure how to set that up. Its not a type of project, right? I found Application.Exit() to exit, but ran into a problem. It just cuts off the program wherever I put it. It would get one character out of my first SendKeys string, then terminate. I added Application.DoEvents after all of the SendKeys, then after each individually and it let 4 characters get through before shutting down. I think a formless program would be better. I'm thinking that I add a module, make it a Shared Sub Main, might need to import the form class for some methods, and theres an option somewhere to choose what the startup Form is, and you can probobly select Sub Main, then just delete the form? I'll look into this later and try it out.
-
I think I'm missing something. I normally end a program with the word "End", which normally works fine. I'm making a program that I need to run a few procedures on FormLoad (actually they're in form activation, cuz they don't work in form load), then after all that, end the program by itself. I tried putting End into the FormLoad event, but that didn't work right, I tried putting it right after all the other subs that needed to be done during activation and the program went a little nutty. Would making a timer and having it 'end' the program after a few ticks work? Is "End" even the proper way to be doing this? the way I'm getting buck nutty results, I"m not so sure Thanks for any advice
-
I thought it would be called "Docking", but in the book I have, Mastering VB.Net, it says that Docking is aligning a conrol to a side of the form or something. I'm trying to do what WinAmp does, which is make a program with more than one form - One master form, then from there the user can open up multiple other forms, which when close to the main form "Snap" onto it, either the sides or top or something. I'm guessing you can do a check on any other forms move (redraw?) procedure to check if its close to the main form, and if it is, align it, make it the same width and make its X the forms X + Height. But I was wondering if there was something easier or more 'standard' that anyone knows of?
-
Might be Jury Rigged, but it works :) Ok, it works. This is how I did it: Private Declare Function BringWindowToTop Lib "user32.dll" (ByVal hwnd As System.IntPtr) As Integer Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Process name is usually the executable name without the ".exe" Dim proc() As Process = Process.GetProcessesByName("TestApp") Dim x As Integer 'Brings "TestApp" to focus BringWindowToTop(proc(x).MainWindowHandle) 'Focus started in the first textbox, so I just send the text over SendKeys.Send("Text1") 'Tab to the next textbox SendKeys.Send(vbTab) 'Send text to the next textbox SendKeys.Send("Text2") 'Tab to the button SendKeys.Send(vbTab) 'A space activates a button with focus SendKeys.Send(" ") End Sub This could be applied to any program which has keyboard functionality, which is nearly all of them. It just requires you to to do a run through once to check the tab order and set your tabs accordingly. I'm sure that there is a way to do this more 'slyly', in a more programer stylish way, but for non dynamic forms, this will get the job done :)
-
You need to have all of your declarations and procedures within your class. At the very top of your code view window, it should say "Public Class Form1" or whatever the form is called. all procedures and declarations MUST be typed between that statement and "End Class". If something happened and its not there, copy all your code and start a new project. I start my code just below the grey text "Windows Form Designer generated code"
-
It passes them to the hWnd argument, but I'm not sure how to access them. I have no clue what I'd use to get access to the first textbox, the second text box or the button... I'm still looking into it, but there isn't much about this on these forums... hmm, they're old API's so maybe hitting up the vb6 forums might be a good idea.
-
ok, I looked around and found out how to declare the functions in question, but I'm not sure exactly how I can access any of the textboxes or buttons on this application. "TestApp" is an application with two Textboxes and a Button. 'proc is a process to get the handle for the application in question. Dim proc As Process 'hHandle is the variable for the application Dim hHandle As System.IntPtr 'Declaration of Callback, a required function 'for EnumChildWindows. Public Delegate Function CallBack( _ ByVal hwnd As Integer, _ ByVal lParam As IntPtr) As Boolean Declare Function SetWindowText Lib "user32" _ Alias "SetWindowTextA" (ByVal hwnd As Long, _ ByVal lpString As String) As Long Public Declare Function EnumChildWindows Lib "user32" ( _ ByVal hwnd As Integer, _ ByVal lpEnumFunc As CallBack, _ ByVal lParam As Integer) As Integer Public Shared Function ReceiveWindowHandles(ByVal hwnd As Integer, ByVal lParam As IntPtr) As Boolean End Function Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'In the Form1_Load I have to run through the array of Processes 'because I don't know how to directly set the name to "TestApp" 'Once I get to "TestApp", I set hHandle to "TestApp"'s handle. 'I've successfully closed "TestApp" and gotten info on it, so 'I was successful getting to it. proc.GetProcesses(Environment.MachineName) For Each proc In proc.GetProcesses If proc.ProcessName = "TestApp" Then hHandle = proc.Handle End If Next End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click EnumChildWindows(hHandle.ToInt32, AddressOf Me.ReceiveWindowHandles, 0) End Sub From what I've read ReceiveWindowHandles is supposed to get the handles? How do I access them?