Click here to Skip to main content
15,916,189 members
Home / Discussions / C#
   

C#

 
AnswerRe: Space Key problem Pin
Justin Perez2-Oct-07 2:35
Justin Perez2-Oct-07 2:35 
GeneralRe: Space Key problem Pin
mihksoft2-Oct-07 2:37
mihksoft2-Oct-07 2:37 
GeneralRe: Space Key problem Pin
Pete O'Hanlon2-Oct-07 2:39
mvePete O'Hanlon2-Oct-07 2:39 
GeneralRe: Space Key problem Pin
Justin Perez2-Oct-07 2:41
Justin Perez2-Oct-07 2:41 
GeneralRe: Space Key problem Pin
mihksoft2-Oct-07 2:45
mihksoft2-Oct-07 2:45 
GeneralRe: Space Key problem Pin
Justin Perez2-Oct-07 2:49
Justin Perez2-Oct-07 2:49 
GeneralRe: Space Key problem Pin
leppie2-Oct-07 4:50
leppie2-Oct-07 4:50 
QuestionHow to expose std::vector in C Sharp Pin
Dhanesh Nair2-Oct-07 0:35
Dhanesh Nair2-Oct-07 0:35 
I have created a COM server in which a collection of vectors need to be exposed to C# sharp client .

Each vector contains a array of structures and this vector need to be embedded inside a container, say another vector or list.

Code:
typedef struct
{
std::string name;
std::string type;

} STAGE_INFO;

std::vector<stage_info> m_stages;

m_stages.push_back(current_stage)



Since STL classes are not accessible in C#, I used a SAFEARRAY and VARIANT for exposing them. But I am not successful because of the following reason .

1) I am not able to create a VARIANT array of structures.
2) I created a SAFEARRAY of structures and included it in a VARIANT, but when accessed in C# as Object, I am not able to get the structure. Though I am able to typecast it into a Object array , but if accessed in separte gives exception.
3) I am able to access the members of the structure as they are string but not a STRUCTURE as a whole.
4) I tried containing a VARIANT of SAFEARRAY'S in another VARIANT, but it gives a casting error.
5) CComVariant cannot have USD's and VARIANT if used has some problem of Memory Leaks.

Please let me know if you have expertise in COM and C#.Net Interoperability.
or
Even if you have some alternate solution for this problem?

Thanks In Advance .. expecting your earliest reply.


_________________
Life Rocks,

$dhanu's$
AnswerRe: How to expose std::vector in C Sharp Pin
Judah Gabriel Himango2-Oct-07 4:21
sponsorJudah Gabriel Himango2-Oct-07 4:21 
QuestionClass with symbol [modified] Pin
N a v a n e e t h2-Oct-07 0:24
N a v a n e e t h2-Oct-07 0:24 
AnswerRe: Class with symbol Pin
Christian Graus2-Oct-07 0:32
protectorChristian Graus2-Oct-07 0:32 
GeneralRe: Class with symbol Pin
Jens Meyer2-Oct-07 0:42
Jens Meyer2-Oct-07 0:42 
GeneralRe: Class with symbol Pin
J4amieC2-Oct-07 0:47
J4amieC2-Oct-07 0:47 
GeneralRe: Class with symbol Pin
N a v a n e e t h2-Oct-07 0:48
N a v a n e e t h2-Oct-07 0:48 
GeneralRe: Class with symbol Pin
Pete O'Hanlon2-Oct-07 0:56
mvePete O'Hanlon2-Oct-07 0:56 
GeneralRe: Class with symbol Pin
N a v a n e e t h2-Oct-07 0:59
N a v a n e e t h2-Oct-07 0:59 
GeneralRe: Class with symbol Pin
Pete O'Hanlon2-Oct-07 1:21
mvePete O'Hanlon2-Oct-07 1:21 
GeneralRe: Class with symbol Pin
Judah Gabriel Himango2-Oct-07 4:15
sponsorJudah Gabriel Himango2-Oct-07 4:15 
AnswerRe: Class with symbol Pin
DavidNohejl2-Oct-07 1:04
DavidNohejl2-Oct-07 1:04 
GeneralRe: Class with symbol Pin
N a v a n e e t h2-Oct-07 1:08
N a v a n e e t h2-Oct-07 1:08 
QuestionVisual C# Button Link to website Pin
Benjamin Dodd2-Oct-07 0:16
Benjamin Dodd2-Oct-07 0:16 
AnswerRe: Visual C# Button Link to website Pin
N a v a n e e t h2-Oct-07 0:26
N a v a n e e t h2-Oct-07 0:26 
GeneralRe: Visual C# Button Link to website Pin
Benjamin Dodd2-Oct-07 1:15
Benjamin Dodd2-Oct-07 1:15 
GeneralRe: Visual C# Button Link to website Pin
N a v a n e e t h2-Oct-07 1:26
N a v a n e e t h2-Oct-07 1:26 
GeneralRe: Visual C# Button Link to website Pin
Christian Graus2-Oct-07 1:30
protectorChristian Graus2-Oct-07 1:30 

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.