473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to convert System::String* (or System::Void) to void** in MC++?

Hy!

I have written a MC++ wrapper DLL file for use in a C# project. This
wrapper DLL is built on a C DLL.
I have the following functions in the C DLL:
int First(char* a1, char* a2, void* *a3, bool a4);
void Second(void* lic);

I've converted this in MC++ dll in the following way:
int First(System::String* a1, System::String* a2, System::Object* a3,
bool a4);
void Second(System::Object* a);
Or do I need to use System::Void instead of System::Object?

And how can I make the conversion from System::Object* (or
System::Void) to void**?
Can anyone help me?
Thanks a lot!

Sep 1 '06 #1
2 2040
Hi sovarschizsuzsa!
void Second(System::Object* a);
Or do I need to use System::Void instead of System::Object?
It depends on the meaning of "void*"!

If you just want to pass a pointer you can use "IntPtr".

But what should the C# (.NET) User do with this parameter?

So the real question is:
What do you want to wrap and what is the user of your API doing with it?

Greetings
Jochen
Sep 1 '06 #2
I've converted this in MC++ dll in the following way:
int First(System::String* a1, System::String* a2, System::Object* a3,
bool a4);
Ugh! Please make life easier for anyone reading your code in the future, by
consistently writing:

System::String __gc* a1

A __gc* is not a pointer, and it was a huge mistake for MC++ to make the
__gc keyword optional.
Sep 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bj?rn Toft Madsen | last post by:
Hi all, The network library I use communicates with my app using a callback function. This callback function is called with the type of message, a void pointer to he actual message and a user...
28
by: christopher diggins | last post by:
Hello, I want to convert a value of type T where sizeof(T) <= sizeof(void*) into a void* and back again. I am currently doing it as follows: void** ppvoid =...
22
by: Alex Fraser | last post by:
From searching Google Groups, I understand that void pointer arithmetic is a constraint violation, which is understandable. However, generic functions like qsort() and bsearch() must in essence do...
9
by: Juggernaut | last post by:
I am trying to create a p_thread pthread_create(&threads, &attr, Teste, (void *)var); where var is a char variable. But this doesnt't work, I get this message: test.c:58: warning: cast to pointer...
0
by: Boni | last post by:
Please help C# how to convert this C# to MC++ public void Execute(object application, int hwndOwner, ref object contextParams, ref object customParams, ref EnvDTE.wizardResult retval) ; I tried...
8
by: Boni | last post by:
Please help C# how to convert this C# to MC++ public void Execute(object application, int hwndOwner, ref object contextParams, ref object customParams, ref EnvDTE.wizardResult retval) ; I tried...
14
by: arun | last post by:
Hi, Why sizeof operator when applied on void returns one when compiled with gcc compiler ??. When i tried it on VC++ compiler, it gives an error. But another version of the VC++ compiler on my...
1
by: Sabarish | last post by:
Hello everyone, we have a native C++ function, which is as given below void DoSomething(void* pData); we are writing a c++/CLI Wrapper around it so that it can be accessed from a C##...
2
by: =?Utf-8?B?TW9uaWNh?= | last post by:
Dear reader, what's the converted codes to C#? --------------------------------------------------------------------------- Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e...
160
by: raphfrk | last post by:
Is this valid? int a; void *b; b = (void *)a; // b points to a b += 5*sizeof(*a); // b points to a a = 100;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.