Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
AnswerRe: Passing an object through different window classes in Windows Forms Pin
Pete O'Hanlon11-Jul-12 1:02
mvePete O'Hanlon11-Jul-12 1:02 
GeneralRe: Passing an object through different window classes in Windows Forms Pin
nstk11-Jul-12 3:47
nstk11-Jul-12 3:47 
GeneralRe: Passing an object through different window classes in Windows Forms Pin
DaveyM6911-Jul-12 4:02
professionalDaveyM6911-Jul-12 4:02 
GeneralRe: Passing an object through different window classes in Windows Forms Pin
nstk12-Jul-12 1:36
nstk12-Jul-12 1:36 
GeneralRe: Passing an object through different window classes in Windows Forms Pin
nstk12-Jul-12 1:44
nstk12-Jul-12 1:44 
AnswerRe: Passing an object through different window classes in Windows Forms Pin
BobJanova11-Jul-12 2:41
BobJanova11-Jul-12 2:41 
GeneralRe: Passing an object through different window classes in Windows Forms Pin
nstk14-Jul-12 7:40
nstk14-Jul-12 7:40 
QuestionData to and from object? Pin
Ronnie_B11-Jul-12 0:55
Ronnie_B11-Jul-12 0:55 
Hi. I'm new to C# so sorry if my questions will be little simple or not so clear.

I have a DLL that I I'm using as a COM reference in my project.

In the DLL there is a method I'd like to use:

STDMETHOD(CS7ProSim::ReadOutputImage)( long StartIndex,
long ElementsToRead,
ImageDataTypeConstants DataType,
VARIANT* pData)

My problem is the "VARIANT* pData" and how to access the returned data in it. The result I want from the method is a byte array[1024].


I declared this variable
public partial class Form1 : Form
{
byte [] QB = new byte[1024]; //Define the data area


Then I'm using this code...

//Set up variables
Object pData = QB;
//Setup of method datatype
ImageDataTypeConstants pdtConst;
pdtConst = ImageDataTypeConstants.S7Byte; //Read in byte form
//Read from-to
int StartByte = 0; //Start on byte 0
int ReadSize = 1024; //Read 1024 bytes

//Call the method
ps.ReadOutputImage(StartByte, ReadSize, pdtConst, ref pData); //Read the whole image of 1024 bytes

The method will return the correct data in the pData array. But I don't want to have it in a object but in an array.

My questions are...
-Do I really have to create the new pData object or can I somehow use the QB directly in the method call?

-If I use pData as I do now, how can I copy the values in pData back to QB?

If I "hover" above the "pData" I can see it's a array like QB and it has the values from the method, but how to get those values back to QB?

Thanks.
QuestionShared memory Applicaion <->Service Pin
Sebastian_G11-Jul-12 0:07
Sebastian_G11-Jul-12 0:07 
QuestionCan I Apply Autocomplete to the master page in asp.net Pin
Nitin_Kadam10-Jul-12 22:50
Nitin_Kadam10-Jul-12 22:50 
AnswerRe: Can I Apply Autocomplete to the master page in asp.net Pin
DaveyM6911-Jul-12 0:03
professionalDaveyM6911-Jul-12 0:03 
QuestionUsing Dotnet Login code in HTML doc Pin
ASPnoob10-Jul-12 21:35
ASPnoob10-Jul-12 21:35 
AnswerRe: Using Dotnet Login code in HTML doc Pin
AmitGajjar10-Jul-12 22:08
professionalAmitGajjar10-Jul-12 22:08 
AnswerRe: Using Dotnet Login code in HTML doc Pin
BobJanova11-Jul-12 2:06
BobJanova11-Jul-12 2:06 
GeneralRe: Using Dotnet Login code in HTML doc Pin
ASPnoob11-Jul-12 3:08
ASPnoob11-Jul-12 3:08 
GeneralRe: Using Dotnet Login code in HTML doc Pin
BobJanova11-Jul-12 4:36
BobJanova11-Jul-12 4:36 
QuestionDelete Excel File Pin
Member 916988710-Jul-12 21:08
Member 916988710-Jul-12 21:08 
AnswerRe: Delete Excel File Pin
Richard MacCutchan10-Jul-12 21:16
mveRichard MacCutchan10-Jul-12 21:16 
AnswerRe: Delete Excel File Pin
zhxhdean11-Jul-12 20:28
zhxhdean11-Jul-12 20:28 
QuestionUnderstanding Basics About Forms Pin
AmbiguousName10-Jul-12 19:59
AmbiguousName10-Jul-12 19:59 
AnswerRe: Understanding Basics About Forms Pin
Richard MacCutchan10-Jul-12 21:15
mveRichard MacCutchan10-Jul-12 21:15 
AnswerRe: Understanding Basics About Forms Pin
lukeer10-Jul-12 21:23
lukeer10-Jul-12 21:23 
GeneralRe: Understanding Basics About Forms Pin
DaveyM6910-Jul-12 23:55
professionalDaveyM6910-Jul-12 23:55 
GeneralRe: Understanding Basics About Forms Pin
AmbiguousName11-Jul-12 1:55
AmbiguousName11-Jul-12 1:55 
GeneralRe: Understanding Basics About Forms Pin
DaveyM6911-Jul-12 2:31
professionalDaveyM6911-Jul-12 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.