|
I have written a small DLL in VB 6.0 that reads messages from an MSMQ queue and posts a reply message on a separate queue. The incoming messages have a CorrelationID (which is a GUID), and I would like to grab that ID from the incoming message, and re-attach it to the outgoing reply message.
However, by default, VB 6.0 does not seem to know GUID as a data type. Is there any way to get the GUID data type into my project, so I can get this functionality? Thanks a lot!
Dox Girl, where are you?
|
|
|
|
|
What is the best way to read values from other applications (textboxes, combo boxes) using .Net?
Thanks in advance
|
|
|
|
|
Hello,
I have a driver that was created in vb6 as a connector to a database. We have a program that has a wrapper calling the dll that worked in win200 but will not work in win xp. We decided to re-do the dll in .net which works fine with vb scripts that call the dll but still refuse to work within the wrapper that was created for the program. The error that we are getting is "Error [-2147221164]: CreateInstance(__uuidof(dll name))" Unable to detact the database. Make sure the dll is registered. We have the dll registered and have done that a few times. Any help would be great.
Thanks
Wally
|
|
|
|
|
Hie,
I tried out samples in MSDN regarding how to enable autoincrement of an ID through Stored Procedure, it works. Now I'm having doubts where I wanted to insert the ID which is auto-incremented in parent table when a new record is added, to be inserted in the child table.
I just make an illustration for example, StaffAccount Table (Parent Table)having StaffID as primary key, it is auto-incremented using stored procedures-succesfully completed, now the StaffID is the foreign key in Login Table(Child Table), I want the StaffID to be added automaticallly in child table once a new record has been inserted in parent table.
How is this possible?
Thanks in advance for helping in reading this.
=)
best regards amygal
|
|
|
|
|
Does anyone know how to get the maintenance date from a file if you're given the file's location in the file system? (Specifially a .rpt crystal report file) I use Visual Studio 2005.
|
|
|
|
|
Create a FileInfo object for the file. That contains the time when the file was created, last written to and last accessed, in UTC or local time.
---
b { font-weight: normal; }
|
|
|
|
|
I am using the following code to make the treeview.The problem is when i right click the node it first boes to mouse function where
TreeView1.SelectedNode = TreeView1.GetNodeAt(e.X, e.Y)
the code line redirects the control to after select function.and expands the node.which i don't want.can u help me.
Imports System.IO<br />
Imports System.Runtime.InteropServices<br />
Public Class Explorer<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
<br />
Public Sub New()<br />
MyBase.New()<br />
<br />
'This call is required by the Windows Form Designer.<br />
InitializeComponent()<br />
<br />
'Add any initialization after the InitializeComponent() call<br />
<br />
End Sub<br />
<br />
'Form overrides dispose to clean up the component list.<br />
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
If disposing Then<br />
If Not (components Is Nothing) Then<br />
components.Dispose()<br />
End If<br />
End If<br />
MyBase.Dispose(disposing)<br />
End Sub<br />
<br />
'Required by the Windows Form Designer<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
'It can be modified using the Windows Form Designer. <br />
'Do not modify it using the code editor.<br />
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView<br />
Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu<br />
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem<br />
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem<br />
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem<br />
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem<br />
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
Me.TreeView1 = New System.Windows.Forms.TreeView<br />
Me.ContextMenu1 = New System.Windows.Forms.ContextMenu<br />
Me.MenuItem1 = New System.Windows.Forms.MenuItem<br />
Me.MenuItem2 = New System.Windows.Forms.MenuItem<br />
Me.MenuItem3 = New System.Windows.Forms.MenuItem<br />
Me.MenuItem4 = New System.Windows.Forms.MenuItem<br />
Me.SuspendLayout()<br />
'<br />
'TreeView1<br />
'<br />
Me.TreeView1.ImageIndex = -1<br />
Me.TreeView1.Location = New System.Drawing.Point(0, 0)<br />
Me.TreeView1.Name = "TreeView1"<br />
Me.TreeView1.SelectedImageIndex = -1<br />
Me.TreeView1.Size = New System.Drawing.Size(224, 448)<br />
Me.TreeView1.TabIndex = 0<br />
'<br />
'ContextMenu1<br />
'<br />
Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2, Me.MenuItem3, Me.MenuItem4})<br />
'<br />
'MenuItem1<br />
'<br />
Me.MenuItem1.Index = 0<br />
Me.MenuItem1.Text = "Open"<br />
'<br />
'MenuItem2<br />
'<br />
Me.MenuItem2.Index = 1<br />
Me.MenuItem2.Text = "Rename"<br />
'<br />
'MenuItem3<br />
'<br />
Me.MenuItem3.Index = 2<br />
Me.MenuItem3.Text = "Delete"<br />
'<br />
'MenuItem4<br />
'<br />
Me.MenuItem4.Index = 3<br />
Me.MenuItem4.Text = "Properties"<br />
'<br />
'Explorer<br />
'<br />
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)<br />
Me.ClientSize = New System.Drawing.Size(224, 446)<br />
Me.Controls.Add(Me.TreeView1)<br />
Me.Name = "Explorer"<br />
Me.Text = "Explorer"<br />
Me.ResumeLayout(False)<br />
<br />
End Sub<br />
<br />
#End Region<br />
Dim entry As Integer = 1<br />
Dim mouseentry As Boolean<br />
<br />
#Region "Structure Declaration"<br />
Private Structure SHFileInfo<br />
Public hIcon As IntPtr<br />
Public iIcon As Integer<br />
Public dwfileattributes As Integer<br />
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public path As String<br />
End Structure<br />
#End Region<br />
<br />
#Region "Api"<br />
Private Declare Auto Function SHGetFileInfo Lib "shell32.dll" (ByVal filepath As String, ByVal dwfileattributes As Integer, ByRef shfi As SHFileInfo, ByVal ileinfo As Integer, ByVal flags As Integer) As IntPtr<br />
Private Const iconsize = 1<br />
#End Region<br />
Dim imagelist As New imagelist<br />
Dim imageindex As Long<br />
<br />
Private Sub Explorer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
TreeView1.ImageList = imagelist<br />
For drives As Integer = 0 To Directory.GetLogicalDrives.Length - 1<br />
TreeView1.Nodes.Add(Directory.GetLogicalDrives(drives).Remove(Directory.GetLogicalDrives(drives).Length - 1, 1))<br />
Dim node As New TreeNode<br />
node.Text = ""<br />
TreeView1.Nodes(drives).Nodes.Add(node)<br />
node = Nothing<br />
GetIcons(Directory.GetLogicalDrives(drives), TreeView1.Nodes(drives))<br />
Next<br />
End Sub<br />
Private Sub GetIcons(ByVal path As String, ByVal treenode As TreeNode)<br />
Dim ptr As IntPtr<br />
Dim psfi As New SHFileInfo<br />
ptr = SHGetFileInfo(path, 0, psfi, Marshal.SizeOf(psfi), iconsize Or 256)<br />
imagelist.Images.Add(System.Drawing.Icon.FromHandle(psfi.hIcon))<br />
treenode.ImageIndex = imageindex<br />
' treenode.SelectedImageIndex = imageindex<br />
imageindex += 1<br />
End Sub<br />
Private Sub TreeView1_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect<br />
If (e.Action = TreeViewAction.Unknown) Then<br />
Return<br />
End If<br />
TreeView1.SelectedImageIndex = TreeView1.SelectedNode.ImageIndex<br />
e.Node.Expand()<br />
End Sub<br />
<br />
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterExpand<br />
If (Not e.Node.Nodes(0).GetNodeCount(False) = 0) Then<br />
e.Node.FirstNode.Remove()<br />
End If<br />
Dim text As String = e.Node.Text<br />
Dim treenode As New TreeNode<br />
treenode = e.Node()<br />
While (Not treenode Is Nothing)<br />
treenode = treenode.Parent<br />
If (Not treenode Is Nothing) Then<br />
text = treenode.Text + "\" + text<br />
End If<br />
End While<br />
GetDirectory(e.Node, text)<br />
End Sub<br />
Private Sub GetDirectory(ByVal treenode As TreeNode, ByVal text As String)<br />
treenode.FirstNode.Remove()<br />
Dim insertdir As Integer<br />
If (Directory.Exists(text & "\")) Then<br />
For directorycount As Integer = 0 To Directory.GetDirectories(text & "\").Length - 1<br />
Dim dir As String = Directory.GetDirectories(text & "\").GetValue(directorycount)<br />
If (File.GetAttributes(dir) = 16 Or File.GetAttributes(dir) = 17 Or File.GetAttributes(dir) = 48 Or File.GetAttributes(dir) = 49 Or File.GetAttributes(dir) = 20) Then<br />
dir = dir.Remove(0, dir.LastIndexOf("\") + 1)<br />
treenode.Nodes.Add(dir)<br />
Dim node As New TreeNode<br />
node.Text = ""<br />
treenode.Nodes(insertdir).Nodes.Add(node)<br />
GetIcons(Directory.GetDirectories(text & "\").GetValue(directorycount), treenode.Nodes(insertdir))<br />
node = Nothing<br />
insertdir += 1<br />
End If<br />
Next<br />
End If<br />
End Sub<br />
<br />
Private Sub TreeView1_BeforeCollapse(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeView1.BeforeCollapse<br />
For count As Integer = 0 To e.Node.GetNodeCount(False) - 1<br />
e.Node.Nodes(count).Remove()<br />
count -= 1<br />
If (e.Node.GetNodeCount(False) = 0) Then<br />
Dim node As New TreeNode<br />
node.Text = ""<br />
e.Node.Nodes.Add(node)<br />
node = Nothing<br />
Return<br />
End If<br />
Next<br />
End Sub<br />
<br />
Private Sub TreeView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseDown<br />
If (e.Button = MouseButtons.Left) Then<br />
TreeView1.SelectedNode = TreeView1.GetNodeAt(e.X, e.Y)<br />
End If<br />
If (e.Button = MouseButtons.Right) Then<br />
TreeView1.SelectedNode = TreeView1.GetNodeAt(e.X, e.Y)<br />
<br />
Dim point As New Point<br />
point.X = e.X<br />
point.Y = e.Y<br />
ContextMenu1.Show(TreeView1, point)<br />
End If<br />
End Sub<br />
End Class
|
|
|
|
|
It would be much better if you put your question and related code only. instead of copy paste the complete form.
Rizwan Bashir
|
|
|
|
|
Well the problem is concerned with all the function available in the code.
|
|
|
|
|
Hello,
I want to create an application in which I want to execute cmd commands.
I have taken a RichTextBox in which user will write command and by pressing a button it will generate output but I don't want cmd window to be appeared.
plz send code or any link to solve my problem.
Thanks & Regards,
Chandan KUmar
|
|
|
|
|
|
Everything you need ccan be found in the Process[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
1.1 or 2.0 dotnet framework
I have build one control to display Graph on desktop application. Now the customer wants to export that Graph as an image file. Can any one help me how to make picture of any control. like you have one Panel Control and you want to make the panel control Picture.
Any help will be highly appreciated
Regards
Rizwan Bashir
|
|
|
|
|
Hi everyone,
I am trying to develop an app which should read date info from a remote machine (which has MS win on board). My problem is:
I don't know the CurrentCulture of the remote machine and therefore I don't know which is the DateTime format of the dates I retrieve. If I get some special dates,
for example 02/01/06, I wouldn't know which one represents the day, month or year.
Is there any way to retrieve the culture or just the datetime format of the remote machine?
N.B. just keep in mind that I only know the IP address of the remote machine and I'm not allowed to deploy any component on it
|
|
|
|
|
When you get the date in any format (which you don't know)
convert it to the format you want.
for example you've got 01/03/06 => convert it to yyyy/M/d
it will innerly will convert to 2006/Mar/01 (if you considered that the fomat of 01/03/06 is d/m/y)
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
Sorry,
maybe I didn't tell you that the date comes as a string.
I can't wonder about its format.
If the machine had english date format, 01/03/06 means 2006/Jan/03.
|
|
|
|
|
vilmer wrote: am trying to develop an app which should read date info from a remote machine
How are you doing this?? Are you using a compponent on the remote machine that you wrote?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The remote machine hosts a scada system and I can manage some APIs to exchange data with it. The remote machine comes as is, so I can't install any other component on it. I just have this library to communicate with it and the function defined in my library returns me a string
|
|
|
|
|
In that case, you're on your own. You'll have to consult with the docs on the API to find out if the datetime your getting is in any specifal format, not culture specific, or it it'll give you the culture info. I'm doubting it though.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am trying to display a tif image in KodakImageEdit control using VB6
but it gives an error when I set the DisplayScaleAlgorithm to 2.
If I set DisplayScaleAlgorithm to 1 it doesnt display the image properly it shows a black image with white dots.
The OS on my system is XP, but when I tryed on Win2000 it gives the same error.
Every is Illusion
-- modified at 8:10 Wednesday 21st June, 2006
|
|
|
|
|
Kodak Imaging??? I though that thing died a long time ago!
It not likely you're going to get any help with it. Kodak Imaging wasn't even included with Windows XP, so you had to get it from some other source. See this[^] for a little more information.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
When using DOM to process an XML file, I need to get hold of the attributes when present. Now I can get hold of them if I know there names, but what about when I do not know the attribute names?
Set objAttributes = objDOMNode.Attributes<br />
<br />
'check that there are attributes.<br />
If objAttributes.length > 0 Then<br />
<br />
'we know that we've named our id reference as<br />
''PERSONID', therefore tell the NameNodeListMap to get<br />
'this node by using the getNamedItem method<br />
Set objAttributeNode = objAttributes.getNamedItem("PERSONID")<br />
<br />
'store this value in the tag of the treeview<br />
tvwElement.Tag = objAttributeNode.nodeValue<br />
End If
The above code is OK for when you know the attribute name, but its the case when you dont know the number and names.
Any suggests please.
|
|
|
|
|
You should be able to just use the collection of XMLAttributes as an array. So you code becoes something like this:
Set objAttributes = objDOMNode.Attributes
If objAttributes.Length > 0 Then
Set objAttributeNode = objAttributes(0)
tvwElement.Tag = objAttributeNode.nodeValue
End If
another option is to iterate through the collection of attributes and get each one of them, and append to the tree view.
Set objAttributes = objDOMNode.Attributes
If objAttributes.Length > 0 Then
For Each objAttributeNode in objAttributes
Next
End If
----
www.digitalGetto.com
|
|
|
|
|
I have looked at a number of ways to clear the 'temp internet files' of users on our 2003 servers and have come to an abrupt Halt.
Although by re-attribbing the files within the Temp folder allows the removal of files, the same does not work with folders.
Is there a way that I can script the removal of both files and folders from within the Temp Internet Files for one or more users.
I exist therefore I code
|
|
|
|
|