|
Well I've discovered some issues; perhaps these might help someone explain to me my problem.
1. Depends.exe shows that the .dll I've created cannot find MSJAVA.DLL Well I can't find that file anywhere on my computer. Why would my compiled vb.net 2005 active-x .dll need that file?
2. When I try to register the .dll using regsvr32, I get:
"Classlibrary3 was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found."
I rebooted to clear memory and still got the same error. Why can't my .dll be registered?
thanks!
|
|
|
|
|
Probably because you're using REGSVR32 when you should be using REGASM[^].
Keep in mind that VB.NET and C# cannot build an actual ActiveX control in the classical sense. They can generate something that behaves like one, but it is only a COM wrapper around a managed-code assembly that makes it look like that to the consumer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi guys:
I create a form with a bunch of combo boxes, and i named them with: cbo0,cbo1,cbo2.....
I would like to create a function to test if any of them is empty. So i did it this way:
Dim combos(6) As Object
Dim cnt As Integer
Form_Load() Handles MyBase.Load
For cnt = 0 To 6
combos(cnt) = "strLand" & cnt.ToString
Next
End Sub
Private Function checkCbos() As Boolean
Dim cbos As ComboBox
For cnt = 0 To 6
cbos = CType(combos(cnt), ComboBox)
If cbos.Text = "" Then
errorPro.SetError(cbos, "Do not leave the factor box empty!")
End If
Next
End Function
and after all this, i countered a casting error, could anyone helps me to debug this, or have a better idea to validate those combo boxes?thanks very much.
Cheers
Kevin
|
|
|
|
|
Try something like this. You might have to modifiy the code a little I don't have VS open so I don't think it will compile, but it will give you the right way to go about doing this.
<br />
for each item as control in form.controls<br />
if item.GetType is GetType(ComboBox) then<br />
if item.Text = "" then<br />
errorPro.SetError(cbos, "Do not leave the factor box empty!")<br />
end if<br />
end if<br />
next<br />
Mike Lasseter
|
|
|
|
|
Something like this:
Private Function checkCbos() As Boolean<br />
Dim myControl As Control<br />
<br />
For Each myControl In Me.Controls<br />
If TypeOf myControl Is ComboBox Then<br />
If myControl.Text = "" Then<br />
'Set error provider<br />
errorPro.SetError(myControl, "Do not leave the factor box empty!")<br />
'Return False and exit to calling procedure <br />
Return False<br />
Else<br />
'Clear the error provider<br />
errorPro.SetError(myControl, "") <br />
End If<br />
End If<br />
Next myControl<br />
<br />
'If code gets to here, no combo's text is ""<br />
Return True<br />
<br />
End Function
Steve
|
|
|
|
|
Thanks Mike and Steve,i got the point, that is very helpful.
|
|
|
|
|
Hi Steve, ur code only checks a single combox and returns false if the control text is empty. I add a integer to count, and make sure all the boxes are checked. Add 1 if it is not empty.
Private Function checkCbos() As Boolean
Dim myControl As Control
Dim count As Integer = 0
For Each myControl In Me.Controls
If TypeOf myControl Is ComboBox Then
If myControl.Text = "" Then
'Set error provider
errorPro.SetError(myControl, "Do not leave box empty!")
'Return False and exit to calling procedure
Else
'Clear the error provider
errorPro.SetError(myControl, "")
count += 1
End If
End If
Next myControl
'If code gets to here, no combo's text is ""
If count = 6 Then
Return True
Else
Return False
End If
End Function
|
|
|
|
|
Well, it will check all combo boxes but only return an error for one at a time.
Presumably you call checkCbos() in your Save button 'click' procedure?
The function will set an error provider on the first combo box that contains "" and then exit the function. If you select an item and then click your Save button again, you will be notified of any further combos containing "".
This way, if you added another combo box at any time, the code will still work.
The way you have done it is fine but would fail if you added another combo at any time. If it works for you though, that's great!
Steve
|
|
|
|
|
I am working on project... Like a shell and my question is.
Is it possible to turn off windows keys like (WinKey+D), (Winkey+S),etc.
And other that can stop application. Its a program like a desktop and u can only use icons on it not other programs and other. Its for an gaming place. Please help me.
I need anny help and suggestions.
Thanks
|
|
|
|
|
Maybe this CP article and its references can help (link[^])?
Best,
Jun
|
|
|
|
|
Thanks Jun... that will help me i allredy did my own taskmanager and a firewall that terminate all windows forms that are not mine in secconds...
|
|
|
|
|
Hii Friends,
Can we change the color of a particular row in the datagrid according to the conditions we code.
For e.g. if suppose in the datagrid, values which is retrieved from one database table is matching the values of another table the color of the particular row should change to blue or red or any color.
Is it possible.
Waiting for reply..
Bye..
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
This good posting by Frank Kerrigan will probably point you in the right direction. http://www.codeproject.com/aspnet/PrettyDatagrids.asp.
Good luck,
Tim Robertson
Dallas, Georgia
|
|
|
|
|
I want to read data directly into my visual basic application, how can i do it and what resources are required.
I am a student
|
|
|
|
|
First, you need a barcode scanner. How you write your code depends entirely on how that scanner works, so dig out the documentation on the scanner.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Help please.. Can anyone there resolve this?
-Sample Code-
System.Net
...
'let's assume there are other codes here
dim Addr as IPAddress
With DNS.GetHostByName(<compname>)
Addr = System.Net.IPAddress(.AddressList(0).Address)
End With
...
That should have been the way to get the IP Addresses, but in VBNET 2003
the line: "(.AddressList(0).Address)" is obsolete.. Anyone knows the new way?? Be grateful for the help..
Thanks in advance..
|
|
|
|
|
Since you got that "obsolete" message, you're using VB.NET 2005. Check out the Dns class and its GetHostAddesses[^] method.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hmm.. but i'm using Visual Studio 2003.. anyways do u know another way? Hope u can help me.. i'm still lookin for another way though.. Thanks
|
|
|
|
|
There's only two methods. The one you posted in your code, which gave you the obsolete message, and the one in the .NET Framework 2.0. The .NET Framework 1.0 and 1.1 both use the same Dns class. It was nearly completely re-written for .NET 2.0.
This[^] is the docs for the 1.0/1.1 version of the Dns class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
" 'Public Property Address() AS Long' is obsolete: 'IPAddress.Address is address family dependant, use equals method for comparison.' "
That's the whole statement of the error. My framework is 1.1, and it cant be 2.0 coz im not using VS2005.. but can i use Framework 2.0 with VS2003?
i haven't found another way..and how can i set the client to look for any server running in any of the pc in a network. Like if i run a Server or the listener on PC4, the client is on PC1, without specifying the IPAddress where the Server file is running.. if i transfer the server to PC8, the client can still detect it. Something like that.
I'm actually new on using System.Net and im just lookin on examples available in the web.
I have tried the basics of Server-Client, the problem is the one i stated above. and the client issue.. thanks
|
|
|
|
|
OK. So you're using 2003. No, you can't use .NET 2.0 with VS.NET 2003. It will only work with VS.NET 2005.
Remove the .Address part of the line. You don't need it unless you want the IP address returned as a 32-bit number. This isn't supported in .NET 2.0, so don't use it.
This code works just fine:
Dim hostInfo As IPHostEntry = Dns.GetHostByName("www.yahoo.com")
Dim address As IPAddress() = hostInfo.AddressList
Dim al As String() = hostInfo.Aliases
Debug.WriteLine("Host name : " + hostInfo.HostName)
Debug.WriteLine(ControlChars.Cr + "Aliases : ")
Dim index As Integer
For index = 0 To al.Length - 1
Debug.WriteLine(al(index))
Next index
Debug.WriteLine(ControlChars.Cr + "IP address list : ")
For index = 0 To address.Length - 1
Debug.WriteLine(address(index))
Next index
and was taken directly out of the docs for Dns.GetHostByName in the .NET 1.0/1.1 docs.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hello,
I create an application VB.net 2003 with sql server 2000 and I created the exe file but it didn't work in another computer who's not contain the VB.net 2003 what I suppose install the minimum thing to the execute file work properly
thanks for you help
dadax
|
|
|
|
|
You said the other PC does not have VB.NET 2003? It might not have the .NET Framework.. so you'll have to install "dotnetfx.exe". It can be downloaded at microsoft website.. search for it..
www.microsoft.com
And if you have a database with SQL server.. you will have to setup a SQL server on that PC.. a client i suppose..
goodluck
|
|
|
|
|
<br />
Private Sub _SplitterMoved(ByVal sAs Object, _<br />
ByVal e As System.Windows.Forms.SplitterEventArgs) _<br />
Handles SplitContainer1.SplitterMoved<br />
<br />
For i As Integer = 0 To Me.TabControl1.TabPages.Count - 1<br />
Me.TabControl1.TabPages(i).Refresh()<br />
Next<br />
<br />
End Sub<br />
Is there a better way to fix the tabpages not filling the tabcontrol's area when you move the splitter?
|
|
|
|
|
Hi,Bhagyesh Here,
I was stucked to get Alternate Color shades in my Datagrid,can anyone suggest a precious help for this?
Bhagyesh
Bhagyesh S.Kale
|
|
|
|