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

Managed C++/CLI

 
GeneralRe: Name Mangling Pin
Member 62566625-Mar-04 10:20
Member 62566625-Mar-04 10:20 
GeneralRe: Name Mangling Pin
Rahul20067611-Apr-04 4:04
Rahul20067611-Apr-04 4:04 
GeneralProblems with lib file and linking Pin
ravjak24-Mar-04 9:20
ravjak24-Mar-04 9:20 
GeneralRe: Problems with lib file and linking Pin
ian mariano24-Mar-04 17:19
ian mariano24-Mar-04 17:19 
GeneralRe: Problems with lib file and linking Pin
ravjak25-Mar-04 5:17
ravjak25-Mar-04 5:17 
GeneralRe: Problems with lib file and linking Pin
ravjak25-Mar-04 5:22
ravjak25-Mar-04 5:22 
GeneralRe: Problems with lib file and linking Pin
ravjak28-Mar-04 2:42
ravjak28-Mar-04 2:42 
GeneralMixing C++ and C Pin
Member 62566623-Mar-04 8:01
Member 62566623-Mar-04 8:01 
My ERROR:
sim50avc error LNK2001: unresolved external symbol "void __cdecl showme(int)" (?showme@@$$J0YAXH@Z)


I have created a simple Form project and tried to mix C++ and my existing C code. With problems of course. Here is the important code.

/* BEGIN - don.c */
/* ############################################################ */
/* ### This just a cut-down example of my C code ### */
/* ############################################################ */
/* ### The fact that it is C code and not C++ cannot change ### */
/* ############################################################ */
#include

extern void showme(int); /* call this routine in Form1.h */

int magiccalc() /* Magic calculation - written in C */
{
showme(3); /* use the integer 3 instead of showing the calculations code */

return(0);
}
/* ############################################################ */
/* END - don.c */


/* BEGIN - Form1.h */
#pragma once


extern "C" int magiccalc(void);

namespace sim50avc
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

///
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
///
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
int num;

InitializeComponent();
num = magiccalc(); /* Call magiccalc in don.c */
/* num is a meaningless return value */
}

protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}

private: System::Windows::Forms::TextBox * inputBox;
private: System::Windows::Forms::TextBox * outputBox;

private:
///
/// Required designer variable.
///
System::ComponentModel::Container * components;

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->inputBox = new System::Windows::Forms::TextBox();
this->outputBox = new System::Windows::Forms::TextBox();
this->SuspendLayout();
//
// inputBox
//
this->inputBox->Location = System::Drawing::Point(16, 24);
this->inputBox->Multiline = true;
this->inputBox->Name = S"inputBox";
this->inputBox->Size = System::Drawing::Size(256, 88);
this->inputBox->TabIndex = 1;
this->inputBox->Text = S"inputBox";
//
// outputBox
//
this->outputBox->Location = System::Drawing::Point(16, 184);
this->outputBox->Multiline = true;
this->outputBox->Name = S"outputBox";
this->outputBox->Size = System::Drawing::Size(256, 88);
this->outputBox->TabIndex = 2;
this->outputBox->Text = S"";
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->ClientSize = System::Drawing::Size(292, 302);
this->Controls->Add(this->outputBox);
this->Controls->Add(this->inputBox);
this->Name = S"Form1";
this->Text = S"Form1";
this->ResumeLayout(false);

}

public:
void __cdecl showme(int thenum)
{
MessageBox::Show(S"abc", S"Result...");
}

};
}
/* END - Form1.h */

Thank You in advance

Don

P.S. - I can send the project in zipped form if anyone wants to take a look.

GeneralRe: Mixing C++ and C Pin
ian mariano23-Mar-04 10:17
ian mariano23-Mar-04 10:17 
GeneralRe: Mixing C++ and C Pin
Member 62566623-Mar-04 10:28
Member 62566623-Mar-04 10:28 
GeneralRe: Mixing C++ and C Pin
ian mariano24-Mar-04 2:01
ian mariano24-Mar-04 2:01 
GeneralRe: Mixing C++ and C Pin
Member 62566625-Mar-04 5:15
Member 62566625-Mar-04 5:15 
GeneralRe: Mixing C++ and C Pin
ian mariano25-Mar-04 9:59
ian mariano25-Mar-04 9:59 
GeneralRe: Mixing C++ and C Pin
Member 62566625-Mar-04 10:22
Member 62566625-Mar-04 10:22 
Generalfind current path (C++ DLL called from C# file) Pin
jazzle23-Mar-04 6:02
jazzle23-Mar-04 6:02 
GeneralRe: find current path (C++ DLL called from C# file) Pin
ian mariano23-Mar-04 10:24
ian mariano23-Mar-04 10:24 
GeneralRe: find current path (C++ DLL called from C# file) Pin
jazzle24-Mar-04 4:48
jazzle24-Mar-04 4:48 
Generalnewbie timer question Pin
zena9923-Mar-04 4:20
zena9923-Mar-04 4:20 
GeneralRe: newbie timer question Pin
zena9923-Mar-04 4:55
zena9923-Mar-04 4:55 
GeneralI need books pls Pin
extremeg21-Mar-04 20:35
extremeg21-Mar-04 20:35 
GeneralRe: I need books pls Pin
ravjak25-Mar-04 7:03
ravjak25-Mar-04 7:03 
General"blinking" word Pin
millienium bear21-Mar-04 0:07
millienium bear21-Mar-04 0:07 
GeneralRe: "blinking" word Pin
ian mariano21-Mar-04 10:47
ian mariano21-Mar-04 10:47 
GeneralRe: "blinking" word Pin
millienium bear22-Mar-04 1:47
millienium bear22-Mar-04 1:47 
GeneralRe: "blinking" word Pin
ian mariano23-Mar-04 9:50
ian mariano23-Mar-04 9:50 

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.