|
Thanx Steve.... I have already done this as you said by setting the global variable........
But I was thinking may be this can happen....
Anyways......Thanx
_mubashir
|
|
|
|
|
can anyone help me to implement a genetic algorithm to solve the TSP for tours of length 20, 50 and 100 using one of chromosome recombination and mutation operators in VB.need help....
|
|
|
|
|
|
|
I am working on a custom GroupBox control (called GroupCheckBox) that has a checkbox for enabling and disbling the child controls it contains. The way I have my GroupCheckBox control setup is by using a combination of controls. It inherits from the GroupBox control, and a CheckBox control exists within it. I am trying to create two properties on the GroupCheckBox control to handle Checked and CheckState properties similar to the CheckBox control. These properties look like so in VB code:
<br />
Public Class GroupCheckBox<br />
Inherits System.Windows.Forms.GroupBox<br />
<br />
Friend WithEvents checkBox As System.Windows.Forms.CheckBox<br />
'omitted irrelevant code...<br />
<Category("Appearance")> _<br />
Public Property Checked() As Boolean<br />
Get<br />
Return Me.checkBox.Checked<br />
End Get<br />
Set(ByVal Value As Boolean)<br />
EnableGroup(Value)<br />
Me.checkBox.Checked = Value <br />
End Set<br />
End Property<br />
<br />
<Browsable(True), EditorBrowsable(EditorBrowsableState.Always), Category("Appearance")> _<br />
Public Property CheckState() As CheckState<br />
Get<br />
Return Me.checkBox.CheckState<br />
End Get<br />
Set(ByVal Value As CheckState)<br />
Me.checkBox.CheckState = Value <br />
End Set<br />
End Property<br />
<br />
End Class<br />
Unfortunately, whenever I change one of the properties, like let's say I change Checked to false, the CheckState property is not in synch with it and doesn't change in the design view. This doesn't happen when you use a CheckBox control, the two properties are in synch and match their values accordingly. I think the problem lies within the form designer not being updated in my code. Is there some way to tell the form designer to update the other property when it's corresponding value is changed? I'm guessing this can be done by using something within either the System.ComponentModel or System.ComponentModel.Design namespaces. BTW, I am using VB.NET on Visual Studio .NET 2003.
|
|
|
|
|
does anybody have the vaguest idea why this gives a runtime system error?
<br />
imports System<br />
Imports Microsoft.Win32<br />
Imports System.Data<br />
Imports System.Data.SqlTypes<br />
imports System.Data.Odbc<br />
<br />
dim DBConnection as new OdbcConnection("DSN=XYZ")<br />
DBConnection.Open()<br />
and yes there is a system dsn called XYZ that works from the odbc control panel thingy
thnx
:/
"there is no spoon" biz stuff about me
|
|
|
|
|
Try wrapping the code in a Try..Catch block and inspect the exception message directly. It may be that your DSN connection is attempting to use a trusted connection when one does not exist so you may need to provide more parameters in the connection string.
Try
Dim DBConnection As New OdbcConnection("DSN=XYZ")
DBConnection.Open()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
...Steve
-- modified at 20:36 Thursday 22nd September, 2005
|
|
|
|
|
does anybody know how to enumerate the available odbc connections from a vb.net app? i cant find any docs on it in msdn
thnx
"there is no spoon" biz stuff about me
|
|
|
|
|
I don't know how to do this in managed code. The only way I know how to do it is to use the old ODBC API. The function SQLDataSources() should do the trick.
MSDN information[^]
I found an example how to use it in VB.Net.
http://www.vbcity.com/forums/faq.asp?fid=8&cat=General#TID1391[^]
I hope this helps.
-- modified at 16:50 Thursday 22nd September, 2005
<edit>
Actually, that code example that I linked above looks more like VB6. Sorry about that, but I'm sure it'll give you the idea.
|
|
|
|
|
thnx a lot joshua ... i think the example was in vb6 and i dont know enough of .net to convert all the external ref calls yet so i went with reading the registry directly *clunk clunk*
<br />
dim rk as RegistryKey = registry.LocalMachine.OpenSubKey("Software")<br />
rk = rk.OpenSubKey("ODBC")<br />
rk = rk.OpenSubKey("ODBC.INI")<br />
rk = rk.OpenSubKey("ODBC Data Sources")<br />
dim names as String() = rk.GetValueNames()<br />
*sigh* vb is _so_ elegant no?
"there is no spoon" biz stuff about me
|
|
|
|
|
I don't know if there is a better way to do this in VB.NET.
There are registry keys that contain ODBC info of various and sundry sorts, in Win 2K:
HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources
and identical keys unders the various HKEY_USERS nodes
Also
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
In VB6 you could use a COM dll named "ODBCTool.dll" to enumerate all ODBC drivers installed, enumerate all DSN connections configured, and create a new DSN connection.
Not sure if MS provides the inter-ops for this DLL for NET.
|
|
|
|
|
|
I just imported ODBCTool into NET no problem. It is very simple to use, especially if you might need to create a DSN - you don't have to write all that code to add reg entries.
If I understand MS policy correctly, you can import a typelib that has no vendor PIA as long as you don't make any of it's methods publicly available from your application. Internal use is allowed.
And if I don't understand MS policy correctly, well, I'm not a dumbass - they should make it understandable to a reasonably non-dumbass person - so f*** 'em.
|
|
|
|
|
A VB script done in excel as a macro was handed off to me to see if i can save the contents of the UI (labels & texts) into a pdf file without having to store them in a database or storage system. First off, I've never used VB and absolutely not familiar with the syntax. Lastly, I've never done anything like this without having to store data in some way (database or flat).
Can anyone help me? Thanks.
Sincerely,
Jason C. Ranin
Software Quality Assurance
|
|
|
|
|
First of all, you can interface VB (and C#) with Excel, and you can find plenty of examples on how to do this. So I will not attempt to address that, since if you don't know VB you are going to be spending lots of time with that part to begin with.
Now, for the PDF part. I have many, many words in my vocabulary to describe working with the PDF format. And when I am actually in the process of working with PDF, I use them all, constantly, strung together in novel creative ways. For the sake of the forum let me just summarize as "major hassle".
There is an open source library that is invaluable when working with PDF's although depsite the fact that I consider it essential, working with this library can also be described as "major hassle".
Although the library, and most of the documentation is for C#, you can use it in VB.NET as well. (Despite some arrogant misconceptions otherwise, C# and VB.NET are really the same thing).
You'll find a lot more examples of interfacing to Excel in VB. You'll find working with the PDF library just damn difficult no matter which way you go. Assuming you do not know either VB.NET or C#, the choice is really up to you.
Let me say in no uncertain terms, this project was handed off to you for GOOD reason. It could take you months to figure it all out.
I strongly, strongly, strongly advise you to punt if it is at all possible. Really. Punt! Punt! Punt! If you can't punt, find a shady doctor that writes shady 'scripts and tell him you need speed and valium. Both in large quantities.
You can find the PDF lib here:
http://itextsharp.sourceforge.net/[^]
I feel for you.
|
|
|
|
|
hello friends,
i have a ? for you. how we record our sound in vb6.0.
help me out.
|
|
|
|
|
You'd find a couple dozen examples of this, using a few different methods, by typing "vb6 record sound" into Google. Or, just click this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone kno how to open a pdf file once a link button has been clicked.
Thank You
|
|
|
|
|
Shell launch it using the Process[^]and ProcessStartInfo[^] classes. Just make sure you use the full path to the .PDF file your trying to open.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I make sure that ALL forms in an application close when the user exits the program?
My application consists of multiple forms and I use form.hide() which (I think) is leaving any previously viewed form in memory.
On the Exit command I use Application.Exit() but I don’t think that all forms are being cleared from memory and the computer still thinks that my application is running.
Thanks
Brad
|
|
|
|
|
Brad Fackrell wrote:
On the Exit command I use Application.Exit()but I don’t think that all forms are being cleared from memory and the computer still thinks that my application is running.
Not true. All the managed objects you create are destroyed when the startup form is destroyed. The problem comes in when you don't release unmanaged resources, like file handles, GDI handles, various COM objects, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everybody
I' got a problem. I need to get excel comment notes from a cell. I found some examples on the net talking about use somenthing like this: 1) "....Range(a_range).Comment.Text" -> this method also generates an error if the range doesn't have any comment note but if it do then it works; 2) "....Range(a_range).NoteText". They both works good under VBA but under VB are not working properly. Any idea of what's wrong with that?
Thanks!
TK
|
|
|
|
|
Hi
I have developed a windows service in VB.NET. The service is checking a folder for any files that have been created and then needs to launch an application (GUI). The service is working, but I need help on launching the application. When I step in debug in the service, the program steps through the code, but the application I'm try to launch doesn't load. When I use this same code in a normal application, it is working. Can anybody please help me? Is it possible to do this?
Thanks,
Chris
|
|
|
|
|
This question always come up when someone tries to write a Windows Service but has no idea how they really work.
Services run at Windows startup, not at user login. But, like any other application, they, too, must login to Windows, just like any other user, so they can get a security token and have permissions to various system resources. Windows Services, by default, run under a Local System account, but can be changed to run under any user account specifically setup for that service. For instance, by default, IIS runs a site under the ASPNET account that created for it.
Also, services have their own desktop, not the visible one you see as a user. There is no way to "flip" between the visible and invisible desktops either, so don't get any ideas.
In order for the service to be able to interact with the user's visible desktop you have to go into the Windows Services Manager and change the properties of your service to allow interaction with the logged-in user desktop. This is only possible if the service is running under the Local System account though.
Right-click "My Computer", then click "Manage". In the left pane of the window that comes up double-click "Services and Applications", then click on "Services". In the right-side pane, find your service and double-click it. Click on the "LogOn" tab of the Properties dialog that comes up. Make sure that "Local System account" is selected, then make sure the "Allow service to interact with desktop" checkbox is checked. Click OK. That's it!
Your service should now be able to create a new process and have it show up on the desktop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you so much! I tried it this morning and it's working.
Thanks again.
|
|
|
|