Click here to Skip to main content
15,886,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Closing the current form Pin
Zaegra1-May-07 20:42
Zaegra1-May-07 20:42 
AnswerRe: Closing the current form Pin
Rupesh Kumar Swami1-May-07 21:28
Rupesh Kumar Swami1-May-07 21:28 
QuestionNeed help building a TreeView Pin
ljohns1-May-07 16:45
ljohns1-May-07 16:45 
AnswerRe: Need help building a TreeView Pin
ljohns1-May-07 16:47
ljohns1-May-07 16:47 
GeneralRe: Need help building a TreeView Pin
ChandraRam1-May-07 23:06
ChandraRam1-May-07 23:06 
GeneralRe: Need help building a TreeView Pin
ljohns3-May-07 4:01
ljohns3-May-07 4:01 
GeneralRe: Need help building a TreeView Pin
ChandraRam4-May-07 0:12
ChandraRam4-May-07 0:12 
QuestionHow do I pass a byte array from C++ to VB.NET? Pin
prcarp1-May-07 15:28
prcarp1-May-07 15:28 
I have a VB.NET 2005 application that makes calls to a VC++ (VC6) DLL and I have that part working fine. The C++ DLL makes use of callback functions to let the VB app know of unsolicited events and that works as well (the functions are at least being called). The problem is I don't know the proper parameters to use (either the C++ or VB side) to get a byte array from C++ back to VB.

I have tried the following:
<br />
C++ side:   <br />
BYTE bArray[] = { 11, 12, 13, 14, 15 };<br />
int len = 5;<br />
pfnCallback(bArray, len);<br />
<br />
VB side:<br />
CallbackHandler(ByVal data() as Byte, ByVal len as Integer)<br />


This resulted in the data array length of 1 and it only had the first value of the array no matter how big my array was.

Then I tried:
<br />
C++ side:<br />
SAFEARRAY *psa;  <br />
(then properly created psa, and data copied in)<br />
pfnCallback(psa);<br />
(then properly destroy psa)<br />
<br />
VB side:<br />
CallbackHandler(ByVal data() as Byte)


This resulted in the data array length of 1 and it had the first element of C's SAFEARRAY in it (cDim). I could not see my data.

Am I barking up the wrong tree? Is what I want to do possible? I tried ByRef and got exception errors as it jumped from native code to managed code.

Thanks in advance,
Paul
AnswerRe: How do I pass a byte array from C++ to VB.NET? Pin
Dave Kreskowiak2-May-07 3:35
mveDave Kreskowiak2-May-07 3:35 
GeneralRe: How do I pass a byte array from C++ to VB.NET? Pin
prcarp2-May-07 8:46
prcarp2-May-07 8:46 
QuestionCreate Object From Type [modified] Pin
Polymorpher1-May-07 14:18
Polymorpher1-May-07 14:18 
QuestionUpdating Table of Access Database Pin
keninfo1-May-07 11:56
keninfo1-May-07 11:56 
AnswerRe: Updating Table of Access Database Pin
Christian Graus1-May-07 12:56
protectorChristian Graus1-May-07 12:56 
GeneralRe: Updating Table of Access Database Pin
keninfo1-May-07 23:57
keninfo1-May-07 23:57 
GeneralRe: Updating Table of Access Database Pin
Christian Graus2-May-07 0:55
protectorChristian Graus2-May-07 0:55 
GeneralRe: Updating Table of Access Database Pin
keninfo2-May-07 3:33
keninfo2-May-07 3:33 
QuestionGlobalization in VB .Net usig SQL server2000 Pin
joby1001-May-07 10:42
joby1001-May-07 10:42 
QuestionSet Custom PaperSize In VB.NET [modified] Pin
AmirAlilou1-May-07 8:12
AmirAlilou1-May-07 8:12 
Questionusing tab control to show datagrid Pin
detective_girl1-May-07 8:12
detective_girl1-May-07 8:12 
AnswerRe: using tab control to show datagrid Pin
Christian Graus1-May-07 10:31
protectorChristian Graus1-May-07 10:31 
GeneralRe: using tab control to show datagrid Pin
detective_girl1-May-07 19:35
detective_girl1-May-07 19:35 
QuestionRe: using tab control to show datagrid Pin
detective_girl1-May-07 20:15
detective_girl1-May-07 20:15 
GeneralRe: using tab control to show datagrid Pin
Christian Graus1-May-07 23:31
protectorChristian Graus1-May-07 23:31 
QuestionRe: using tab control to show datagrid Pin
detective_girl2-May-07 0:32
detective_girl2-May-07 0:32 
AnswerRe: using tab control to show datagrid Pin
Christian Graus2-May-07 10:24
protectorChristian Graus2-May-07 10:24 

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.