
tommyf
Members-
Posts
21 -
Joined
-
Last visited
tommyf's Achievements
Newbie (1/14)
0
Reputation
-
Hi I am using a dll to extract information from an epos terminal. This brings me back information about the buttons on the terminal. It brings me back an integer for the button color as a 256 color pallet number. How do I use this for the background color of my button on my form. Thanks in advance
-
Hi Thank you for your help. I have managed to get this to work at last. The only problem i have is that it only callsback once and not everytime the till is used. I think it must be getting garbbaged collected. How do i stop this? The only other problem I have is that my call back so I have been told should bring back a 48 element char [byte] array. At the moment my call back is ByVal szJournalData() As Byte and convert this as follows str = System.Text.Encoding.ASCII.GetString(szJournalData, 0, szJournalData.Length) But it only brings back one character Thanks again
-
Hi Thank you so very much for your help on this. It does not actualy highlight the row that is causing the error. When Private Sub ICRCOMMJobEJF() runs it runs fine with out error. It is only when I hit a button in the till that the error is thrown. my callback function looks as follows Public Sub CALLBACK_FUNCTION(ByRef szJournalData As Byte(), ByRef sFromECR As Integer) Stop 'Code to show reading from till End Sub Thanks again
-
Hi I have managed to get a bit further with this. I have managed to pass in the function pointer but get the follwoing error Attempted to read or write protected memory. This is often an indication that other memory is corrupt. My code is as follows <DllImport("icrcomm.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _ Private Shared Sub ICR_COMMJob(ByVal TargetECR As Short, ByVal JobNo As Short, ByVal FileNumberList() As Short, ByVal FromRecord() As Short, ByVal ToRecord() As Short, ByVal TextData As mycallback) End Sub <UnmanagedFunctionPointer(CallingConvention.Cdecl)> _ Public Delegate Sub mycallback(ByRef szJournalData As Byte(), ByVal sFromECR As Integer) Private Sub ICRCOMMJobEJF() Dim ret As Short Dim FileList As Short() = New Short() {900, 0} Dim del As New mycallback(AddressOf CALLBACK_FUNCTION) ICR_COMMShow() ICR_COMMJob(101, 10, FileList, Nothing, Nothing, del) End Sub I presume I must be passing the function in wrong somehow. can somebody tell me how to pass in a callback from an unmanaged dll Thanks
-
Hi Hope somebody can help me. I am using a 3rd part unmanaged C++ DLL to be able to drag information from an epos system. most of the information I can pull over fine. The problem I have is trying to get the live Electronic Journal information. When I memeber of staff sells something it should automatically post back the information. This is the documentation that comes with the DLL short ICR_COMMJob( short TargetECR, short JobNo, short * FileNumberList, short * FromRecord, short * ToRecord, char * TextData) Parameters short TargetECR-Terminal to communicate with. 0 will cause it to use the terminal number as specified in the .ini file 2000 will communicate will all terminals. Communications will go through the terminal number specified in the .ini file. short JobNo-Job number to run. Short * FileNumberList-NULL terminated array of file numbers to be processed with the job numbers. short * FromRecord-NULL terminated array of from record numbers to be processed on the above file numbers. Must be the same length as the file number array. Can be NULL, in which case all from records will be zero. short * ToRecord-NULL terminated array of to record numbers to be processed on the above file numbers Must be the same length as the file number array. Can be NULL, in which case all to records will be ALL RECORDS. char * TextData-NULL terminated string, Text data to be sent, used with text message, modem init, modem dial etc Job 10, Journal Broadcast; Calling ICR_COMM with job 10 initiates journal broadcast, The address of a function must be passed using the TextData parameter. This function is then called each time journal data is received by ICR_COMM. Function prototype passed to ICR_COMMJob, must be; void JournalLineReceived(char szJournalData[48], short sFromECR); char szJournalData[48] Will contain a NULL terminated string of the data received. short sFromECR The terminal number of the machine that the data is received from. Job 10 can be called multiple times for multiple ECRs. I am trying to run Job 10 as follows <DllImport("icrcomm.dll", CharSet:=CharSet.Ansi, SetLastError:=True)> _ Private Shared Function ICR_COMMJob(ByVal TargetECR As Short, ByVal JobNo As Short, ByVal FileNumberList() As Short, ByVal FromRecord() As Short, ByVal ToRecord() As Short, ByVal TextData As Object) As Short End Function Public Delegate Function ejPassdata(ByVal szJournalData As String, ByVal sFromECR As Char) Private mydelegate As New ejPassdata(AddressOf JournalLineReceived) Private Sub ICRCOMMJobEJF() Dim ret As Short Dim FileList As Short() = New Short() {900, 0} ICR_COMMShow() ICR_COMMJob(101, 10, FileList, Nothing, Nothing, mydelegate) End Sub Public Function JournalLineReceived(ByVal szJournalData As String, ByVal sFromECR As Char) Stop Me.TextBox1.Text = Me.TextBox1.Text & sFromECR Me.TextBox1.Text = Me.TextBox1.Text & szJournalData Me.TextBox1.Refresh() End Function So when I click a button it calls ICRCOMMJobEJF() and send the command to the workstation to start posting back data to a text box. When I run the ICRCOMMJobEJF() everything seems to work ok except when the till is used and it trys to send data back I get a VSHost has stopped working. I presume I presume my code is wrong and is not pointing back to the correct Function. Any help would be appriciated
-
I have a combobox on a form and when the form loads the style is simple as I am just navigating through records. When I hit the add to add a new record I change the style to Dropdownlist which works fine so I can only select what is in the list. The problem comes when I want to edit a record, when I hit edit and the style changes to dropdownlist what information was there before disappears. If I change the style to dropdown the previous information stays but I can then type any information into the combox and not just select from the dropdown list.
-
Thanksfor your help that works fine.
-
I have the validating event on some of my text boxes on my windows form. When I press a search button my controls clear and some of them are enabled and some are not. The problem I have is that I can do a search on one or all of the textboxes but if I click in a textbox and then change my mind on what I want to search for the validating event kicks in and I can't get out of it until I entry something into it. Can I turn the validating event on and off when needed at run time
-
thanks for the replies. It is a windows app
-
This is going to be a very easy thing to do but I just cant seem to sort it. I have a form with peoples names and addrsses etc. I also have a datagrid which I would like to show information form another table. The tables are related as I can fill the datagrid with the parent table and I get the + sign which will show me the child fields But how do I just show the related child fileds?
-
I have a combobox bound to a dataset using databinding. When the form loads it popultes the rest of the text boxes with the relevant information from the first record. What I can't seem to find out what to do is when I change the record in the combobox the rest of the text boxes change to. Do I have to use the position of the record as the key to all this.
-
Hi The Machine is in a data center and I do have a admin login. Thanks for all your help on this matter.
-
Thanks Liqdfire I am using win2K and as far as I am aware I can't give a remote FTP site a drive letter.
-
Thanks for the reply Liqdfire This may sound like a silly question but I just cant figure it out. I have mapped the drive and it appears in my network neighbourhood but I cant seem to get it to see this drive
-
Hi I can use filesystemwatcher on a local directory and I know I can use it on a remote directory but I am unable to find out how to do this. I basicaly want to be able to watch an FTP sight for file uplaods.