Solved

C# code

Posted on 2010-09-08
3
328 Views
Last Modified: 2012-05-10
what does the following line mean and does:
fixed (byte * buffPointer = dataBuffer)                              hllapi(&function, buffPointer, &dataLength, &returnCode);
0
Comment
Question by:vivekj2004
3 Comments
 
LVL 25

Expert Comment

by:SStory
ID: 33626849
see this: http://blog.dmbcllc.com/2009/01/05/csharp-fixed-keyword/

It looks like you are declaring a function call to hllapi
I'm guess the first part is the return type...
fixed fixes pointers and such, so that they aren't moved around.
buffpointer is a variable-- a pointer to a byte and it is being pointed to dataBuffer

Is this all one line of code or two?
0
 
LVL 8

Accepted Solution

by:
Gururaj Badam earned 500 total points
ID: 33628797
hllapi(&function, buffPointer, &dataLength, &returnCode);

hllapi is a function which takes

Param 1 -> Pointer to a function
Param 2 -> Pointer to a buffer
Param 3 -> May return the length of the data filled in Param 2 post execution
Param 4 -> The state of execution of function
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 33634251
so its same as the below code where you are calling hllapi method
 
http://publib.boulder.ibm.com/infocenter/pcomhelp/v5r9/index.jsp?topic=/com.ibm.pcomm.doc/books/html/emulator_programming07.htm
 
EHLLAPI Call Format
The EHLLAPI entry point (hllapi) is always called with the following four parameters: EHLLAPI Function Number (input) Data Buffer (input/output) Buffer Length (input/output) Position (input); Return Code (output)

The prototype for IBM Standard EHLLAPI is: [long hllapi (LPWORD, LPSTR, LPWORD, LPWORD);
The prototype for IBM Enhanced EHLLAPI is: [long hllapi (LPINT, LPSTR, LPINT, LPINT);
Each parameter is passed by reference not by value. Thus each parameter to the function call must be a pointer to the value, not the value itself

fixed (byte * buffPointer = dataBuffer) 

{

 hllapi(&function, buffPointer, &dataLength, &returnCode); 

}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now