|
hi, this is a console app. so did your win forms project work, if so, then fine, can you send me the project, via e-mail to me as a zip, so then i can then rebuild the windows forms. just did not get any errors. and said it did not build, from my external drive. able to do this for me dave. marvin.
|
|
|
|
|
I didn't do anything special at all.
All I did was apparently what you did. Since you have a reference to "System.Windows.Forms" near the top of the code, that tells me you added a Module to a new Windows Forms project, and then added your code to the new Module. You then changed the project Startup to either "Sub Main" or "Module1" in the Project Properties.
Again, those are not errors. Everything you posted is a Warning and will not, by default, prevent your code from compiling and running. Unless, of course, you turned on the option that says "Treat warnings as errors".
|
|
|
|
|
hi. so can you e-mail me privately and help me out, then i can then e-mail you back and forth. so, then how to fix this and my screen reader jaws says build failed. no, did not turn any thing on. so, how to fix this, and then get this to build. it is a console app. unless try creating a new console app, then maybe not add the windows forms. can you help. thanks.
|
|
|
|
|
I told you exactly what I did you recreate your project. You can go through the exact same steps to do it yourself. It'll take you 2 minutes.
Start with a new Windows Forms app, add a new Module file to it, and copy your exact code from your own post into that Module file.
Oh, and you're going to have to add a reference to System.Speech.
|
|
|
|
|
You need to be clear on what you are asking. And no, it is unlikely anyone will fix it for you and email you back all the fixed code. Unless you pay.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I tried to solve this and did not get it, the problem that I have a MatLab DLL file with a function looks like this
[tmin, mawp,sigma,tmin_c,tmin_l,segma_c,segma_l] = cylindrical(a,b,c,d,e,f)
I did reference the dll and the mwarray dll, when I call the MatLab's obj to the function it returns nothing, and if I use an index to map the array it gives an invalid index error. I am sorry if I didn't make myself clear, but I hope the code will.
This is VB.NET program that uses Matlab function to calculate some values, I tried to make the output as an array using ToArray function but it didn't work, Also in the MathWork documentation they talked about that conversion as in vb you need to use op_implicit function but I did not figure it out, I tried so many things but I am stuck here guys, appreciate your help.
'after importing dlls
Dim matlab As MAWP_CYL = New MAWP_CYL()
'this to matlab obj
Dim result = matlab.Cylindrical(1,1,1,1,1,1).ToArray()
'using any numbers for test
'here result have nothing when debugging,
the result has nothing, not an array or any form of lists.
|
|
|
|
|
What are the parameter values to the Cylindrical function supposed to be, and what result should it return?
|
|
|
|
|
Hello all.
Does anyone know how to send multiple latitudes & longitudes from VB.net to Google Maps and receive from Maps services what is the best route?
I'd like to receive something like this:
1) Address B
2) Address A
3) Address D
4) Address C
It would indicate me where to go first.
Thanks.
Paulo
|
|
|
|
|
Ah the old drunkards walk - I designed one of these in the 90s, for just one city. I'm betting Google does not have such a facility freely available, it is a MAJOR task to get right as you must take into account one way street and traffic conditions.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
The API accepts multiple addresses, and returns the results in the form of arrays. The actual format to be used will depend on which version (iOS, Android, JSON) that you are using. The Google documentation should help.
|
|
|
|
|
I posted this C# board first which was a mistake again I apologize. I work for this company where the old programmer was in the process of rewrite the source code with no documentation at all from VB.Net to C# Now we have 4 programs total and they all update from the same database and get price updates on items. My problem is on one of the programs if a customer was to do full sync which is the whole database list of well 60,000 items I get OutOfMemoryException when it imports the last category Items. Here are the Exceptions Quote: Exception thrown: 'System.OutOfMemoryException' in System.Data.dll
Exception thrown: 'System.OutOfMemoryException' in Microsoft.EntityFrameworkCore.Relational.dll
Exception thrown: 'System.OutOfMemoryException' in Microsoft.EntityFrameworkCore.Relational.dll
Exception thrown: 'System.OutOfMemoryException' in Microsoft.EntityFrameworkCore.dll
Exception thrown: 'System.OutOfMemoryException' in Microsoft.EntityFrameworkCore.dll
Private Function DoImpItems() As Boolean
Dim percent As Integer = 0
Dim currentRow As Integer = 0
Dim ItemDataRow As DataSetPricing.ItemsRow
Dim CommodityDataRow As DataSetPricing.CommoditiesRow
Dim LevelTypeDataRow As DataSetPricing.LevelTypesRow
Dim StatusDataRow As DataSetPricing.StatusRow
Dim ManufacturerDataRow As DataSetPricing.ManufacturersRow
Dim UomDataRow As DataSetPricing.UOMRow
Dim WorkgroupDataRow As DataSetPricing.WorkGroupsRow
Dim Item As Models.Item
Manufacturers = ServiceLocator.Current.GetInstance(Of IManufacturers).Get
WorkGroups = ServiceLocator.Current.GetInstance(Of IWorkgroups).Get
LevelTypes = ServiceLocator.Current.GetInstance(Of ILevelTypes).Get
ItemStatus = ServiceLocator.Current.GetInstance(Of IItemStatusTypes).Get
UOM = ServiceLocator.Current.GetInstance(Of IUom).Get
'Update Existing Items
Try
currentRow = 0
For Each row In DataSetPricing.Items
Item = ServiceLocator.Current.GetInstance(Of IItems).GetByRowId(row.RowID)
If Not Item Is Nothing Then
If Not Item.DoNotUpdate Then
Item.EriNumber = row.ERINumber
Item.EriNumberSearch = row.ERINumber
Item.Comparative = row.Comparative
If row.ParentID <> 0 Then
ItemDataRow = DataSetPricing.Items.Where(Function(d) d.PK_ItemID = row.ParentID).SingleOrDefault
If Not ItemDataRow Is Nothing Then
Dim ItemParent As Models.Item = ServiceLocator.Current.GetInstance(Of IItems).GetByRowId(ItemDataRow.RowID)
If Not ItemParent Is Nothing Then
Item.ParentId = ItemParent.PkItems
Else
Item.ParentId = 0
End If
Else
Item.ParentId = 0
End If
Else
Item.ParentId = 0
End If
Item.CatalogNumber = row.CatalogNumber
Item.Description = row.Description
Item.MyCost = CDec(Math.Round(row.Cost * IIf(IsDBNull(Item.MyMultiplier), 1, Item.MyMultiplier), 2))
Item.Cost = row.Cost
Item.Retail = row.Retail
If Not Config.NoUpdateLabor Then
Item.Labor = row.Labor
End If
Item.EffectiveDate = row.DateEffective
Item.Comparative = row.Comparative
Item.UPC = Strings.Right(row.UPC, 5)
Item.AlphaIndex = row.AlphaIndex
Item.ReportGroup = row.ReportGroup
Item.ImKing = row.ImKing
Item.ImageUrl = IIf(IsDBNull(row.ImageURL), String.Empty, row.ImageURL)
Item.CatalogPageUrl = IIf(IsDBNull(row.CatalogPageURL), String.Empty, row.CatalogPageURL)
Item.LastCostUpdate = Date.Now
LevelTypeDataRow = DataSetPricing.LevelTypes.Where(Function(d) d.PK_LevelTypeID = row.FK_LevelTypeID).SingleOrDefault
If Not LevelTypeDataRow Is Nothing Then
Dim q = (From c In LevelTypes Where c.RowId = LevelTypeDataRow.RowID).SingleOrDefault
Item.FkLevel = q.LevelTypeId
Else
Item.FkLevel = 1
End If
StatusDataRow = DataSetPricing.Status.Where(Function(d) d.PK_StatusID = row.FK_StatusID).SingleOrDefault
If Not StatusDataRow Is Nothing Then
Dim q = (From c In ItemStatus Where c.Status = StatusDataRow.Description).SingleOrDefault
Item.FkStatus = q.PkItemStatusTypes
Else
Item.FkStatus = 1
End If
UomDataRow = DataSetPricing.UOM.Where(Function(d) d.PK_UOMID = row.FK_UOMID).SingleOrDefault
If Not UomDataRow Is Nothing Then
Dim q = (From c In UOM Where c.UOM = UomDataRow.ShortDescription).SingleOrDefault
Item.FkUom = q.IdUom
Else
Item.FkUom = 0
End If
WorkgroupDataRow = DataSetPricing.WorkGroups.Where(Function(d) d.PK_WorkGroupID = row.FK_WorkgroupID).SingleOrDefault
If Not WorkgroupDataRow Is Nothing Then
Dim q = (From c In WorkGroups Where c.RowId = WorkgroupDataRow.RowID).SingleOrDefault
Item.FkWorkgroup = q.PkWorkgroups
Else
Item.FkWorkgroup = 0
End If
CommodityDataRow = DataSetPricing.Commodities.Where(Function(d) d.PK_CommodityID = row.FK_CommodityID).SingleOrDefault
If Not CommodityDataRow Is Nothing Then
Dim q = ServiceLocator.Current.GetInstance(Of ICommodities).GetByRowId(CommodityDataRow.RowID)
Item.FkCommodityId = q.PkCommodityId
Else
Item.FkCommodityId = 0
End If
ManufacturerDataRow = DataSetPricing.Manufacturers.Where(Function(d) d.PK_ManufacturerID = row.FK_ManufacturerID).SingleOrDefault
If Not ManufacturerDataRow Is Nothing Then
Dim q = (From c In Manufacturers Where c.RowId = ManufacturerDataRow.RowID).FirstOrDefault
Item.FkManufacturer = q.PkManufacturerId
Else
Item.FkManufacturer = 0
End If
End If
ServiceLocator.Current.GetInstance(Of IItems).Update(Item)
Else
Dim entity As New Models.Item
entity.EriNumber = row.ERINumber
entity.EriNumberSearch = row.ERINumber
entity.CatalogNumber = row.CatalogNumber
entity.Description = row.Description
entity.MyCost = row.Cost
entity.Cost = row.Cost
entity.Retail = row.Retail
entity.Labor = row.Labor
entity.EffectiveDate = row.DateEffective
entity.Comparative = row.Comparative
entity.UPC = Strings.Right(CStr(row.UPC), 5)
entity.AlphaIndex = row.AlphaIndex
entity.ReportGroup = row.ReportGroup
entity.ImKing = row.ImKing
entity.MyMultiplier = 1
entity.RowId = row.RowID
entity.ImageUrl = row.ImageURL
entity.CatalogPageUrl = row.CatalogPageURL
entity.LastCostUpdate = Date.Now
entity.DefaultCostCode = 0
If row.ParentID <> 0 Then
ItemDataRow = DataSetPricing.Items.Where(Function(d) d.PK_ItemID = row.ParentID).SingleOrDefault
If Not ItemDataRow Is Nothing Then
Dim ItemParent As Models.Item = ServiceLocator.Current.GetInstance(Of IItems).GetByRowId(ItemDataRow.RowID)
If Not ItemParent Is Nothing Then
entity.ParentId = ItemParent.PkItems
Else
entity.ParentId = 0
End If
Else
entity.ParentId = 0
End If
Else
entity.ParentId = 0
End If
LevelTypeDataRow = DataSetPricing.LevelTypes.Where(Function(d) d.PK_LevelTypeID = row.FK_LevelTypeID).SingleOrDefault
If Not LevelTypeDataRow Is Nothing Then
Dim q = (From c In LevelTypes Where c.RowId = LevelTypeDataRow.RowID).SingleOrDefault
entity.FkLevel = q.LevelTypeId
Else
entity.FkLevel = 1
End If
StatusDataRow = DataSetPricing.Status.Where(Function(d) d.PK_StatusID = row.FK_StatusID).SingleOrDefault
If Not StatusDataRow Is Nothing Then
Dim q = (From c In ItemStatus Where c.Status = StatusDataRow.Description).SingleOrDefault
entity.FkStatus = q.PkItemStatusTypes
Else
entity.FkStatus = 1
End If
UomDataRow = DataSetPricing.UOM.Where(Function(d) d.PK_UOMID = row.FK_UOMID).SingleOrDefault
If Not UomDataRow Is Nothing Then
Dim q = (From c In UOM Where c.UOM = UomDataRow.ShortDescription).SingleOrDefault
entity.FkUom = q.IdUom
Else
entity.FkUom = 0
End If
WorkgroupDataRow = DataSetPricing.WorkGroups.Where(Function(d) d.PK_WorkGroupID = row.FK_WorkgroupID).SingleOrDefault
If Not WorkgroupDataRow Is Nothing Then
Dim q = (From c In WorkGroups Where c.RowId = WorkgroupDataRow.RowID).SingleOrDefault
entity.FkWorkgroup = q.PkWorkgroups
Else
entity.FkWorkgroup = 0
End If
CommodityDataRow = DataSetPricing.Commodities.Where(Function(d) d.PK_CommodityID = row.FK_CommodityID).SingleOrDefault
If Not CommodityDataRow Is Nothing Then
Dim q = ServiceLocator.Current.GetInstance(Of ICommodities).GetByRowId(CommodityDataRow.RowID)
entity.FkCommodityId = q.PkCommodityId
Else
entity.FkCommodityId = 0
End If
ManufacturerDataRow = DataSetPricing.Manufacturers.Where(Function(d) d.PK_ManufacturerID = row.FK_ManufacturerID).SingleOrDefault
If Not ManufacturerDataRow Is Nothing Then
Dim q = (From c In Manufacturers Where c.RowId = ManufacturerDataRow.RowID).FirstOrDefault
entity.FkManufacturer = q.PkManufacturerId
Else
entity.FkManufacturer = 0
End If
ServiceLocator.Current.GetInstance(Of IItems).Add(entity)
End If
currentRow += 1
percent = CInt((currentRow / DataSetPricing.Items.Rows.Count) * 100)
BackgroundWorker.ReportProgress(percent)
Next
Catch ex As Exception
secondLevelMsg = ex.Message
Return False
Exit Function
End Try
Return True
End Function
|
|
|
|
|
Looks to me "it" is reading, updating and creating (Entity Framework) entities; but nowhere is it writing ("flushing") these entities to a database or garbage collecting. So, "memory" just fills up.
This may work for a few items (for whatever purpose), but not apparently for "60,000" (at one time).
For Each row In DataSetPricing.Items
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
What about using
XStreamingElement When reading the file
DataSetPricing.Items.BeginLoadData()
DataSetPricing.Items.DataSet.ReadXml(String.Format("{0}\Items.xml", My.Computer.FileSystem.SpecialDirectories.Temp), XmlReadMode.InferTypedSchema)
DataSetPricing.Items.EndLoadData()
BackgroundWorker.ReportProgress(60)
How do I change the code?
|
|
|
|
|
I'm trying to read an xml file one line at a time to update someone database with our prices tell me am I on the right path:
Private Sub TestReader()
Dim reader As XmlReader = XmlReader.Create(String.Format("{0}\Items.xml", My.Computer.FileSystem.SpecialDirectories.Temp))
reader.MoveToContent()
While reader.Read
If reader.NodeType = XmlNodeType.Element And reader.Name = "Items" Then
Dim row As DataSetPricing.ItemsRow = New DataSetPricing.ItemsDataTable().NewItemsRow
While reader.Read
If reader.NodeType = XmlNodeType.Element Then
Dim element As XElement = XElement.ReadFrom(reader)
Select Case reader.Name
Case "PK_ItemID"
row.PK_ItemID = element.Value
Exit Select
Case "ParentID"
row.ParentID = element.Value
Exit Select
Case "ERINumber"
row.ERINumber = element.Value
Exit Select
Case "Comparative"
row.Comparative = element.Value
Exit Select
Case "AlphaIndex"
row.AlphaIndex = element.Value
Exit Select
Case "Description"
row.Description = element.Value
Exit Select
Case "ImKing"
row.ImKing = element.Value
Exit Select
Case "FK_ManufacturerID"
row.PK_ItemID = element.Value
Exit Select
Case "FK_StatusID"
row.FK_StatusID = element.Value
Exit Select
Case "FK_LevelTypeID"
row.FK_LevelTypeID = element.Value
Exit Select
Case "FK_WorkGroupID"
row.FK_WorkgroupID = element.Value
Exit Select
Case "FK_CommodityID"
row.FK_CommodityID = element.Value
Exit Select
Case "UPC"
row.CatalogNumber = element.Value
Exit Select
Case "FK_UOMID"
row.FK_UOMID = element.Value
Exit Select
Case "Retail"
row.Retail = element.Value
Exit Select
Case "Cost"
row.Cost = element.Value
Exit Select
Case "Labor"
row.Labor = element.Value
Exit Select
Case "Multiplier"
row.Multiplier = element.Value
Exit Select
Case "ReportGroup"
row.ReportGroup = element.Value
Exit Select
Case "DateEffective"
row.DateEffective = element.Value
Exit Select
Case "ImageURL"
row.ImageURL = element.Value.ToString
Exit Select
Case "CatalogPageURL"
row.CatalogPageURL = element.Value.ToString
Exit Select
Case "LastUpdateDateTime"
row.LastUpdateDateTime = element.Value
Exit Select
Case "RowID"
row.RowID = element.Value
Exit Select
End Select
End If
End While
End If
End While
End Sub
|
|
|
|
|
Hi,
i want to create an option when I click right on 2 files.
I added the regkey in HKCU\Software\Classes*\shell and command.
but when I select my option it is executed twice. Once on file 1 and once on file 2. I want to run the command on the 2 files at once so that I can check that there are exactly 2 files selected as a parameter and than I can do my stuff with those files.
How can I make windows run my command on the 2 files in 1 instance of my command?
Jan
|
|
|
|
|
It will now launch two instances, right?
There's some articles here on preventing a second instance of your app, and how to send the starting-params to the first instance of the application, before exiting.
That way the first instance of the app could receive the params for the second instance and do it's work, while the second instance exits.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Unfortunately it's not an app but a vb-script. I try to converted it and work like you describe
thanks
I'll get back later; Maybe a lot later
Jan
|
|
|
|
|
I have a TreeView control within the main form. The main form processes the normal
drag/drop event processing. The drag/drop operation performs successfully except for this
little problem.
When I do a DoDragDrop() operation within the TreeView, when dragging the mouse 'within' the
TreeView, the main form receives drag drop events. I only want the 'main form' events when the mouse is within the main form client area. What have I missed?
Thanks
Private Sub FolderTree_Drag(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles MyBase.ItemDrag
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim node As TreeNode = CType(e.Item, TreeNode)
Dim dataObject As New DataObject()
Dim sFiles As New StringCollection
sFiles.Add(node.FullPath)
dataObject.SetData(ConstDragDropFormat, sFiles)
' Invoke the drag and drop operation
DoDragDrop(dataObject, DragDropEffects.Copy)
End If
End Sub
I have tried this code in the TreeView but it does not help.
Private Sub TreeView_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragEnter
e.Effect = DragDropEffects.None
End Sub
Private Sub TreeView_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragDrop
e.Effect = DragDropEffects.None
End Sub
Private Sub TreeView_DragOver(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragOver
e.Effect = DragDropEffects.None
End Sub
|
|
|
|
|
Hi there
Is there any method for IPC between VBS and C#?
Hope to use Sendmessage API, but I couldn't find any example how to send message from VBS
If you also suggest other way to send message from VBS to C#, It would be very appreciated
Thank you
|
|
|
|
|
What are you really trying to achieve ...?
|
|
|
|
|
There is no IPC between languages. There is between applications.
You haven't described what you're doing in VBS and in the C# code, not even what kind of app you've written in C#. Is this a COM component, a Windows Forms app, WPF app, ... ? What?
VBS cannot directly call Win32 functions, including SendMessage, but it can be done using a custom COM-component.
You're going to go into a lot more detail about what you're doing to get any meaningful answer.
|
|
|
|
|
Oh, I'm sorry to give any detail that I want to do.
Because I'm beginner here, just thought WPF is the only APP for C#, I applogize
My plan is, send data from VBS to WPF app.
I mean, Communication Between two programs in local computer not through the internet
For example,
Dim Data = "Hello"
I want to transmit "Hello" from VBS to WPF APP, and invoke popup message from WPF APP as "Hello"
If I can make two-way communication between VBS and WPF APP, it would be the best
but, To build VBS for Trasmission and WPF for Reception is also enough
Thank you
|
|
|
|
|
A better what to do that would be to use an Inter Process Communication method (IPC), like named pipes or memory mapped files.
The problem here is that VBScript doesn't have any native way to do any kind of IPC. It would take writing a COM-based component that your VBScript code can use (see the CreateObject function) to handle the IPC heavy lifting.
You would also have to implement the "server-side" of the communication channel in your WPF app.
|
|
|
|
|
Dear friends
please help me how to deal with this error object variable with block variable not found not found
|
|
|
|
|
You have to show us the code that is causing the error for us to even have half a chance of helping you!
|
|
|
|
|