VB - Large Binary Files - Call C DLLs & Pass The HANDLE

Jan 27, 2011

I have some functions written in C that read & write large binary files (> 4 GB) using routines CreateFile, ReadFile, WriteFile & SetFilePointer, that use the HANDLE data type to access the file. Some others who are more familiar with Visual Basic would would like to be able to call my C routines to work with such large binary files. We particularly need SetFilePointer to jump around with the files.

[Code]...

View 2 Replies


ADVERTISEMENT

Searching Large Binary Files And Data Carving

Mar 12, 2011

I am trying to develop an application that will let me do the following

1) Be able to search to large binary files for a specific byte array (header) and to continue searching for another byte array (footer). Then i want it to copy the section of the binary file between these 2 locations to a specified file. Then the program is to continue searching for any other header/footers An example would be search a large file and carving out the jpgs it finds etc. This routine would have to be able to handle raw images of 20gb or more if needed.

View 10 Replies

Call C# Dlls From Code Contained In A Word 2007 File?

Aug 17, 2009

I have some Visual Basic methods that are acting as the click handlers for a custom Word Ribbon. Unfortunately, I already have the implementation of what the handlers have to do written in C# which is loaded into the Word document as an XML Expansion Pack.

I don't see any way to add a reference to the C# .dlls to Word's Visual Basic Editor.

View 1 Replies

Handle A Very Large Database?

Mar 13, 2012

I'm faced with a (fun, actually) data mining problem; I have raw ASCII files from instruments, and I want to move that data (~100 GB) into a database, then be able to run various algorithms determining correlations of time series, etc. I would like to write the mining algorithms in Visual Basic (.net, VS 2010 right now), and be able to do visualizations with VB code I have in hand.On the nature of the data: think of a set of several thousand devices, each recording a measurement at a given interval - so I'm talking time-series vectors.

I spent today re-acquainting myself with VB.NET's interface to (in one case) a Microsoft Access database. What used to be fairly simple - DAO I think it was - involved tables, recordsets, etc (and that would likely be fine). Now I seem to be required to have a weird variety of generally useless objects, e.g. 'adapters', 'datasets', etc. The problem is that I know exactly what I need, and all this extraneous stuff just gets in the way (certainly in coding complexity and opaqueness, and likely in efficiency as well).If any of these mechanisms gave me a kind of virtual access to the entire dataset, and let me control caching parameters, etc.it might be great, but I found nothing along those lines.

Anyway, I tried a number of different approaches, and none seemed at all aimed at what I need to do: efficiently do math on a large dataset. I can't believe I'm the first to have this problem, but I can find no useful wisdom out there. I'd be comfortable with pretty much any underlying database mechanism: MySQL, SQL Server, MS Access, but ideally something generally SQL based (I may eventually have to transition this entire system to draw from a client's SQL database, though that's not an overriding concern now). Other than that I want simplicity and efficiency. I thought my old ODBC techniques would work, and to some extent they do, though modifying tables seemed to have bizarre problems (no errors, but not modifications either).

I do have a fairly aggressive deadline to show some algorithm results, so my focus in the short term is to get something reasonable working *in* the short term - in other words, it's less important to me to pick the 'fastest' relational database than it is to pick a database that lets me focus on coding the algorithms, not working through tedious data access coding. If this db could be any smaller, I'd have tried to do it all 'in memory' at least for proving concepts; I don't want to have to learn an entire jargon and approach just to be able to retrieve data points, and write out new info (e.g., first derivatives of time series).

Perhaps I'll need to bite the bullet and just write something myself, a .dll perhaps just to save and restore large time series vectors. It seems a bit frightening to me that one would have to do this in this age, what with all the database systems out there, but I don't have much time to work through arcane interface logic.

View 6 Replies

VS 2005 Appending Data To A Large 3GB Binary File?

Apr 29, 2010

How would I use the BinaryWriter to append binary data to a file that is very large? Say a file that is 3GB in size. The BinaryWriter's write method will only accept an integer for the index value. I've attached a screen shot of what I'm talking about. If I were to enter a value that exceeds the size of an integer on my 32bit Windows XP system, which I believe is 2147483647 it will reject it right?

View 4 Replies

Large Of A Number Can Convert.toint64 Handle?

Jun 21, 2010

I know this is probably a stupid question. I am converting a huge string to a integer, it is not working.....saying the number is too large to handle. It is only a 10k character string.I figured this would be fine because 2^16 power is 18446744073709551616.

View 5 Replies

Getting A Binary Search To Work (warning:large Amounts Of Text/code)?

Dec 25, 2009

Couldn't think of a better title.(Background on the problem/me)Okay, so, first question/post here, so hi. Now that that's done with, the information pertinent to my problem. I'm fairly new to VB (and programming as well, aside from screwing around with C++ and learning assembler(well, attempting is the better word) god knows how many years ago), and have only seriously been programming for about under half a year, and my skill level is about at that stage. Only been using VB.Net, nothing older. Depending on the time of day and if I'm home or at school, I fluxuate between VB express and Vis Studio 08. Umm, this program I'm having trouble with was on a test that I took yesterday (took the problem home with me cause I really wanted to figure out what was wrong with it).

The stipulations of the test were:
No For->Each Loops
No using Built-In Sorting or Searching Functions

[code].....

View 4 Replies

Referencing DLLS In The GAC And Policy Files?

Nov 11, 2010

I have a project/app released which references a dll from the GAC folder. The project is looking for version 1.0 of the referenced dll.

I want to release version 2 of the dll without having to re-release the app and have all users re-install.

I had thought if i deployed a policy with the new dll which redirected calls for the dll to the new version this would be ok. However I think I am missing something. IT seems the redirect is not working as when I test on a users machine, give them the version 2 dll and the policy dll but take away the version 1.0 the app fails. It seem calls to the missing dll are not redirected by the policy dll to version 2.

Policy config which is used to create the policy.1.1.CorpReportsClassLibrary.dll
is as below.


<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

[Code]....

View 3 Replies

File I/O And Registry :: AVI Header - Program To Download And Play AVI Files The Files Are Large In Size And Long Time Wise

Dec 11, 2011

I wrote a program to download and play AVI files the files are large in size and long time wise. I have the files playing as they are being downloaded but i can't see how long the file is or seek reliably. i was reading that the AVI headers are in the last 512kb of the AVI file *why would't they put it at the start* lol so my question is is there a way to download the last 512Kb of the file i'm downloading. i have the Bytes Read and Length of the file while its downlaoding i'm just not sure where to go from there, or how to do it atleast. If i had the length in time of the Avi file i could set the trackbar to be able to seek properly. or if someone has an idea how i could get the time of the video by using fps and some math i could prob do it that way too but idk how i would tell how i can find how many kb are in the fps i'm sure it changes so think that way is't going to be reliable. how to get the last 512kb would be the best option not sure if it can be done even.

View 4 Replies

DLL Import - DLLs Were Re-compiled As 64-bit DLLs And They Still Don't Work?

Apr 6, 2010

I am trying to understand how to interact with external DLLs written in C++ for use in my VB.NET application. I have some DLLs that a client wrote that do some math functions. Everything was working on a 32-bit machine. Because we were taxing the 32-bit machine we moved to 64-bit. Now we can't get the same functions to work. The DLLs were re-compiled as 64-bit DLLs and they still don't work. So my client wrote some dummy DLLs to see if we could figure out the problem. Here are the "signatures" of the DLL calls that I am making:[code]....Ultimately I would like to get to calling initialize_quiet and I am guessing at the format of the marshalling, const size etc.

View 3 Replies

Pure Text Files / Handle Special (german) Characters In .net Vs VB6 Old Files?

Jul 17, 2009

i have an old VB6 system that generates plain text files. When this old system writes "A" into the file, it writes (hex) "41". For an "ä" (a-umlaut, special gernam character), it writes (hex) "E4".

Now i have to process files like this in VB.Net. when i open such a file in the IDE, it displays correctly "ä" (But not always!). To see what i mean, please open a notepad and create a new file "ae.txt" with content: äöü. Now your file contains exactly 3 bytes: (hex) E4 F6 FC.

But when i write code like
Dim strTest As String
strTest = File.ReadAllText("ae.txt")
Debug.Print(InStr(strTest, "ä"))

i get 0 - so i cannot find back the "ä" - what do i need to do, to find it? And 2) for compatibility reasons, i have also to be able to create such files. How to do that? Seems the different encoding types do not work as i think.

View 2 Replies

Use Form Handle In Class Without Pass It As Argument?

May 3, 2012

I'm writting a class that needs the form handle but there is a way to use it without send it as argument in the class constructor or in a property?I know that the handler is not set until the form is completely loaded so that is another problem too.The basic idea is catch the form handle without pass it as argument and handle the wm messages.

View 2 Replies

Keep Each Module Separate And Call EXE's Or Should Create One Large Project?

Dec 15, 2009

The company I work for has a VB6 project that is using an ACCESS database.The project consists of seperate modules such as Accounts Payable, Payroll, General Ledger, and Inventory.At the current time each module is a seperate project in VB6 and the EXE files are called when needed.In total there are about 1300 forms in the project.We are moving from ACCESS to Sql Server and from VB6 to VB2008.The question that I (we) have is as follows; Should we continue to keep each module seperate and call the EXE's or should we create one large project?What are the pros and cons for each way?Is there something written that explains the advantages of either?

View 5 Replies

Pass A Handle In A .NET Form To C For It To Draw On/get Click Events?

Jul 20, 2009

I am trying to put a new face on an old C program. The C program is, of course, unmanaged code, designed smartly to separate the number crunching and the interface, and the interface I'm trying to replace is X windowing. The graphics part is where it gets a little hairy, because the C is going to need to continue to draw in my new interface, based on the data the program produces. Even if I want to duplicate that data in .NET so that the .NET side can handle all of the drawing, the fact remains I'm going to need to operate on the graphics window in some fashion from C.

I gather that handles have a lot to do with the bare Win32 graphic operations. Is such a similar handle provided to, say, a PictureBox element in .NET? And if so, is it the kind of handle I can use in the unmanaged code without an issue?

I have tried and tried and tried to google for the solution for weeks now, and all I come up with are either C++ solutions (using object-oriented GDI+) or some sort of extension to the C language.

Alternatively, is there a way I can have .NET create a handle specifically for this purpose of having C draw it?

To sum it up, I am using Visual Basic .NET 2008 and a C DLL (also compiled in VS2008), so far in the little testing I've done, I've been able to marshal complex structures to and fro, but I am not sure how exactly I'd let C do any drawing on the .NET form, if that was even possible.

View 2 Replies

HTTP 404 Not Found Error On Web Service Call, Only With Large Amount Of Data

Sep 2, 2011

I have a vb.net Windows application that calls a vb.net Web Service function. Both the vb.net application and Web Service have been in use for over 5 years and have worked well. The Windows App builds a text file consisting of a number of inserts into an Oracle table, followed by a call to an Oracle package. The Web Service call uploads the text file to the Web Server, loops through the statements in the text files and executes them. It then does a Select statement to put the resultant data in a string which is passed back to the calling program. We have both people on our local area network as well as external users where the call to the Web Server is over the internet.

The data string returned is the pricing for each of the lines inserted in the text file, separated by asterisks. Normal use of this call has anywhere from 1 to a few dozen lines, and the program works fine for this for both internal and external users.

Our problem right now is one external person is attempting to price a job with 491 individual line items. At first it would not price, whether the job was priced from a computer at the customers site or one of our internal people on the LAN. The problem turned out to be the timeout value was not long enough (it was set at 2 minutes, this job takes 5 minutes) so changing both the Timeout value in the Web Service call as well the httpRuntime executionTimeout value in the web.config file on the web server addressed the problem, but only for our internal users on the LAN. Our external customer wants to be able to price jobs of this size going forward, and I am at a loss as to why it errors on internet connected machines but not locally connected machines. Our customer is in New York, We are in Wisconsin, and I am able to recreate the error condition from my home computer.

The other thing is, if I create a VPN connection to our server from my computer at home, this job will price (again, it takes about 5 minutes) but if I disconnect the VPN connection, it gets an error after approximately 3 minutes, http 404: Not Found.The customer can otherwise price all of his other jobs with no problems, it's only this one, very large job that gets the error.

View 4 Replies

VS 2008 Call Procedure To Handle All Control.click Events?

Jul 27, 2009

I am trying to make a routine that will be called everytime the mouse button is clicked. I want it to be called so that the controls event that the mouse is clicked on is triggered.

For example:

You have a button control on your form. Instead of having the Button1_click event

You have a Control_click event. And that Control_Click event will be used for each control on the form.

View 11 Replies

Call A Method And Pass In An Object?

Apr 21, 2012

I have a method called ADD in a class that connects to a database. The database class name is XDB. I also have an object named XXX in it's own separate class with properties.One of the instructions for the Button named ADD click event is:

'Call Add method passing in the XXX object

So this is how I coded:

'declare a variable X as an object instance of XXX
Dim X As New XXX[code].....

I know it's wrong since it doesn't add the XXX and the form doesn't close but I don't know what I'm doing wrong.

View 6 Replies

How To Pass Arguments In A Thread Call In VB

Feb 21, 2010

Im trying to call a procedure to run into a thread..But this procedure requires two arguments. How can I pass these arguments in to the function when the thread call:

Dim myThread As New Threading.Thread(New Threading.ThreadStart(AddressOf PopulateTermList myThread.Start()

addressof PopulateTermList should only be called without parenthesis(the VB tells me this)

View 5 Replies

How To Call Sub And Pass Thread On Button Click

May 30, 2011

I have a 3 functions that should be called in order, that I want to do this in a thread say about 20 for each argument I pass. So for example

sub process_work(arg)
result1= function1( arg )
result2= function2(result1 )
result3= function3( result2 )
listview.items.add( result3 )
end sub

How do I call this sub and pass to thread on button click. Is it possible to spawn new thread it I pass argument to this sub and the current or last one is busy?

View 11 Replies

Pass The Type(t) When Call ToGenericType Method

May 27, 2010

I have the following generic method : Namespace Helpers

[Code]...

I would like to use type interference so that when i call ToGenericType method, I would not need to pass the type(t) This is how i call ToGenericType now.......

[Code]...

View 2 Replies

Copying Large Files Over LAN?

Jan 29, 2009

How do you recommend I copy large files over the LAN (>20GB)Currently I am using File.Copy.Another question I have is how can I implement this class to be self contained, meaning that it would report progress to the object that called it? or do I have to define a delegate in the calling object?

Code:
Public Class cCopier
Private Delegate Function CopyProgressRoutine(ByVal totalFileSize As Int64, ByVal totalBytesTransferred As Int64, ByVal streamSize As Int64, ByVal streamBytesTransferred As Int64, ByVal dwStreamNumber As Int32, ByVal dwCallbackReason As Int32, ByVal hSourceFile As Int32, ByVal hDestinationFile As Int32, ByVal lpData As Int32) As Int32

[code].....

View 1 Replies

FtpWebRequest And Large Files?

Jul 24, 2010

The underlying connection was closed: An unexpected error occurred on a receive.If I look on te FTP server I can see that the file has been uploaded entirely which led me to believe that the control channel was timing out. I have tried modifying the timeout on the FTP server as well as the ReadWriteTimeout in my code to no avail.Here is my code...

Dim ftprequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(destination), System.Net.FtpWebRequest)
ftprequest.Credentials = New System.Net.NetworkCredential(username, password)
[code].....

View 1 Replies

How To Open Large PDF Files

May 13, 2009

I am opening a large PDF file using the following
Process.Start(Application.StartupPath & "PREVI.pdf")

I have two questions:
1) Is there a way to go directly to a page number?
2) Can I write a code to have the table of contents show up on the left side of the document so users can click on to go to different sections of the document, not sure if this needs to be done while creating the PDF or if we can do it by code.

View 4 Replies

Large Files Are Not Uploaded

Dec 20, 2011

If you were to upload a project to any site but are concerned about the large file size, what are the only files you need to zip up for your project to work for either VB 2008 or VB 2010? So far I know you don't need the exe's, the pdbs, and xml files.

View 5 Replies

Reading Large Csv Files

Sep 17, 2010

Which is the most performant way to read a large csv file in .NET? Using FileStream? or another class

View 4 Replies

Splitting Large Files With .NET?

Apr 27, 2012

Does anyone know what the best way to split up large files in VB.NET? These files can be in excess of 10GB. I have found ways of doing it by googling all day! most of the solutions I have found almost work. But what I really want to know is what is the most efficient way to do this?

View 1 Replies

Uploading Large Files Using FTP?

Mar 12, 2012

I have trying to upload some large files using FTP. Here is the code I am using below.

Private Sub UploadFTP()
' Open file.txt with the Using statement.
Using r As StreamReader = New StreamReader("list.txt")[code]....

I basically loop the above to upload all the files in a specific directory. This works fine with small text files,but when I try uploading a large 30+- mb file it gives me an error.

Quote: The underlying connection was closed: An unexpected error occurred on a receive.

On

cls_stream.Close()

I understand this is caused by .Net not communicating with the server properly? I tried searching all morning to only get confused by all the different methods.

View 6 Replies

Binary Files And Backgrounworker?

Nov 27, 2009

I used backgroundworker to receive file segments from a server, it taking the segments and save them directly to a binary file. the problem is,I using a global variable to store the "FreeFile()" number.when "backgroundworker" receive "START" it do F = FreeFile()

when it receive "Segment", it should append to that file, but the problem is ... backgroundworker no more recognize the file (which its identifier saved in global variable F) and telling "Bad File"?!

whats the soultion?I think about opening the file and close it each time (not leave the connection to the file available). But I didn't figure out how to append to Binary files, It always replace their contents. and If I use "Append" option it corrupt the file!

View 10 Replies

How To Read Binary Files

Jan 10, 2010

i tried out this [code]i can create and write in the .bin file but how to read it then?

View 20 Replies

Merge Two PDF / Binary Files?

Oct 19, 2010

For some reason the last PDF file to be written to the "final document" is the only PDF File that is visible when the "final document" is open. However, all of the bytes are accounted for in the file size...so for example: file1 = 60 bytes and file2 = 49 bytes. The final document has 109 bytes but only contains file2 when viewed in the pdf viewer.

[code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved