Click here to Skip to main content
15,887,293 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionRunning an executable through C++.Net code Pin
Bob X5-Jun-06 7:24
Bob X5-Jun-06 7:24 
AnswerRe: Running an executable through C++.Net code [modified] Pin
2bee 5-Jun-06 10:23
2bee 5-Jun-06 10:23 
GeneralRe: Running an executable through C++.Net code [modified] Pin
Bob X6-Jun-06 16:57
Bob X6-Jun-06 16:57 
AnswerRe: Running an executable through C++.Net code [modified] Pin
2bee 6-Jun-06 20:54
2bee 6-Jun-06 20:54 
GeneralRe: Running an executable through C++.Net code [modified] Pin
Bob X7-Jun-06 14:41
Bob X7-Jun-06 14:41 
Questioncalling function in unmanaged dll with paramter char** Pin
guestcat5-Jun-06 1:32
guestcat5-Jun-06 1:32 
QuestionC++/CLI and your experience Pin
vassilux@4-Jun-06 7:14
vassilux@4-Jun-06 7:14 
QuestionProblem with VC++ 2003 code Pin
fudicator3-Jun-06 16:21
fudicator3-Jun-06 16:21 
Hello, i've got a really anoying bug that i cant seem to figure out.. The code comes from a 2005 project which needs to be compiled in a 2003 project. The code is as follows:

// CitectAPIManagedDll.h<br />
<br />
#pragma once<br />
<br />
using namespace System;<br />
using namespace System::Runtime::InteropServices;<br />
<br />
namespace CitectAPIManagedDll<br />
{<br />
	/// Create a unmanaged wrapper structure as the placeholder for unmanaged class <br />
	/// members as exported by the DLL. This structure/class is not intended to be<br />
	/// instantiated by .NET applications directly.<br />
	public __gc struct CitectAPIUnman<br />
	{<br />
		/// Define the virtual table for the wrapper<br />
		typedef __gc struct __VTB<br />
		{<br />
			void (*Open)(CitectAPIUnman*, System::String*, System::String*, System::String*, System::Int32*);	<br />
		};<br />
<br />
	public:<br />
		char* id;<br />
		static __VTB *vtb;	<br />
<br />
		/// Perform all required imports. Use "ThisCall" calling convention to import <br />
		/// functions as class methods of this object (not "StdCall"). Note that we <br />
		/// pass this pointer to the imports. Use the "decorated name" instead of <br />
		/// retreived from the DLL as the entry point.<br />
		[DllImport("CTAPI.dll", <br />
				  EntryPoint="ctOpen", <br />
				  CallingConvention=CallingConvention::ThisCall)]<br />
		static void Open(CitectAPIUnman*, System::String*, System::String*, System::String*, System::Int32*);<br />
		<br />
		/// Delegates of imported virtual methods for the virtual table.<br />
		/// This basically is hacking the limitation of function pointer (FP),<br />
		/// as FP requires function address at compile time.<br />
		static void VOpen(CitectAPIUnman* w, System::String* computer, System::String* username, System::String* password, System::Int32* mode)<br />
		{<br />
			Open(w, computer, username, password, mode);<br />
		}<br />
	};<br />
<br />
	/// Managed wrapper class which will actually be used by .NET applications.<br />
	public __gc class CitectAPIWrap<br />
	{<br />
	public: <br />
		/// User-defined managed wrapper constructor. It will perform a few tasks:<br />
		/// 1) Allocating memory for the unmanaged data<br />
		/// 2) Assign the v-table<br />
		/// 3) Marshall the parameters to and call the imported unmanaged class constructor<br />
		CitectAPIWrap()<br />
		{<br />
			tv = new CitectAPIUnman();<br />
			CitectAPIUnman::vtb->Open = CitectAPIUnman::VOpen;<br />
		}	<br />
<br />
		/// Let the v-table handle method overriding<br />
		virtual void Open(System::String* computer, System::String* username, System::String* password, System::Int32* mode)<br />
		{<br />
			CitectAPIUnman::vtb->Open(tv, computer, username, password, mode);<br />
		}<br />
<br />
	private:<br />
		CitectAPIUnman *tv;<br />
	};<br />
}<br />


i get the following compile error:
error C2440: '=' : cannot convert from 'void (__clrcall CitectAPIManagedDll::CitectAPIUnman::* )(CitectAPIManagedDll::CitectAPIUnman __gc *,System::String __gc *,System::String __gc *,System::String __gc *,int __gc *)' to 'void (__clrcall *)(CitectAPIManagedDll::CitectAPIUnman __gc *,System::String __gc *,System::String __gc *,System::String __gc *,int __gc *)'

any ideas? this is the first time ive used 2003 to compile this project. your help is greatly appreciated.
QuestionTemperature conversion Pin
klutez1232-Jun-06 3:28
klutez1232-Jun-06 3:28 
AnswerRe: Temperature conversion Pin
Michael Dunn2-Jun-06 7:53
sitebuilderMichael Dunn2-Jun-06 7:53 
QuestionMixed Assembly for a wrapper class Pin
greggor31-May-06 11:39
greggor31-May-06 11:39 
QuestionAbout C++/CLI spec... Pin
Jun Du31-May-06 5:05
Jun Du31-May-06 5:05 
AnswerRe: About C++/CLI spec... Pin
Nemanja Trifunovic31-May-06 6:16
Nemanja Trifunovic31-May-06 6:16 
Questionmaking PictureBox component transparent Pin
9ine31-May-06 4:14
9ine31-May-06 4:14 
QuestionHow to place an edit box and dialog box on a window(SDI)in VC++ dot Net Pin
Ashutosh Bagaria30-May-06 8:00
Ashutosh Bagaria30-May-06 8:00 
QuestionThreading [modified] Pin
satsumatable30-May-06 1:36
satsumatable30-May-06 1:36 
AnswerRe: Threading [modified] Pin
2bee 30-May-06 2:31
2bee 30-May-06 2:31 
GeneralRe: Threading [modified] Pin
satsumatable30-May-06 2:38
satsumatable30-May-06 2:38 
GeneralRe: Threading [modified] Pin
George L. Jackson30-May-06 11:22
George L. Jackson30-May-06 11:22 
QuestionC++/CLI or Native Pin
Sarath C29-May-06 3:26
Sarath C29-May-06 3:26 
AnswerRe: C++/CLI or Native Pin
Milton Karimbekallil29-May-06 7:25
Milton Karimbekallil29-May-06 7:25 
QuestionUse Managed Pin
satsumatable29-May-06 2:07
satsumatable29-May-06 2:07 
AnswerRe: Use Managed Pin
Milton Karimbekallil29-May-06 7:18
Milton Karimbekallil29-May-06 7:18 
Questionhow to search a keyword in all files and folders in c++ [modified] Pin
B.L.MALYADA DEVI28-May-06 23:20
B.L.MALYADA DEVI28-May-06 23:20 
AnswerRe: how to search a keyword in all files and folders in c++ [modified] Pin
Milton Karimbekallil29-May-06 6:52
Milton Karimbekallil29-May-06 6:52 

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.