|
dim ds as dataset = TextToDataSet.Convert("c:\test.txt", "MyNewTable", "\t")
|
|
|
|
|
I would like to know if anyone knows a good source for windows installer conditions. I want to know how to set the condition so that when someone is installing the setup app knows whether the database is already installed and therefore does not copy over the exsisting data
|
|
|
|
|
|
what i need is a website that better explains and examples the syntax for the condition property. Everytime someone on here tells me that its not possible or i need to use this special thing or that i always find a way to do it and prove them wrong. thank you for the info on the custom installer though.
|
|
|
|
|
I am sorry that my answer did not help you totally. What I have noticed in building my latest application is that there are not a lot of resources for the Visual Studio - Windows Installer project. I do not think that many people use it for our of the ordinary installations. My guess is that most people use an InstallShield or Wise.
One site that I go to for installation information (other than Google) is http://www.installsite.org/.
|
|
|
|
|
Hey everyone,
I just figured out how to add custom toolbox controls and I was wondering if anyone had any favorites they'd like to share?
I've tried out XtraNavBar http://www.devexpress.com and also a couple free ones that came with VB 2005 express. I'd like to find some more, now that I know how to use them.
I'd like to create really nice UI's, but I'd also like to find some tools that are network oriented, if anyone knows of anything.
Thanks!
Jim
|
|
|
|
|
Hello,
VS 2005
I have the following code below and I would like to remove an object from the list.
For Each timerToStop As Windows.Forms.Timer In emailTimerArray<br />
If (timerToStop.Tag = callID) Then 'Stop this timer<br />
timerToStop.Stop()<br />
timerToStop.Enabled = False<br />
emailTimerArray.Remove(timerToStop) 'Error<br />
End If<br />
Next
The error message i am getting is: "Collection was modified; enumeration operation may not execute"
<br />
Dim emailTimerArray As New List(Of Windows.Forms.Timer)
The way I am filling
emailTimer = New System.Windows.Forms.Timer<br />
emailTimer.Interval = 25000<br />
emailTimer.Enabled = True<br />
emailTimer.Tag = e.CallID<br />
emailTimerArray.Add(emailTimer)
Many thanks for any help,
Steve
|
|
|
|
|
If you're using For/Each to enumerate a collection, you can NOT modify the collection by adding/removing items.
Creating an array of Timers is not a good idea. I already told you to create a schedule and have one timer where its event checks the current time against the items in the schedule. There IS a limit to the number of timers that can be running system-wide, AND a limit to the number of timers a single process can have created, running or not.
|
|
|
|
|
I'm calling an unmanaged native WLAN API method, WlanEnumInterfaces, that returns a pointer to a structure (WLAN_INTERFACE_INFO_LIST). There are three components to the structure. The third component is an array (WLAN_INTERFACE_INFO) of variable size. The first component in the structure is the number of items in the array.
I'm having trouble marshalling the data. I am using Marshal.PtrToStructure. I get the following exception:
"Cannot marshal field 'InterfaceList' of type "WLAN_INTERFACE_INFO_LIST": Invalid managed/unmanaged type combination (Arrays fields must be paired with ByValArray or SafeArray)."
Since the array size is variable, I marshal using UnmanagedType.LPArray and SizeParamIndex.
Below is my code. The call to WlanEnumInterfaces() is successful and I can view the contents of the structure in memory. The exception occurs at Marshal.PtrToStructure.
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure WLAN_INTERFACE_INFO
<MarshalAs(UnmanagedType.Struct)> Public InterfaceGuid As GUID
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public strInterfaceDescription() As String
<MarshalAs(UnmanagedType.I4)> Public isState As WLAN_INTERFACE_STATE
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure WLAN_INTERFACE_INFO_LIST
<MarshalAs(UnmanagedType.U4)> Public NumberOfItems As UInteger
<MarshalAs(UnmanagedType.U4)> Public Index As UInteger
<MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=0)> Public InterfaceList() As WLAN_INTERFACE_INFO
End Structure
Dim pTemp As IntPtr
Dim WlanInterfaceList As WLAN_INTERFACE_INFO_LIST
ui32Status = WlanEnumInterfaces(WlanHandle,IntPtr.Zero, pTemp)
WlanInterfaceList = Marshal.PtrToStructure(pTemp, GetType(WLAN_INTERFACE_INFO_LIST))
Any help is appreciated.
VF
|
|
|
|
|
VFaul wrote: <marshalas(unmanagedtype.lparray, sizeparamindex:="0)"> Public InterfaceList() As WLAN_INTERFACE_INFO
Loose the SizeParamIndex field, it's only used in COM. Replace it with SizeCont:=10 . Before you call the function that is returning data in this structure, create 10 entries in your InterfaceList array so the memory is reserved for the funtion to pass data back in. You cannot pass variable length arrays because the Marshaler has no way of determining how many elements are comming back to managed code or how to read the format of the memory block. The Marshaler can copy back a single structure with PtrToStructure. It cannot handle variable length structures!
You can find some more tidbits from this[^].
It IS possible to do though! You have to supply the code to walk the memory block and pick out the values yourself. I do NOT recommend doing this because you'll be lucky to get any help making it work. It's a technique that is very very rarely ever used. There's just about no support base for it. But, for the curious -> Here it is[^].
|
|
|
|
|
I added a NotifyIcon to my project and a ContextMenuStrip so that when
the taskbar icon is clicked a menu shows up. I added the
ContextMenuStrip to the properties menu for the notifyicon. now when
i run the program when i right-click the notifyicon the first time
nothing happens, but the menu shows up the second time i click it. it
only seems to display the menu every-other click. makes no sense to
me.
I have no idea why, any help would be greatly appreciated.
|
|
|
|
|
I'm wondering what you did to get it to do this. I can't duplicate the problem, nor can I break it, to make it do what you're explaining. Did you put anny code in to enable/disable certain items in the menu at any time?
|
|
|
|
|
After posting i created a blank project with just a contextmenu and a notifyicon and it worked perfectly. Comparing the two projects i found a piece of code that i had added and forgotten to remove which was causing this problem. so if your looking for this "feature" then simply add the following
Private Sub notifyicon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
Me.Activate()
End Sub
the right click wouldn't register until it was clicked twice.
Thanks for the reply.
|
|
|
|
|
No wonder I couldn't break it!
|
|
|
|
|
Hi,
i want to determine path of system Windows folder.There r option for determine the path of Program files,my document,etc folder but no option for windows folder.
require some clue or hint. any help will be appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Rupesh Kumar Swami wrote: There r option for determine the path of Program files,my document,etc folder but no option for windows folder
Wanna bet?
Imports System.Io
.
.
.
' This will get the parent directory of the path returned by SpecialFolder.System
' which is normally C:\Windows\System32. The parent folder would be C:\Windows
Dim systemPath As String = Path.GetDirectoryName( _
Environment.GetFolderPath(Environment.SpecialFolder.System))
|
|
|
|
|
Thanks . one more question
i create some label with font type "Kristen ITC.TTF". i want to copy this font to Client system at run time if font is missing.
Following are the code
Dim str As String<br />
Try<br />
Dim systemPath As String = Path.GetDirectoryName(Environment.GetFolderPath(Environment.SpecialFolder.System))<br />
str = systemPath & "\fonts"<br />
systemPath = systemPath & "\Fonts\ITCKRIST.TTF"<br />
If File.Exists(systemPath) Then<br />
<br />
Else<br />
File.Copy(Application.StartupPath & "\ITCKRIST.TTF", str & "\ITCKRIST.TTF", True)<br />
End If<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
End Try
however this code copy the specified font to client system but there r no effect on my app.
Label are generated with Microsoft scan serief font.
i have no idea where i m wrong?
any idea or clue ?
thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Rupesh Kumar Swami wrote: however this code copy the specified font to client system but there r no effect on my app.
The font MUST be installed at the time your app is install on the system. You cannot do it from your code and expect it to work. Just copying the font to the Fonts folder will not install the font. Also, the font will not be available to your code during that session of your app. You app will have to restart to get access to the font.
Install the font at application install time, not run-time. If the user running your app is a member of the Users group, and not the Administrators or Power Users groups, they won't be able to copy the font into the Fonts folder anyway.
|
|
|
|
|
uninstall the font on your machine. Then get your program to copy it into the font directory. Theoretically, the windows font installer should popup and install the font as it normally does with manual copy and paste. If it doesn't however you will have to find a way around it.
Posted by The ANZAC
|
|
|
|
|
Hi there,
I'm trying to execute a SQL command that works perfect with an Access DB, but it gives me an 'Incorrect syntax near the keyword 'COLUMN'' error if I use it on a SQL Server Database. Why is that?
Here is my code:
ALTER TABLE Staff ADD COLUMN [MaxDisc] single
SQL Server does not support 'single' as a data type and I’ve changed it to the following:
ALTER TABLE Staff ADD COLUMN [MaxDisc] real
Any help would be appreciated.
Regards, Werries
-- modified at 10:03 Tuesday 15th May, 2007
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
Easy. You've already found out that TSQL and Access's version of it are not the same. Access only supports a subset of TSQL and adds it's own "flavor" to some of what would be considered normal for other implementations of SQL.
If you wanted to support different database engines, you'd have to implement different data layers in your application to support them.
For instance, SQL Server supports batch queries, where Access does not. You'd have to implement the missing functionality in your own code instead of relying on the database engine to do it for you.
|
|
|
|
|
ALTER TABLE dbo.Staff ADD MaxDisk real NULL
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
I have looked for this and the only answers I've found are for what I'm already doing.
I've tried all of the following and non of them work when I click in the textbox with the mouse.
uxBox1.SelectionStart = 0
uxBox1.SelectionLength = uxBox1.Text.Length
uxBox1.SelectAll()
uxBox1.Focus()
uxBox1.Select(0, uxBox1.Text.Length) Is there a missing step here? According to the properties of the textbox, it has selected text after this but it isn't highlighted. I used to be able to do this in .NET 1.1 but this is .NET 2.0.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
The events fire in a slightly different order in .NET 2.0. In addition, when, or even if, you call the Base classes Onevent methods can alter the results of your code.
What are you trying to do with this??
|
|
|
|
|
Dave Kreskowiak wrote: What are you trying to do with this??
I am just trying to highlight all of the text in the textbox so that when the user clicks on it or enters the box in anyway that it will be highlighted (selected).
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|