You can also export your C classes in such a way that VB.net can use them like you would API calls. I did this on a shell I developed so that I could get the sytem tray icons. Search google for "Use C++ DLL in VB.net". Another option is to use WndProc messages between the two applications. That's the way I would go personally. The concept you'll want to research is "inter-process communication".
LCARS x32
Posts
-
C, VB.net, MySql -
Access another program's controls?Those concepts will only work if he has access to both programs' code. If you are trying to control a program you did not create or cannot modify, you will need to use API calls such as "FindWindow"/"FindWindowEx" to locate the window and child control (also considered a "window"). You can use programs like spy++ or winspector spy to figure out the class/caption of the windows and controls. Once you have the handle (intptr) to the control, you can use other API calls to send key presses and/or mouse clicks. You'll have to google those, tho. Hope that helps! Ray
-
How to store data(images, Text, Music) in one file? like.datIf you want to do it through your own code, use a FileStream to read the files into memory and another to write them to the same file. FileStreams read the raw bytes of the files. You'll want to put some sort of delimiter between the files so you can separate them later. To add your delimiter to the file, create a string and then use System.Text.Encoding.Ascii.GetBytes(YourStringVariable). That will give you a byte array with which to write with the filestream's write method. Hope that wasn't too confusing! Ray PS: If you want to compress your files, there are lots of examples for compressing files in .NET, just search google for "compression vb.net"
-
Plugins for ApplicationIt may be, but so is creating separate exe's and talking through interprocess communication. At least this way, it's a true integrated plugin. It's also how most developers are used to creating plugins. I can't think of any other applications that use interprocess communication for plugins. I hope somebody else can give you a better solution. But I wouldn't hold my breath :)
-
Plugins for ApplicationYou could have your program ask the user if the plugin should be allowed internet access the first time the plugin is loaded. And I mean the very first time, not each session. You can verify the plugin hasn't changed by storing a hash of the plugin's file and checking it against that hash any time it loads. Force the plugin developers to use your program to update the plugin so you know when to regenerate the hash. In effect, your program becomes a mini firewall. No extra exe's and your program protects the user from malicious plugins. Unless, of course, the user allows the plugin access. But you can't win them all -Ray
-
Where to update datagrid cellsCellformatting is where you want it. You were close. Just add another line under your code to change the color:
e.FormattingApplied = True
-
TCPclient/TCPlistener connects but can't send/receive data? Please help.Hey everyone, I'm working on a project that includes product activation. We are using a TCPclient on the client application to connect to a TCPlistener on the server. 99% of the time, everything goes fine. But we have had a few clients complain that they are unable to activate. I was able to set up a debug server and have the client try activating against that. I watched the incoming connection and the issue seems to be that the client is able to connect and send data (verified by the clients log file), but the server never receives it. The stream.readbyte() function hangs until it times out. Here's some info on the configuration: There are two servers, a main and a backup. Both are up and communicating with most users. They listen on ports 80 and 63016. If the connection fails on port 80, it tries 63016. If the main server cannot be connected to, it tries the backup server with the same ports. My best guess is because it's communicating on port 80 (the http protocol's port), some firewall or security program is blocking the packets because they aren't standard http traffic. It may look like malware trying to "phone home". Which would explain why the connection goes through but the data does not. The client never tries the other port because it successfully connected (I'm in the process of changing this behavior now.) Please, if you have any ideas or things I can try, I'd be greatly appreciative. I'm at the end of my rope here.
-
Don't allow notifyIcon to be hiddenHo hum... that's what I was afraid of. lol. Thanks for the replies. Looks like I'll have to find a "creative solution". The Code Project and it's community ROCKS! :cool: -Ray Jeff Computers StudyX.com
-
Don't allow notifyIcon to be hiddenWhat I meant was, if the user has auto hiding of their notify icons turned on, the icon gets "hidden" (where you have to push the arrow to see the "hidden" icons). We need ours to always be visible. It's not that the icon is disappearing, per se; it's being hidden until the user clicks that arrow. Sorry for the confusion :) -Ray Jeff Computers StudyX.com
-
Don't allow notifyIcon to be hiddenIs there some way to stop Windows from hiding a notifyIcon? I'm not afraid of API calls if they're necessary. We're developing a program that will minimize to the tray and it's important that it's icon is always visible (it updates the user by changing the icon as events occur). I'm sure there's a way, since the Windows icons do it. Thanks, Ray Phillips Jeff Computers StudyX.com
-
Change startup dirIf I understand you correctly, the following should work:
System.IO.Directory.SetCurrentDirectory("c:\myfolderpath")
Hope that helps. -Ray
-
Visual BasicComputafreak wrote:
(unless you like the elegant, flowing symbols of C#)
I think you mean "unless you like trying to figure out where the heck you're missing that curly bracket". :) Visual Basic an excellent programming language that is popular with beginners and experts alike because it's easy to understand, and has a very English-like syntax. All while still having the power of the .NET framework at its disposal. Visual Basic is also very good for rapid application development thanks to the very well thought out Visual Studio IDE. -Ray Phillips
-
Hiding the Script Combobox in FONT DialogI don't know if this is what you are looking for or not. This doesn't make the combobox disappear completely, but it gets rid of all of the choices except for the default.
Dim myFont As New FontDialog myFont.AllowScriptChange = True myFont.ShowDialog()
Hope that helps. -Ray
-
Problem with restarting threadYou could also create a new instance of the thread just before starting it. Hope that helps, -Ray
-
Declaring a arrayI agree with David Anton. Example:
'Declare the array:
Dim myIntArray(2) as IntegermyIntArray(0) = 9
myIntArray(1) = 8
myIntArray(2) = myIntArray(0) - myIntArray(1) 'The value becomes 1 (9 - 8)
That's how it's used. -Ray
-
"Add to Windows Media Player list" from vb.netLooking though the file options for WMA files, I found that when you click on a WMA file, Windows uses the following command: "C:\Program Files\Windows Media Player\wmplayer.exe" /prefetch:5 /Play "%L" %L is the path to the file/files (I assume). You will have to experiment. Usually %1 indicates the path. Hope that helps, Ray
-
Problem when Resoluction ChangeI had a similar problem. Set the "AutoScaleMode" property of the form to "Off". When you change the DPI, it's auto-scaling your controls and causing them to display incorrectly. Hope that helps, -Ray
-
Newbie looking for directionWow. Those were really useful posts... Way to help out. BTW: VB.NET can do ANYTHING that C# can do. Anything. :mad: The easiest way to do what you want is with a collection. I would also get rid of the timer and just use Now.timeOfDay to get the current time. Heres an example: The example below needs the following controls on it's form:
Control Name
TextBox txtID
Button btnAdd
Button btnSave
ListBox lstResults'Begin Code:
'============================================================================================================
Option Explicit On
Option Strict OnPublic Class Form1
'Create a new structure to make saving our data easy. Private Structure Competitor Dim ID As String Dim FinishTime As DateTime End Structure 'Create a collection to hold all of the competitors. 'I like using collections instead of arrays because 'they're easy to resize Dim myCompetitors As New Collection Private Sub btnAdd\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click 'Create a competitor variable to temporarily hold the 'competitor we are adding. Dim currentCompetitor As New Competitor 'Set their ID to the the text of the textbox currentCompetitor.ID = txtID.Text 'Set the finish time to the current date/time currentCompetitor.FinishTime = Now 'Add the competitor to the collection myCompetitors.Add(currentCompetitor) 'Update the list of competitors/times UpdateResults() 'Reset the textbox and give it focus 'so we don't have to click on anything 'to enter the next competitor. txtID.Text = "" txtID.Focus() End Sub Private Sub UpdateResults() 'This sub updates the listbox with all of 'the competitors in the collection. 'Clear the contents of the listbox lstResults.Items.Clear() 'Loop through the collection, adding the competitors information 'to the listbox. For Each currentCompetitor As Competitor In myCompetitors 'add the competitor's ID followed by the date and time of their finish. 'if you want to show just their time, you would 'change currentCompetitor.FinishTime.ToString to cur
-
Changing the middle/wheel click to click-n-dragHello Farzad, I know this was posted a while back, but I want to help. As it turns out, I was working on a similar program not to long ago and was able to modify it for your use. It's kind of hodge-podged together. It uses a Mouse-hooking class written in C# I came across somewhere on the net and modified for my use. The main form is written in Visual Basic .NET. You can download the code from: HERE Hope that's what you needed, Ray
-
to draw the line between the cells of msflexgridI don't know much about the MSFlexGrid control itself, but you can draw lines on any control using ControlName.CreateGraphics.DrawLine(pens.color, x1, y1, x2, y2). Hope that helps. -Ray