Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

System.AccessViolationException in VB2013

$
0
0

 Hi,

    I need to send specific amount of bits to a device and the Function requires that I provide the Bit Count and the Byte Count. Note that you can not always get exact match of the Bit Count to the Byte Count because Bytes are in 8-bits. So I used the following calculations as an example

NumberOfBits = 200

NumberOFBytes = NumberOfBits / 8 + 1 'Note this translates into 26 Bytes total

When I send these parameters to the function I get error "System.AccessViolationException" . This method worked fine in VB6 and and in Python. I reduced the byte count to be 25 and it still gave the same error. Howere if I reduce it to 24 the then the function is executed but get error back from the function saying "NUMBER_BYTES_TOO_SMALL". 

Any solutions ???


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>