Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAccess to COM methods inside Windows Service ATL Pin
cmacgowan22-Feb-06 6:03
cmacgowan22-Feb-06 6:03 
QuestionLGPL query Pin
Chintoo72322-Feb-06 5:51
Chintoo72322-Feb-06 5:51 
AnswerRe: LGPL query Pin
Chris Losinger22-Feb-06 7:45
professionalChris Losinger22-Feb-06 7:45 
GeneralRe: LGPL query Pin
Chintoo72322-Feb-06 15:21
Chintoo72322-Feb-06 15:21 
GeneralRe: LGPL query Pin
Chris Losinger22-Feb-06 16:01
professionalChris Losinger22-Feb-06 16:01 
AnswerRe: LGPL query Pin
Joe Woodbury22-Feb-06 8:26
professionalJoe Woodbury22-Feb-06 8:26 
AnswerRe: LGPL query Pin
Sebastian Pipping22-Feb-06 15:40
Sebastian Pipping22-Feb-06 15:40 
QuestionPassing Arrays of structures from VB.NET to unmanaged C++ Pin
CPop22-Feb-06 5:45
CPop22-Feb-06 5:45 
I have been looking for an answer on this one, but found only references to structures. Basically I have a VB.NET structure containing an member array of onother structure that has to be passed to unmanaged C++. I have been able to pass the structure which has members of type structure, but as soon as I define a member array of that structure I get an error: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: The operation completed successfully."

This is how I am doing it:

VB.NET:

Public Structure SndStr2
<marshalas(unmanagedtype.i4)> Public memb1 As Integer
<marshalas(unmanagedtype.lpstr)> Public memb2 As String
<marshalas(unmanagedtype.i4)> Public memb3 As Integer
<marshalas(unmanagedtype.i4)> Public memb4 As Integer
End Structure

Public Structure SndStr1
<marshalas(unmanagedtype.i4)> Public memb1 As Integer
<marshalas(unmanagedtype.lpstr)> Public memb2 As String
<marshalas(unmanagedtype.i4)> Public memb3 As Integer
<marshalas(unmanagedtype.r8)> Public memb4 As Double
Public memb5() As SndStr2
End Structure

Declaration: Private Declare Function RcvFun Lib "...\RcvFun.dll" _
(ByRef SndVar As SndStr1) As String



Unmanaged C++:

struct RcvStr1 {
int memb1;
LPSTR memb2;
int memb3;
int memb4;
};

struct RcvStr2{
int memb1;
LPSTR memb2;
int memb3;
double memb4;
RcvStr1 *memb5;
};

LPSTR __declspec (dllexport) __stdcall RcvFun(RcvStr2 **RcvPtr)
{
RcvStr1 RcvVar1;

RcvVar1 = RcvPtr[0]->memb5[0];
return RcvVar1.memb2;

}

If there is anybody out there that did this before, please help!Confused | :confused:


-- modified at 12:05 Wednesday 22nd February, 2006
QuestionListview controls Pin
Waldermort22-Feb-06 5:23
Waldermort22-Feb-06 5:23 
AnswerRe: Listview controls Pin
Joe Woodbury22-Feb-06 5:41
professionalJoe Woodbury22-Feb-06 5:41 
AnswerRe: Listview controls Pin
Gavin Taylor22-Feb-06 6:07
professionalGavin Taylor22-Feb-06 6:07 
AnswerRe: Listview controls Pin
Sebastian Pipping22-Feb-06 10:32
Sebastian Pipping22-Feb-06 10:32 
GeneralRe: Listview controls Pin
Waldermort22-Feb-06 15:13
Waldermort22-Feb-06 15:13 
AnswerRe: Listview controls Pin
Sebastian Pipping22-Feb-06 15:30
Sebastian Pipping22-Feb-06 15:30 
GeneralRe: Listview controls Pin
Waldermort23-Feb-06 1:09
Waldermort23-Feb-06 1:09 
QuestionCComboBox dropdown bit is hidden Pin
rw10422-Feb-06 4:18
rw10422-Feb-06 4:18 
AnswerRe: CComboBox dropdown bit is hidden Pin
Iain Clarke, Warrior Programmer22-Feb-06 4:52
Iain Clarke, Warrior Programmer22-Feb-06 4:52 
GeneralRe: CComboBox dropdown bit is hidden Pin
rw10422-Feb-06 4:56
rw10422-Feb-06 4:56 
Questiondrawing problem Pin
Deviantizh22-Feb-06 4:06
Deviantizh22-Feb-06 4:06 
AnswerRe: drawing problem Pin
Cedric Moonen22-Feb-06 4:33
Cedric Moonen22-Feb-06 4:33 
QuestionDumb question of the week C pointer question. Pin
Maximilien22-Feb-06 3:27
Maximilien22-Feb-06 3:27 
AnswerRe: Dumb question of the week C pointer question. Pin
Cedric Moonen22-Feb-06 3:34
Cedric Moonen22-Feb-06 3:34 
GeneralRe: Dumb question of the week C pointer question. Pin
Sebastian Schneider22-Feb-06 4:19
Sebastian Schneider22-Feb-06 4:19 
GeneralRe: Dumb question of the week C pointer question. Pin
Maximilien22-Feb-06 4:40
Maximilien22-Feb-06 4:40 
AnswerRe: Dumb question of the week C pointer question. Pin
Sebastian Schneider22-Feb-06 4:13
Sebastian Schneider22-Feb-06 4:13 

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.