Click here to Skip to main content
14,607,902 members

Visual Basic

 
AnswerRe: Closing the current form Pin
Zaegra1-May-07 20:42
MemberZaegra1-May-07 20:42 
AnswerRe: Closing the current form Pin
Rupesh Kumar Swami1-May-07 21:28
MemberRupesh Kumar Swami1-May-07 21:28 
QuestionNeed help building a TreeView Pin
ljohns1-May-07 16:45
Memberljohns1-May-07 16:45 
AnswerRe: Need help building a TreeView Pin
ljohns1-May-07 16:47
Memberljohns1-May-07 16:47 
GeneralRe: Need help building a TreeView Pin
ChandraRam1-May-07 23:06
MemberChandraRam1-May-07 23:06 
GeneralRe: Need help building a TreeView Pin
ljohns3-May-07 4:01
Memberljohns3-May-07 4:01 
GeneralRe: Need help building a TreeView Pin
ChandraRam4-May-07 0:12
MemberChandraRam4-May-07 0:12 
QuestionHow do I pass a byte array from C++ to VB.NET? Pin
prcarp1-May-07 15:28
Memberprcarp1-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
Memberprcarp2-May-07 8:46 
QuestionCreate Object From Type [modified] Pin
Polymorpher1-May-07 14:18
MemberPolymorpher1-May-07 14:18 
QuestionUpdating Table of Access Database Pin
keninfo1-May-07 11:56
Memberkeninfo1-May-07 11:56 
AnswerRe: Updating Table of Access Database Pin
Christian Graus1-May-07 12:56
mveChristian Graus1-May-07 12:56 
GeneralRe: Updating Table of Access Database Pin
keninfo1-May-07 23:57
Memberkeninfo1-May-07 23:57 
GeneralRe: Updating Table of Access Database Pin
Christian Graus2-May-07 0:55
mveChristian Graus2-May-07 0:55 
GeneralRe: Updating Table of Access Database Pin
keninfo2-May-07 3:33
Memberkeninfo2-May-07 3:33 
QuestionGlobalization in VB .Net usig SQL server2000 Pin
joby1001-May-07 10:42
Memberjoby1001-May-07 10:42 
QuestionSet Custom PaperSize In VB.NET [modified] Pin
AmirAlilou1-May-07 8:12
MemberAmirAlilou1-May-07 8:12 
Questionusing tab control to show datagrid Pin
detective_girl1-May-07 8:12
Memberdetective_girl1-May-07 8:12 
AnswerRe: using tab control to show datagrid Pin
Christian Graus1-May-07 10:31
mveChristian Graus1-May-07 10:31 
GeneralRe: using tab control to show datagrid Pin
detective_girl1-May-07 19:35
Memberdetective_girl1-May-07 19:35 
QuestionRe: using tab control to show datagrid Pin
detective_girl1-May-07 20:15
Memberdetective_girl1-May-07 20:15 
GeneralRe: using tab control to show datagrid Pin
Christian Graus1-May-07 23:31
mveChristian Graus1-May-07 23:31 
QuestionRe: using tab control to show datagrid Pin
detective_girl2-May-07 0:32
Memberdetective_girl2-May-07 0:32 
AnswerRe: using tab control to show datagrid Pin
Christian Graus2-May-07 10:24
mveChristian 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.