|
lukaszo44 wrote: The user has a tablet there he could insert his code by buttons.
..and using the clipboard (copy/paste) and probably by entering the ASCII value while holding the alt-key.
Why, isn't the code you posted working?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
sounds like you are using a scanner which emulates a keyboard.
Basically, when you scan a barcode, it generates the characters in the keyboard buffer area so that the application doesn't realize that the data is coming from a scanner versus coming from the scanner.
The problem with this type of scanner is that you have to have the focus set on the proper input box to capture the data.
What you want is a scanner which writes the data to the serial (USB) port and have your application be responsible for capturing the data. Using this method, there is no way for the operator to enter values into the system from the keyboard or copy/paste buffer.
Good luck.
|
|
|
|
|
Hello,
what is the exact conversion of c# code to vb6.0 code
for these two lines:
FileInfo file = new FileInfo(Server.MapPath(FileUpload1.FileName));
Int64 numofbyte = file.Length
FileStream fs = new FileStream(Server.MapPath(FileUpload1.FileName), FileMode.Open);
BinaryReader br = new BinaryReader(fs);
byte[] DataFile = br.ReadBytes(Convert.ToInt32(numofbyte));
Are there any converters for converting my c# code to vb 6.0 code ?
Thanks,
|
|
|
|
|
Karthik Reddy wrote: Are there any converters for converting my c# code to vb 6.0 code ?
No. That would be blasphemy.
Karthik Reddy wrote: Server.MapPath
VB6 is not a web-technology. You'd have to write a custom method to replace this.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Karthik Reddy wrote: Are there any converters for converting my c# code to vb 6.0 code ?
Why on Earth would anyone write a converter to convert modern code back to something used in the Stone Age??
No, there's no such thing.
|
|
|
|
|
Hello,
I am trying to write a VBscript that allows me to search the file names of every file in a folder and rename them accordingly. For example, I'd like to find all files that begin with RX345678 and replace that name with Bob & MMDD & counter & .txt The counter will allow for the multiple factor. I already have the code for the date, but, it's pulled from an old script and it's been forever since I wrote in VB so my naming is poor.
This is also in Visual Studio 2005 (yeah, I know! )
Thanks for any advice!
|
|
|
|
|
Where is the code you already have, and where are you stuck? Should the serial-number reset after each date, or would you be satisfied with a single range?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Sub FormatDate
'Set datepart("yyyy",date()-1) & datepart("m",date()-1) & datepart("d",date()-1)
If len(datepart("m"))=1 Then
monthstr = "0" & datepart("m")
Else
monthstr = datepart("m")
End If
If len(datepart("d")=1 Then
daystr = "0" & datepart("d")
Else
daystr = datepart("d")
End If
objDatestr = datepart("yyyy") & monthstr & daystr
End Sub
Is the current date code. I'm stuck on the proper language to use in order to read the file name and rename it. What I am thinking I would like to have is a routine for each name that could occur. Max = 9. I don't know the number of files per name, so, that's why I was going to add the counter. In each routine, it would search for a specific name and turn that into what I expressed before. I know I sound stupid, but, I know how to code and I know what I want but, this got dumped into my lap and we have no resources here to assist me.
The counter will be set to 0 before each routine. (in my version).
Thanks for anything that points me in the right direction!
|
|
|
|
|
I suggest you start with a routine that lists all the files, and sorts them. Loop through them after that, reset your counter when the date changes.
Most code you'll need can be found here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the suggestion and the link. I checked it out but, not really sure I'm searching on the right things. Oh well, guess it's off to the book store for some blurry-eyed late nights.!
|
|
|
|
|
Hello,
I've developed a .net dll and made it com Visible and also i've added register for com interoperability.
I need this COM object in visual basic 6.0.
It works fine, when i build the .net component. It generates a .tlb file and i could get my result as expected.
But when i executed this on the other machine it shows error.
i've copied my dll to the other machine and generated a .tlb file by using 'regasm'.
I can see the tlb file in references of my Visual Basic 6, but it is giving error that "Could not load file or assembly 'thirdpartydll' or one of its dependencies".
i've tried by registering with GAC but could not solve my problem .
please help me !
Thanks,
|
|
|
|
|
Did you reference any other libraries in your control?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i did not add any library references in vb6.
|
|
|
|
|
Karthik Reddy wrote: I've developed a .net dll and made it com Visible
Which assemblies does your .net dll reference?
--edit;
Rephrased
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
modified 21-Aug-12 6:49am.
|
|
|
|
|
No. He meant did you have to add a reference to anything in your VB.NET code that you wrote this COM component in?
|
|
|
|
|
I did not add the references in vb6 application.
but my component has references in it.
do i need to add those references which are in my component ?
|
|
|
|
|
Karthik Reddy wrote: do i need to add those references which are in my component ?
You do indeed. Anything used by your dotNet component must exist in any environment that you deploy the component to. Dependencies are not going to be compiled into your assemblies.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Not quite. Any unresolved references in the VB.NET COM component will NOT be resolved by adding a reference in the VB6 project using the component.
He's still stuck on adding references to his VB6 code to fix this, which we all know won't work.
|
|
|
|
|
Sorry. Maybe I wasn't clear enough. If the assemblies required by the COM-Interop assembly are available in either the install directory of the component that requires it or in the GAC, then his reference of the COM component through VB6 should work. I'm working from memory here as I haven't done anything like this in a couple of years.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Oh, no, you were clear. I'm just saying if the assemblies were present, he wouldn't be have the problem in the first place and hence wouldn't need to add references to them in his VB6 project.
|
|
|
|
|
Understood. I reread your response and that was clear. I just must have read it too quickly. Cheers.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
That's probably why it's claiming that one of the dependencies cannot be found; your component references something that's not available (or registered!) on the target-machine.
VB6 isn't interested in what your component uses; but the things that the component uses "should" be available on the target-machine. The .NET runtime will then load them for you.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you Eddy and Marcus Kramer..
Some how i got the result not upto the mark though.
|
|
|
|
|
Again, we're not talking about your VB6 code at all. All we're interested in is the VB.NET code you wrote to write this component.
If you added references in your VB.NET project to other libraries, you MUST copy those libraries over to the target machine at install time for your component. If your component code is using something in a library, how is the code going to work if the item referenced is not on the machine?? It'll throw the very error you're getting, specifically, the part about "or one of its dependencies".
You do NOT need to add any references in your VB6 code, other than the one to your COM component. Those references won't work for your component anyway. You DO need to make sure that everything your component uses is installed on the target machine.
|
|
|
|
|
Let's put things in other words, maybe you'll understand then.
You created a dll in .Net for COM interop, let's give it a name here: MyCOM.dll.
When you created MyCOM.dll, you referenced ThirdParty.dll. That means, MyCOM.dll depends on ThirdParty.dll to be available.
On your machine - where you developed MyCOM.dll - ThirdParty.dll is available.
But on the other machine, it is not.
How to solve: copy ThirdParty.dll into the same directory as MyCOM.dll.
|
|
|
|