Can some explain plz. Basic uses a C++ wrapper.

I

Intermouse

I have recently purchased an aspi wrapper control for vb.

I haven't had much experience with hex and memory addresses and that's my
problem.

The piece of code that baffles me is:

With ASPI1
.HostAdapter = 0
.SCSIID = 4
.CDBSize = 10 'LINE 1
.CDB = Chr$(&H5A) & Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) &
Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) 'LINE 2
.Execute

End With

Print "SENSE BUFFER: " & ASPI1.SenseBuffer

The first line sends a command of 10 bytes I know. What is CHR$ doing. I
know that it returns the ascii char for the character, but how does that fit
in with the command descriptor block. How does the translation work.

The second line specifies the length of the command that is going to be
sent. I know that.

Anyhow i have pasted the scsi2 spec for a 10 byte command here:

http://www.intermouse.net/aspimodeselect10.htm
for reference.

So,

I need to figure out how to translate the scsi2 commands into the wrapper
function. Line 1.

If anyone knows what I am rambling about, I would very much appreciate some
help.

Mucho thanko.

Mark
 
T

Thomas Matthews

Intermouse said:
The ocx was written in C++.

1. Don't top-post.
2. Don't forget to post to an assembly group because part
of the Windows operating system was written in assembly.
3. Just to be safe, you may want to also post to the Pascal
and C newsgroups just to cover all bases.

When you have an issue involving the syntax or semantics
of a language, post to a language newsgroup. When you
have issues with an operating system or platform, post
to a platform specific newsgroup.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
R

Randy Birch

While you may not care for top-posting, others such as myself find it much
easier to read.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.


message : Intermouse wrote:
: > The ocx was written in C++.
: >
: > : >
: >>Your question hasn't anything to do with C, as far as I see...
:
: 1. Don't top-post.
: 2. Don't forget to post to an assembly group because part
: of the Windows operating system was written in assembly.
: 3. Just to be safe, you may want to also post to the Pascal
: and C newsgroups just to cover all bases.
:
: When you have an issue involving the syntax or semantics
: of a language, post to a language newsgroup. When you
: have issues with an operating system or platform, post
: to a platform specific newsgroup.
:
:
: --
: Thomas Matthews
:
: C++ newsgroup welcome message:
: http://www.slack.net/~shiva/welcome.txt
: C++ Faq: http://www.parashift.com/c++-faq-lite
: C Faq: http://www.eskimo.com/~scs/c-faq/top.html
: alt.comp.lang.learn.c-c++ faq:
: http://www.raos.demon.uk/acllc-c++/faq.html
: Other sites:
: http://www.josuttis.com -- C++ STL Library book
:
 
R

Rick Rothstein

I know this is a repeat, but... > > > Your question hasn't
personally, I like to "side post"; > > > anything to do with C,
that way, those reading the thread > > > as far as I see...
can read my answer and follow > >
along with the original text. Of > > 1. Don't top-post.
course, this takes a little more >
arranging the original thread; but, > While you may not care for
as you can see, it makes for a > top-posting, others such as
much better reading experience. > myself find it much easier to
<g> > read

Rick
 
I

Intermouse

Wow.

It seems that some people spend their time replying to posts just to tell
others that they posted the message wrong or in the wrong place. Are we all
message group mediators, or are we really trying to help each other?

Top post, side post, over the post, who cares as long as the message reaches
the far corners of the earth and hopefully gets some REAL answers.

Thanks for all of your much appreciated......err.........postings!!!

Mark
 
K

Karl Heinz Buchegger

Intermouse said:
Wow.

It seems that some people spend their time replying to posts just to tell
others that they posted the message wrong or in the wrong place. Are we all
message group mediators, or are we really trying to help each other?

As for comp.lang.c++:
You are free to leave if the rules of the group are unacceptable to you.
 
N

Norm Cook

Concur. I hate having to scroll to the bottom of every message to see what may or may not be some profound response.
 
R

Richard Herring

Concur. I hate having to scroll to the bottom of every message to see
what may or may not be some profound response.

Then _trim_ the junk. Just keep enough to maintain sequence and context.

See?
 
D

Default User

Randy said:
While you may not care for top-posting, others such as myself find it much
easier to read.


See what happens when stuff is cross-posted to a BASIC newsgroup?
Nothing good.



<thread plonk>


Brian Rodenborn
 
R

Randy Birch

<LOL>

--

Randy

: : > While you may not care for top-posting, others such as myself find it
much
: > easier to read.
:
: So what?! Who the **** are YOU, asshole?!
:
:
 
S

Steve Gerrard

R | I know this is a repeat, but... > > > Your question hasn't
O | personally, I like to "side post"; > > > anything to do with
C,
F | that way, those reading the thread > > > as far as I see...
L | can read my answer and follow > >
M | along with the original text. Of > > 1. Don't top-post.
A | course, this takes a little more >
O | arranging the original thread; but, > While you may not care for
| as you can see, it makes for a > top-posting, others such
as
| much better reading experience. > myself find it much easier
to
| <g> > read
|
| Rick
 
F

Frank Adam

R | I know this is a repeat, but... > > > Your question hasn't
O | personally, I like to "side post"; > > > anything to do with
C,
F | that way, those reading the thread > > > as far as I see...
L | can read my answer and follow > >
M | along with the original text. Of > > 1. Don't top-post.
A | course, this takes a little more >
O | arranging the original thread; but, > While you may not care for
| as you can see, it makes for a > top-posting, others such
as
| much better reading experience. > myself find it much easier
to
| <g> > read
|
| Rick
Bloody left posters...

As for the OP's question and hopefully to end this silly thread.

With ASPI1
.HostAdapter = 0
.SCSIID = 4
.CDBSize = 10 'LINE 1
.CDB = Chr$(&H5A) & Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) &
Chr$(0) &
Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) 'LINE 2
.Execute

ASPI1 is a class, object whatever..
That first line simply sets the number of characters that it will
send, just as the previous lines set the adapter number and the ID to
send it to/with.
Chr$() gives you an ASCII character, .CDB = chr$(x) & chr$(x) and so
on, simply builds a byte array or string(call it what you like) with
the characters added on one by one.
So if you send chr$(65) & chr$(66) & chr$(67), then your output would
be "ABC". Which would be identical if you had done .CBD = "ABC".

Clear ?

<followup set to CLBVM>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top