|
What are you talking about?? Are you trying to find which .DLL's the default Windows Forms Application is referencing?? That's easy. Start a new project, then double-click the "My Project" folder in the Solution Explorer and click on the References tab. They're all right there.
|
|
|
|
|
i want that reference (dll) information at runtime and not for current application
|
|
|
|
|
Ohhh...you didn't specifiy that in your question. References don't exist at runtime, so you can't get this list. But, there's is a close approximation.
You can find the CURRENTLY LOADED assemblies (kind of like your references) for an AppDomain by getting the list from AppDomain.CurrentDomain.GetAssemblies() . Something like:
Imports System.Reflection
.
.
.
Dim assemblies As Assembly() = AppDomain.CurrentDomain.GetAssemblies()
For Each a As Assembly In assemblies
Console.WriteLine(String.Format("Codebase: {0}", a.CodeBase))
Console.WriteLine(String.Format("FullName: {0}", a.FullName))
Next
Now, as you run your application, this list may change as execution moves from one assembly in your app to another.
|
|
|
|
|
Hi,
I currently have a background application who read barcodes from a serial port scanner, validate the barcode and send it to wathever application running in the foreground and then display it in the focused textbox. If barcode is wrong, a big red screen popup with an error message and the barcode is discard. This is working fine.
Now, I have to do the same, with a USB keyboard wedge scanner. Is there a way I can read the scanner input from the USB port, in vb.net ? Remember, my apps is in the background, barcodes have to be validate before displaying it in the main screen (which is an excel spreadsheet). Does anyone knows how to intercept keys input in vb?
thanks for your help
Dominic
|
|
|
|
|
Excel is a bit of a problem. You don't get any of the KeyPress, KeyDown events in an Excel worksheet. You can probably get them in a form in Excel though. I'm not sure since I don't do much Office Interop.
|
|
|
|
|
Is the scanner giving you any reads in other apps.. Notepad? If not you may need to ask the OEM if there is a set of default set up bar codes for your scanner and for use with USB in a VB environment. If it is reading to other apps I have seen problems upgrading from one OEM to another my self and have had to go back to the OEM for updated default set up bar codes as some time the published set may not work… We had just started to see USB keyboard wedge scanners before I left NCR as a tech lead in the field, and that was almost a year ago but that is how it was then…
|
|
|
|
|
The scanner reads good, problem is, my application have to intercept the barcode for analyse before sending it to the Excel sheet. My application runs in the background (on the system tray). When using serial port barcode scanner, there is no problem at all, I just have to open the serial port, get the barcode, analyse it and send it to the main program's focused textbox. That way, it works fine. Problem is with a keyboard wedge scanner. How can I program my background application to read the keyboard entries (and analyse it) before sending it to Excel??!
|
|
|
|
|
Ok, if I read you correctly your background app is running looking for data from the RS232- serial port barcode scanner. So there is an active port it is looking at. Change the active port to the USB, The app needs to know what to look for on the system. You should have a Setup barcode for USB host type, Try the IBM Hand-held code, Make 100% sure you do not miss scan set-up BC’s as this will mess you up every time. If you still are having a problem I would ask the OEM of the UBS-BC Scanner…I’m sure they have had the problem and fixed it, it is just not in the docs…
|
|
|
|
|
I have this error, Can any one help me to solve it as soon as possible
Cross thread operation not valid: Control textBox1 accessed from a thread other than the thread it was created on.
|
|
|
|
|
I have a helper class to strongly type data:
Public Class SupplierTrans
Private _date As Date
Private _period As Integer
Private _year As Integer
Private _type As String
Private _reference As String
Private _portfolio As String
Private _netamount As Decimal
Private _taxAmount As Decimal
Private _paidAmount As Decimal
Public Sub New(ByVal transdate As Date, ByVal period As Integer, ByVal year As Integer, ByVal type As String, ByVal reference As String, ByVal portfolio As String, ByVal netamount As Decimal, ByVal taxamount As Decimal, ByVal paidamount As Decimal)
_date = transdate
_period = period
_year = year
_type = type
_reference = reference
_portfolio = portfolio
_netamount = netamount
_taxAmount = taxamount
_paidAmount = paidamount
End Sub
Public ReadOnly Property TransDate() As Date
Get
Return _date
End Get
End Property
Public ReadOnly Property Period() As Integer
Get
Return _period
End Get
End Property
Public ReadOnly Property Year() As Integer
Get
Return _year
End Get
End Property
Public ReadOnly Property Type() As String
Get
Return _type
End Get
End Property
Public ReadOnly Property Reference() As String
Get
Return _reference
End Get
End Property
Public ReadOnly Property Portfolio() As String
Get
Return _portfolio
End Get
End Property
Public ReadOnly Property NetAmount() As Decimal
Get
Return _netamount
End Get
End Property
Public ReadOnly Property TaxAmount() As Decimal
Get
Return _taxAmount
End Get
End Property
Public ReadOnly Property PaidAmount() As Decimal
Get
Return _paidAmount
End Get
End Property
End Class
I am using LINQ to query a generic list (transactions):
Dim tranItems = (From trans In transactions Order By trans.TranDate Group trans By trans.SourceID Into grouping = Group Select New SupplierTrans()).ToList()
but am having touble in referencing the transactions columns within the
'Select New SupplierTrans()' section.
I have tried
Select New SupplierTrans(TranDate ...) without success. The columns (TranDate etc) as now shown in the context hinting. How can I correctly reference these items please?
|
|
|
|
|
Because you created a Constructor, it overrides the default constructor so you cannot do new supplierTrans() unless you specify all the required fields. You have to recreate a default constructor, that is if I remember correctly. If I'm wrong I'm sure someone will correct me.
|
|
|
|
|
First, I would suggest that next time (and this time in your code) you put some line breaks in the query.
As to the problem in your query, let's take a look at what you get at each step of the query:
dim items = From trans In transactions _ 'you haven't done anything yet
Order By trans.TranDate _ 'now the entire list is sorted by transaction date
'but you still return IEnumerable(Of SupplierTrans)
Group trans By trans.SourceID _
Into grouping = Group 'this will create an IEnumerable of an anonymous type
'with the SourceID for the group and an IEnumerable of
'all transactions with that SourceID.
It's not very clear what you are trying to make here, but if you just wanted to sort the list by TranDate and SourceID, you may have been better off with two Order By statements. If you do want the groupings, you could have simply written Group By trans.SourceID Into Group to get the same result.
Just remember that the IDE and Intellisense will almost always give you all the information you need to see what you have at any point. If I were to hover over the items variable, I would see that it is an IEnumerable(Of <anonymous type> ) . From there I can type items.First. and Intellisense will pop up the list of members for that anonymous type (in this case grouping and SourceID).
|
|
|
|
|
Hi All,
I am developing a project that sending bulk sms to mobile using serial port. Most of the time it is working properly. Some times am getting the error like,
"The semaphore timeout period has expired"
"The remote system refused the network connection"
and
"The format of the specified network name is invalid"
I have tried with Google search...I got so many articles about this.
But i didn't get the actual resources.
I don't understand the reason behind it. May I get some ideas??
Thanks in Advance
|
|
|
|
|
You're going to have to start reading and testing possible solutions yourself. It does not appear to be anything wrong with your code, but with an underlying network issue.
|
|
|
|
|
<b>Sample dll code: </b>
Public Class SWTest
Public Shared Sub kv()
MsgBox("Code Project")
End Sub
End Class
Please help me, how can i import this dll and call the procedure at runtime
Note: My windows application only have the string inputs of (dll) file path and procedure name
Example:
Input1 = "D:\SWTest.dll"
Input2 = "kv"
Thanks
KV
|
|
|
|
|
|
hi,
i used your link sample, but i was got this error
Value cannot be null.
Parameter name: ptr
FYI: Please download my sample project from this link <a href="http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html">http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html</a>[<a href="http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html" target="_blank" title="New Window">^</a>]
Note: Please send me any sample project attachment to my email id (to_velu@yahoo.co.in) if possible.
|
|
|
|
|
Download link
http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html
|
|
|
|
|
The method you are using (and was suggested in my link) works for ActiveX Dlls and OCX objects.
First, have your class library a module not a class:
Public Module TestDll
Public Sub Test()
MsgBox("Hi")
End Sub
End Module
Then use LoadLibrary to load the dll.
Delegate Sub Tst()
.
.
.
Static dll_loaded As Boolean, dll_handle As Int32, fn As tst
dll_handle = LoadLibrary("Testdll.dll")
msgfn = GetProcAddress(dll_handle, "Test")
msgfn.Invoke()
By the way, why do you want to late-bind?
Try using
Declare which makes it much faster and more reliable!
|
|
|
|
|
I believe you need to read up on Late Binding[^]
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi,
What would you think if the listview is not showing the Turkish characters in the rows after placing a splitter container and moving listview into splitter's one side panel and setting the fonts same for both controls. This problem turned in to a disaster for me. Eventough I used UTF encoding to the strings the problem haven't changed.
Here how I tested the problem to make sure the turkish characters were diplayed in the listview properly.
I created a new form and placed a listview with one column and then I listed the file mames which contained some turkish characters in this column. It showed perfectly. However, after adding a splitter container control on to form and moving listview inside of this container and adding a few more columns to listview did start not showing the Turkish characters anymore in the listview but strange characters.
Now I wonder what would you think about such problem and how to solve it?
Thanks for reading.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Recheck the properties of your ListView. It is possible that 1 or more have reset to the defaults, when you moved the ListView control into the splitter
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
The problem remains the same I have checked to see if any property attribute set to default.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi,
How could you determine if a read item is a folder or a file in vb.net? For an instance I have read all the files under directory. At the same time there is a sub directory under the directory and I want to get its type.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
modified on Sunday, February 8, 2009 1:54 PM
|
|
|
|
|
Hi,
File attributes would tell you. Here is a C# example, I don't have it in VB.NET:
FileInfo info=new FileInfo(fileName);
attributes=info.Attributes;
bool isFolder=(attributes & FileAttributes.Directory)!=0;
...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|