Click here to Skip to main content
15,891,761 members
Home / Discussions / C#
   

C#

 
AnswerThanx Pin
MeLight5-Sep-07 8:57
MeLight5-Sep-07 8:57 
AnswerRe: Workaround global variables? Pin
Dave Kreskowiak5-Sep-07 9:08
mveDave Kreskowiak5-Sep-07 9:08 
Questionsizeof Pin
dino20945-Sep-07 8:26
dino20945-Sep-07 8:26 
AnswerRe: sizeof Pin
TJoe5-Sep-07 8:50
TJoe5-Sep-07 8:50 
GeneralRe: sizeof Pin
Luc Pattyn5-Sep-07 10:02
sitebuilderLuc Pattyn5-Sep-07 10:02 
GeneralRe: sizeof Pin
TJoe5-Sep-07 10:19
TJoe5-Sep-07 10:19 
GeneralRe: sizeof Pin
dino20945-Sep-07 11:54
dino20945-Sep-07 11:54 
QuestionProblem passing data to an activeX Pin
Paolo Vernazza5-Sep-07 6:55
Paolo Vernazza5-Sep-07 6:55 
I'm using in a project an activeX component with these 3 methods:
<br />
public void PutData(ref int pData, int nBytes);<br />
public int GetDataSize();<br />
public void GetData(ref int pData);<br />

The same functions, in a c++ project are:
<br />
void PutData(long* pData, long nBytes);<br />
long GetDataSize();<br />
void GetData(long* pData);<br />


With the first function I pass a buffer to the component and the component copies it in its own buffer.
With the third function I pass a buffer to the component and the component copies in my buffer the data that it previously stored in its own buffer.

I can't get the component work properly, because it seems to copy only the first 4 bytes (= the first integer).

I tried the component in a c++ project and it works properly, so I think that the problem is in the way I'm passing the data to the activex.

I use the functions in this way:
<br />
int[] buffer = new int[10];<br />
int[] buffer_check = new int[10];<br />
<br />
for (int i=0; i<10; i++)<br />
    buffer[i] = i;<br />
<br />
ocx.PutData(ref buffer[0], 10*sizeof(int));<br />
<br />
//That's works OK<br />
System.Diagnostics.Debug.Assert(ocx.GetDataSize() == 10*sizeof(int));<br />
<br />
ocx.GetData(ref buffer_check[0], 10*sizeof(int)); <br />
<br />
//This fails for any i != 0<br />
for (i=0; i<10; i++)<br />
      System.Diagnostics.Debug.Assert(buffer_check[i] == buffer[i]);<br />


Someone has any idea about what I'm doing wrong?
Thanks!

Paolo
AnswerRe: Problem passing data to an activeX Pin
TJoe5-Sep-07 8:23
TJoe5-Sep-07 8:23 
GeneralRe: Problem passing data to an activeX Pin
Paolo Vernazza6-Sep-07 1:57
Paolo Vernazza6-Sep-07 1:57 
GeneralRe: Problem passing data to an activeX Pin
TJoe6-Sep-07 2:13
TJoe6-Sep-07 2:13 
GeneralRe: Problem passing data to an activeX Pin
Paolo Vernazza6-Sep-07 4:33
Paolo Vernazza6-Sep-07 4:33 
GeneralRe: Problem passing data to an activeX Pin
TJoe6-Sep-07 5:08
TJoe6-Sep-07 5:08 
QuestionHow to limit maximum size of other windows? Pin
Trickster-SWE5-Sep-07 6:33
Trickster-SWE5-Sep-07 6:33 
AnswerRe: How to limit maximum size of other windows? Pin
TJoe5-Sep-07 8:06
TJoe5-Sep-07 8:06 
GeneralRe: How to limit maximum size of other windows? Pin
Trickster-SWE5-Sep-07 22:33
Trickster-SWE5-Sep-07 22:33 
QuestionRegex replace question Pin
Vodstok5-Sep-07 6:13
Vodstok5-Sep-07 6:13 
AnswerRe: Regex replace question Pin
TJoe5-Sep-07 8:00
TJoe5-Sep-07 8:00 
Questionrow doesn't get deleted Pin
gericooper5-Sep-07 5:27
gericooper5-Sep-07 5:27 
QuestionVisual Studio Menu Layout Pin
DanB19835-Sep-07 5:13
DanB19835-Sep-07 5:13 
AnswerRe: Visual Studio Menu Layout Pin
martin_hughes5-Sep-07 5:54
martin_hughes5-Sep-07 5:54 
QuestionForm problem Pin
sajid.salim.khan5-Sep-07 4:52
sajid.salim.khan5-Sep-07 4:52 
AnswerRe: Form problem Pin
Christian Graus5-Sep-07 5:07
protectorChristian Graus5-Sep-07 5:07 
GeneralRe: Form problem Pin
sajid.salim.khan5-Sep-07 5:53
sajid.salim.khan5-Sep-07 5:53 
GeneralRe: Form problem Pin
Christian Graus5-Sep-07 8:26
protectorChristian Graus5-Sep-07 8:26 

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.