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

Managed C++/CLI

 
AnswerRe: checking Parallel Port Pin
valikac8-Mar-06 11:58
valikac8-Mar-06 11:58 
QuestionHow to read a pdf file using c++ Pin
Allang Garder7-Mar-06 17:13
Allang Garder7-Mar-06 17:13 
AnswerRe: How to read a pdf file using c++ Pin
toxcct7-Mar-06 22:14
toxcct7-Mar-06 22:14 
GeneralRe: How to read a pdf file using c++ Pin
prrusa8-Mar-06 9:14
prrusa8-Mar-06 9:14 
QuestionHelp with this basic code Pin
Fu Manchu7-Mar-06 13:56
Fu Manchu7-Mar-06 13:56 
AnswerRe: Help with this basic code Pin
toxcct7-Mar-06 21:45
toxcct7-Mar-06 21:45 
AnswerRe: Help with this basic code Pin
Gavin Taylor7-Mar-06 23:39
professionalGavin Taylor7-Mar-06 23:39 
AnswerRe: Help with this basic code Pin
Fu Manchu8-Mar-06 12:01
Fu Manchu8-Mar-06 12:01 
thanks guys, i thought it was something like that,but i mainly use vb.net so i get a little stuck with c++.

i have been trying to wrap this example, so i can practice for a much bigger program.

i have never done this before and the help on the net is a little vague, i need a very very basic walkthrough, because the ones i have found won't compile, and its hard enough trying to debug code that you dont really understand.

i know this much....

i have a class library(.net) called fooManaged and its automatical created fooManaged.h. and i created UnManaged.h

in the UnManaged.h file i have this code.....

#include iostream <br />
 #include vcclr.h<br />
using namespace std;<br />
<br />
class Foo<br />
{<br />
public:<br />
 Foo();<br />
 ~Foo();<br />
void DoSomeFoo();<br />
};<br />
<br />
 // constructor<br />
Foo::Foo() <br />
  {<br />
	cout<<"Constructor called!"<<endl;<br />
  }<br />
//  // destructor<br />
Foo::~Foo() <br />
  {<br />
	cout<<"Destructor called"<<endl;<br />
  }<br />
<br />
  // some method<br />
  void Foo::DoSomeFoo(void)<br />
<br />
  {<br />
	  cout<<"Do something funny!"<<endl;<br />
	  cout<<"Burrrp!"<<endl;<br />
  }



in fooManaged.h i have this code....

// fooManaged.h<br />
<br />
#pragma once<br />
using namespace System;<br />
<br />
namespace fooManaged<br />
{<br />
	public __gc class MFoo<br />
{	<br />
private:<br />
	Foo * _foo;<br />
public:<br />
	MFoo();<br />
	~MFoo();<br />
	void ManagedDoSomeFoo();<br />
};<br />
  // constructor<br />
MFoo::MFoo() <br />
	{<br />
	 _foo = new Foo();<br />
	}<br />
  // destructor<br />
MFoo::~MFoo()<br />
	{<br />
	 delete _foo;<br />
	}<br />
<br />
  // method<br />
void MFoo::ManagedDoSomeFoo() <br />
  {<br />
	  _foo->DoSomeFoo();<br />
  }<br />
<br />
}


the fooManaged.cpp file just has...

#include "stdafx.h"
#include "Unmanagedfoo.h"
#include "fooManaged.h"
#using mscorlib.dll

it all compiles...but there is a big linking error!!

Compiling...
fooManaged.cpp
Linking...
LINK : error LNK2020: unresolved token (0A000005) _CxxThrowException
LINK : error LNK2020: unresolved token (0A000019) free
LINK : error LNK2020: unresolved token (0A00001A) strlen
LINK : error LNK2020: unresolved token (0A00001B) memmove
LINK : error LNK2020: unresolved token (0A00001C) memcpy
LINK : error LNK2020: unresolved token (0A00001D) delete
LINK : fatal error LNK1120: 6 unresolved externals

i must be doing something wrong, some help with this will be very wecome

thanks
Questionsearchable void* container Pin
Amr Shahin7-Mar-06 2:58
Amr Shahin7-Mar-06 2:58 
AnswerRe: searchable void* container Pin
toxcct7-Mar-06 3:06
toxcct7-Mar-06 3:06 
GeneralRe: searchable void* container Pin
Amr Shahin7-Mar-06 3:10
Amr Shahin7-Mar-06 3:10 
GeneralRe: searchable void* container Pin
John M. Drescher7-Mar-06 3:15
John M. Drescher7-Mar-06 3:15 
GeneralRe: searchable void* container Pin
toxcct7-Mar-06 3:16
toxcct7-Mar-06 3:16 
GeneralRe: searchable void* container Pin
John M. Drescher7-Mar-06 3:22
John M. Drescher7-Mar-06 3:22 
GeneralRe: searchable void* container Pin
John M. Drescher7-Mar-06 3:12
John M. Drescher7-Mar-06 3:12 
GeneralRe: searchable void* container Pin
toxcct7-Mar-06 3:16
toxcct7-Mar-06 3:16 
GeneralRe: searchable void* container Pin
John M. Drescher7-Mar-06 3:24
John M. Drescher7-Mar-06 3:24 
GeneralRe: searchable void* container Pin
Nemanja Trifunovic7-Mar-06 5:46
Nemanja Trifunovic7-Mar-06 5:46 
GeneralRe: searchable void* container Pin
toxcct7-Mar-06 5:51
toxcct7-Mar-06 5:51 
QuestionPrint program in C only Pin
patel mayur6-Mar-06 21:16
patel mayur6-Mar-06 21:16 
AnswerRe: Print program in C only Pin
Ingo6-Mar-06 23:19
Ingo6-Mar-06 23:19 
AnswerRe: Print program in C only Pin
Professor Sharada Ulhas7-Mar-06 7:28
Professor Sharada Ulhas7-Mar-06 7:28 
Questionprinting the address of a non static member function of a clss Pin
Amr Shahin6-Mar-06 3:23
Amr Shahin6-Mar-06 3:23 
AnswerRe: printing the address of a non static member function of a class [edited] Pin
toxcct6-Mar-06 3:34
toxcct6-Mar-06 3:34 
GeneralRe: printing the address of a non static member function of a clss Pin
Amr Shahin6-Mar-06 3:51
Amr Shahin6-Mar-06 3:51 

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.