|
serbach wrote: Dim bmp As Bitmap = New Bitmap("TestImage.jpg.working")
You need to call Dispose on this object before you'll be able to rename or overwrite the file in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian,
» You need to call Dispose on this object before you'll be able to rename or overwrite the file in question. «
Thank you! That is precisely what I needed!
Sincerely,
Steve Erbach
Neenah, WI
http://TheTownCrank.blogspot.com
|
|
|
|
|
DataSet ds = TextToDataSet.Convert(
"c:\test.txt", "MyNewTable", "\t");
Rekha
|
|
|
|
|
It would look like this:
Dim ds as DataSet = TextToDataSet.Convert("c:\test.txt", "MyNewTable", "\t")
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Actually, there's got to be an error in that C# code. Since the "c:\.." doesn't have the backslash escaped, the "\t" is a tab character.
Here's the VB equivalent via Instant VB, which shows the original problem more clearly:
Dim ds As DataSet = TextToDataSet.Convert("c:" & Constants.vbTab & "est.txt", "MyNewTable", Constants.vbTab)
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# to C++/CLI and VB to C++/CLI
Instant Python: converts C# to IronPython and VB to IronPython
|
|
|
|
|
DataSet ds = TextToDataSet.Convert(
"c:\test.txt", "MyNewTable", "\t");
Rekha
|
|
|
|
|
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
|
|
|
|