473,385 Members | 1,983 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,385 software developers and data experts.

can't convert C# signature to MC++

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

void Execute(System::Object* application, int hwndOwner,
System::Object*&contextParamss, System::Object*& customParams,
EnvDTE::wizardResult &retval)

void Execute(System::Object* application, int hwndOwner, System::Object&
contextParams[], System::Object& customParams[], EnvDTE::wizardResult
&retval)

and some others but can find a right one.

Please how can I get a reference to the array?

Thanks so much,

Boni
Nov 17 '05 #1
8 1465
Boni,
how to convert this C# to MC++
public void Execute(object application, int hwndOwner, ref object[]
contextParams, ref object[] customParams, ref EnvDTE.wizardResult retval)
;


Try
public:
void Execute (
Object* application, int hwndOwner,
Object* (&customParams) __gc[],
EnvDTE::wizardResult& retval
);

Hope I got that right ;)
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #2
Hi Tomas,
Seems to be still wrong. The error is:

error C2259: 'cPxy' : cannot instantiate abstract class

due to following members:

'void cPxy::Execute(System::Object __gc *,int,System::Object __gc *(__gc *)
__gc[],System::Object __gc *(__gc *) __gc[],EnvDTE::wizardResult __gc *)' :
pure virtual function was not defined

cProxy.cpp(0) : see declaration of 'cPxy::Execute'

But most strange is, that is I take the signature from the error (just
copy/paste) the error still there!!!! I am trying to reload IDTWizard with
MC++.

Do you have more suggestrions, please!!

"Tomas Restrepo (MVP)" <to****@mvps.org> schrieb im Newsbeitrag
news:OD**************@TK2MSFTNGP10.phx.gbl...
Boni,
how to convert this C# to MC++
public void Execute(object application, int hwndOwner, ref object[]
contextParams, ref object[] customParams, ref EnvDTE.wizardResult retval)
;


Try
public:
void Execute (
Object* application, int hwndOwner,
Object* (&customParams) __gc[],
EnvDTE::wizardResult& retval
);

Hope I got that right ;)
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #3
Boni,
Hi Tomas,
Seems to be still wrong. The error is:

error C2259: 'cPxy' : cannot instantiate abstract class

due to following members:

'void cPxy::Execute(System::Object __gc *,int,System::Object __gc *(__gc
*) __gc[],System::Object __gc *(__gc *) __gc[],EnvDTE::wizardResult __gc
*)' : pure virtual function was not defined

cProxy.cpp(0) : see declaration of 'cPxy::Execute'

But most strange is, that is I take the signature from the error (just
copy/paste) the error still there!!!! I am trying to reload IDTWizard with
MC++.

Do you have more suggestrions, please!!

The following seems to compile for me:

public __gc class MyWizard : public EnvDTE::IDTWizard
{
public:
virtual void Execute (
Object* Application,
int hwndOwner,
Object* (*ContextParams) __gc[],
EnvDTE::wizardResult __gc* retval
)
{
// ...
}
};
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #4
Thanks, you are grea! The following compiles (as you suggested!!)
Thanks so much!!!!!
BTW where is the exact difference between
Object* (*ContextParams) __gc[]

and

Object * __gc (*ContextParams) __gc[]

?

virtual void Execute (

Object* Application,

int hwndOwner,

Object* (*ContextParams) __gc[],

Object* (*arg3) __gc[],

EnvDTE::wizardResult __gc* retval

);


"Tomas Restrepo (MVP)" <to****@mvps.org> schrieb im Newsbeitrag
news:OT**************@TK2MSFTNGP15.phx.gbl...
Boni,
Hi Tomas,
Seems to be still wrong. The error is:

error C2259: 'cPxy' : cannot instantiate abstract class

due to following members:

'void cPxy::Execute(System::Object __gc *,int,System::Object __gc *(__gc
*) __gc[],System::Object __gc *(__gc *) __gc[],EnvDTE::wizardResult __gc
*)' : pure virtual function was not defined

cProxy.cpp(0) : see declaration of 'cPxy::Execute'

But most strange is, that is I take the signature from the error (just
copy/paste) the error still there!!!! I am trying to reload IDTWizard
with MC++.

Do you have more suggestrions, please!!

The following seems to compile for me:

public __gc class MyWizard : public EnvDTE::IDTWizard
{
public:
virtual void Execute (
Object* Application,
int hwndOwner,
Object* (*ContextParams) __gc[],
EnvDTE::wizardResult __gc* retval
)
{
// ...
}
};
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #5
Boni,
Thanks, you are grea! The following compiles (as you suggested!!)
Thanks so much!!!!!
BTW where is the exact difference between
Object* (*ContextParams) __gc[]

and

Object * __gc (*ContextParams) __gc[]


You mean Object __gc* (*ContextParams) __gc[] ?

If so, then nothing, they are equivalent. However, I've seen some cases
where in complex declarations like this the compiler used to get confused so
specifying explicitly the __gc-ness of a pointer or array declaration was
useful.
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #6
Dear Thomas,
thank you. I just experienced one more problem with __gc-ness.
MethodInfo->Invoke, need as a second argument a pointer to the managed
parameter array, isnt it?
So how can I create this array from the actual parameters, when all
parameters have different type.
Do I need Object **?
Please help me.
void MyClass::Execute ( Object* Application, int hwndOwner, Object*
(*ContextParams) __gc[], Object* (*ContextParams8) __gc[],
EnvDTE::wizardResult __gc* retval){

Object __gc* (*_arr) __gc[] =new (Object*)[5];

_arr[0]=&Application;

_arr[1]=&hwndOwner;

_arr[2]=&ContextParams;

_arr[3]=&ContextParams8;

_arr[4]=&retval;

m_Execute->Invoke(m_Instance, _arr); //m_Execute is MethodInfo

};


Nov 17 '05 #7
Boni,
thank you. I just experienced one more problem with __gc-ness.
MethodInfo->Invoke, need as a second argument a pointer to the managed
parameter array, isnt it?
So how can I create this array from the actual parameters, when all
parameters have different type.
Do I need Object **?


You need a __gc array of Object*, which is different:

Object* arr __gc[] = new Object*[5];
arr[0] = ...

Notice that if you're going to be putting value types into this, you'll need
boxing.

--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com
Nov 17 '05 #8
Hi Tomas,
Thank you. I also needed reinterpret_cast<Object*>(...).
I can't wait until I am in the state when I can run this dll :)))
In any case it compiles now!!!
Thank you sooo much.
With best regards,
Boni
Nov 17 '05 #9

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

Similar topics

5
by: Rex_chaos | last post by:
Hi all, I have a question about datatype converting. Consider the following types std::complex<double> and struct MyComplex { double re, im; }
3
by: ET | last post by:
I don't know whats the problem, but after I added functions to first verify, then relink linked tables if not found, now I can't convert that database to MDE format. I can split the database, but...
10
by: Edward Diener | last post by:
The documentation states the names of the various managed operators but does not give the signature for them. Is there some documentation which I have missed that gives the correct signature ? In...
11
by: ricolee99 | last post by:
Hi everyone, I'm trying to invoke my .exe application from a remote server. Here is the code: ManagementClass processClass = new ManagementClass ("\\\\" +"RemoteServerName" +...
1
by: Vinoth Kumar | last post by:
Hi I am writing a wrapper class for a unmanaged c++ class, which has the method signature, Method(wchar_t** ppszValue) Anyone please tell me, how to convert the string _gc* _gc* to...
2
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
7
by: Whybother | last post by:
I have class CMyClass to which I create objects of and store a count of them in a stl map. (stlport) like so typedef map<CMyClass, unsigned, myclass_less> Results_Map; .... Results_Map...
2
by: sovarschizsuzsa | last post by:
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,...
3
by: Sascha.Moellering | last post by:
Hi, I've got a complex Oracle-SQL-statement and I want to convert it to DB/ 2: INSERT INTO TBZL2000CSFLQ_AGG( Solve_Name, Scenario, Korrektur_KZ, EventDate,
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.