Solved

C# code

Posted on 2010-09-08
3
316 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now