|
Not unless you loaded it into a separate AppDomain than your main executable.
|
|
|
|
|
Hello
Yes, I understand I have to load a separate appdomain. But I have not been able to write any code that actually works. Would anyone have code that successfully loads and unloads an app that they would share?
ty
|
|
|
|
|
Anyone ever successfully loaded an app from an appdomain? Could really use your help if you have. Thanks
|
|
|
|
|
Why do would two displays of the same form, on different machines, but both with the same monitor display settings, look different? You can see them at:
www.cstrader.com/displays.png
Thank you
|
|
|
|
|
cstrader232 wrote: but both with the same monitor display settings
Because other display settings are different. The user of one has chosen a different colour scheme, larger fonts and larger title bar.
|
|
|
|
|
Yes, but that's not the issue. Changing these details doesn't matter. Particuarly I'm wondering about the arrangements of the controls in the left groupbox. Why the heck are they spread out properly in one but not in the other. Anyone ever had this issue?
Thanks
|
|
|
|
|
cstrader232 wrote: Particuarly I'm wondering about the arrangements of the controls in the left groupbox. Why the heck are they spread out properly in one but not in the other.
The controls in both screenshots ARE arranged the same way as far as I can see. However, in one screenshot they are spread out (which not the same concept as arrangement).
The reason they are spread out, as I've already said, is that the font sizes on each computer is set differently. The larger the font size the more spread out things will be.
If I'm missing something then please detail exactly which portion of each screenshot I should be looking at.
cstrader232 wrote: Anyone ever had this issue?
It isn't an issue, it is a user preference setting that your application is adjusting for.
|
|
|
|
|
Not to mention, one appears to be using the classic theme and the other using the update XP theme. That'll make a difference in control appearance.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Wait, this doesn't seem right. I tried changing the font size -- display properties, appearance, fontsize, large fonts (rather than normal), and it made no difference in the size of my controls.
|
|
|
|
|
Goto display settings - appearance - advanced. Changing settings there are global are they not?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Maybe, but I can't determine which of the advanced settings controls the size of a button.
|
|
|
|
|
Just a guess, but did is the DPI setting the same on both machines? (Display Properties -> Settings -> Advanced -> General tab)
|
|
|
|
|
Nice guess Dave!! That was spot on....problem solved (whew!)
Care to reply to my topic "unloading assembly?"
|
|
|
|
|
..although how to solve the problem is not obvious. Anyone else figure out how to repond when the user changes the DPI setting?
|
|
|
|
|
Setting the form property autoscalemode to inherit seems to have helped this problem.
|
|
|
|
|
Hi..I'm working with VB6 & I need to know how to create a login window with including unique username & password.here is a code which is in a OK button in VB6 form.
Private Sub cmdOK_Click()
'check for correct password
If txtPassword = "123" Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
Me.Hide
frmMain.Show
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
There was only unique password in here & it can use any username. But i think if the username also unique,it'll be great.
And I also need to know how to create a seperate window to change those login details(username,password),with including 'current username','current password','new username','new password','confirm password' details.
Thanks a lot..
|
|
|
|
|
Hi......
To do so, you need to store your unique username and password to a file and each time user logs in, your code should check that file for correct username and password.
The code you are using will not change your username and password permanently.
So there is a better way to store username and password in a file or Database.
Gagan
|
|
|
|
|
Hi..
hmm..You are correct,But if I need to change my username or password later,how can I do it.I need to create a seperate window to do it.I think I have to connect that window also for those database or file..Am I correct??
If you can please send me some codes for create it as your idea..
Thanks a lot..
Thanking you !!!
~ Sathish Chandimal ~
|
|
|
|
|
Hi.....
yes....you can use a saperate window or you can use input box to change your username and password.But it should be connected to your file or database at that time.
Do you know how to connect database with program? If yes then you can easily change your username and password fields.
Gagan
|
|
|
|
|
Dear..
Now I hope to do my project using VB.NET & I earlier start it by VB6.I know how to connect ACCESS DB in VB6,but I don't know how to connect ACCESS Db in .NET & I know little bit about connecting SQL in .NET.So if you can kindly tell me how can I connect ACCESS or any other DB in .NET correctly.If you can also tell me where can I have more information about those codes,do you know any other reference items???
Thanks a lot Dear...
Thanking you !!!
~ Sathish Chandimal ~
|
|
|
|
|
|
Hi, I am working on a VB project which needs to locate certain devices which, apart from the response they provide to a broadcast, can not be identified at runtime as the application is to be used by an end user with no knowledge of network comms.
These devices, on receiving a broadcast message on port 20034, automatically send a UDP datagram back to the source IP, also on port 20034, Prior to TCP comms being initiated.
This datagram contains the MAC address, IP address, and other info such as subnet mask, gateway etc..
At runtime, there will be an unknown number of devices on the network, between 0 and 32 devices
The relevant code is all listed below, and functions as expected, However the problem I am having is that due to the blocking nature of .NET UDP, unless I have 32 devices on the network, the program will hang whilst waiting for a datagram.
To this end, I want to make this section run in a seperate thread, terminated after a preset time interval using a timer on the main thread
I will be adding each datagram to the index of a rectangular array, which must be passed from the background thread to the main thread.
The problem I am having is in passing this array back, if the thread (which will be an infinite loop) is terminated by a timer.
This is also my first attempt at multithreading, and, although I have done a large amount of reading now, I must confess I am still struggling.
Thanks in adavnce for any help received,
Regards, Chris
Declarations/imports:
Imports System.Net.Sockets
Imports System.Text
Imports System.IO
Imports System.Net
Dim receiveBytes As [Byte]()
Dim LenBytes As Long = 0
Dim ReceiveArray As [Byte] (,)
Main:
Private Function Go() As Array
Broadcast()
For n = 1 To 32
Listen()
If LenBytes > 160 Then
For m = 1 To LenBytes
ReceiveArray(n - 1, m - 1) = receiveBytes(m - 1)
Next m
End If
Next n
Return ReceiveArray
End Function
Send Broacast message:
Private Sub Broadcast()
Dim broadcaster As New UDPClient(CType(MainForm.Text_UDP_Port.Text,Integer))
Dim bytes(1024) As Byte
bytes = System.Text.Encoding.ASCII.GetBytes("BURNR")
broadcaster.send(bytes, bytes.Length, "255.255.255.255, CType(MainForm.Text_UDP_Port.Text, Integer))
broadcaster.Close
End Sub
Listen for a response:
Dim RemoteIPEndPoint As New System.Net.IPEndPoint(System.Net.IPAddress.Any, 20034)
Dim Listener As New UdpClient(20034)
receiveBytes = Listener.Receive(RemoteIPEndPoint)
LenBytes = UBound(receiveBytes) - LBound(receiveBytes) - 1
Listener.Close()
End Sub
|
|
|
|
|
First of all, I'll just make a disclaimer that I'm a C# programmer, so my code and references will be in C#; but, of course, you can do the same in VB.NET I am just not 100% on the syntax.
You should use the UdpClient.BeginReceive method, as it is asynchronous and will not prevent the program execution from proceeding. The idea is that you'll invoke UpdClient.BeginReceive() and then your program will keep going from the next line. On a separate thread BeginReceive will be waiting for incoming data. In the BeginReceive handler or callback (when data arrives) you'll process it and then call BeginReceive again to wait for another device. You can have the handler keep invoking BeginReceive until you've accepted 32 devices or whatever condition will indicate that you don't want to accept any more incoming UDP data. Also, since it sounds like you'll be using an array that will be accessed by 2 separate threads, you should use locking to have safe access to the array. In C#, locking can be accomplished with the lock keyword, not sure what the equivalent is in VB.NET. However, the idea is that you create a new object (I usually name it 'locker') whose only purpose is to control the locking and access to the cross thread item. Then, when accessing the array from inside the BeginReceive handler you'll lock the locker object and access the array, this will ensure that only that portion of code accesses the array. You'll do the same in the main thread to access the array. Here's a quick sample of some C# code I use; there are some private members and 2 public methods from a class that should give you the idea of how to use the BeginReceive method and locking on an object:
private UdpClient listeningClient = null;
private IPEndPoint localEndPoint = null;
private bool acceptingConnections = false;
private object locker = new object();
public void Start()
{
lock (locker)
{
acceptingConnections = true;
listeningClient = new UdpClient(localEndPoint);
listeningClient.BeginReceive(new AsyncCallback(ReceiveCallback), listeningClient);
}
}
private void ReceiveCallback(IAsyncResult ar)
{
UdpClient client = (UdpClient)ar.AsyncState;
IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, 0);
byte[] receivedBytes = client.EndReceive(ar, ref endPoint);
if(acceptingConnections)
listeningClient.BeginReceive(new AsyncCallback(ReceiveCallback), listeningClient);
}
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Thanks for the help
I ended up going pretty much along the lines you suggested, only I kept the blocking receive method.
I have the whole process in a different thread, and after each receive, it checks a flag to see if it should loop or end the thread.
From the main thread, to stop the process, i simply set the flag and then send a udp message from the main thread which is filtered out in the receive thread
Thanks again for getting me on the right lines, Chris
|
|
|
|
|
how make vb directory treeview checkbox with vb 6....?thank...
24
|
|
|
|
|