🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.lang.c++
2 messages
2 total messages Started by Andreas Schwab Sat, 17 Feb 1996 14:13
Wie verwende ich mit Delphi erstellte DLLs? Funktioniert nicht so wie dokumentiert!
#1648
Author: Andreas Schwab
Date: Sat, 17 Feb 1996 14:13
114 lines
3037 bytes
Ich habe folgendes Problem: Ich möchte gerne eine mit Delphi erstellte 
DLL (die ein Formular beinhaltet) in Borland C++ 4.5 einbinden. Die 
Sache funktioniert jedoch nicht. Ich erhalte immer folgende 
Fehlermeldung:

Linker Error: Undefinde symbol readvalue() in module DLLTEST.CPP

Ich bräuchte schon dringend eine Lösung für dieses Problem. Könnte mir 
nicht jemand einen Tip geben, worauf ich zu achten habe, bzw. könnte mir 
nicht jemand ein Beispielprogramm nennen, das das Einbinden einer 
Delphi-DLL realisiert.

Herzlichen Dank im Voraus,  Andreas Schwab

---------------------------
Es folgt nun noch das CPP-Programm, mit dem ich die DLL einbinden will 
und die DEF-Datei:

CPP-Datei:
/*
program:				dlltest
language:       borland c++
compiler:     	bc 4.5
operating sys.: windows 16 Bit
tested:         windows 95
author:         schwab andreas
date:           1996-02-17
action:         beispielprogramm zum einbinden einer delphi-dll
release:				1.0
*/
#include <owl\owlpch.h>
#include <owl\applicat.h>
#include <owl\framewin.h>
#include <stdlib.h>
#include <c:\datas\bc45\dlltest\dlltest.rc>

int FAR PASCAL ReadValue();

class TDLLWindow: public TWindow
{
	public:
		TDLLWindow(TWindow* parent = 0);
	protected:
		BOOL DBRun;
		void CmTest();  // botschaftsbeantwortungsfunktionen
		void CmExit();
		void CmAbout();
		DECLARE_RESPONSE_TABLE(TDLLWindow);
};

DEFINE_RESPONSE_TABLE1(TDLLWindow, TWindow)
	EV_COMMAND(CM_TEST, CmTest),
	EV_COMMAND(CM_EXIT, CmExit),
	EV_COMMAND(CM_ABOUT, CmAbout),
END_RESPONSE_TABLE;

/*
constructor:		tdllwindow::tdllwindow
task:						instantiiert tdllwindow
*/
TDLLWindow::TDLLWindow(TWindow* parent)
{
	Init(parent, 0, 0);  // instantiiert das fenster
}

void TDLLWindow::CmTest()
{
	int valueI;
	valueI = 1;
	ReadValue();
	//MessageBox("Feature not implemented", "Test", MB_OK);
}

void TDLLWindow::CmExit()
{
	MessageBox("Feature not implemented", "Exit", MB_OK);
}

void TDLLWindow::CmAbout()
{
	MessageBox("Feature not implemented", "About", MB_OK);
}

class TMyApp: public TApplication
{
	public:
		TMyApp():	TApplication() {}
		void InitMainWindow();
};

void TMyApp::InitMainWindow()
{
	SetMainWindow(new TFrameWindow(0, "DLL Test", new TDLLWindow));
	GetMainWindow()->AssignMenu("COMMANDS");
}

int OwlMain(int /*argc*/, char* /*argv*/ [])
{
	return TMyApp().Run();
}

DEF-Datei:
IMPORTS
	ReadValue=DELPHDLL.ReadValue

STACKSIZE 6144
Re: Wie verwende ich mit Delphi erstellte DLLs? Funktioniert nicht so wie dokumentiert!
#1720
Author: Stefan Oblinger
Date: Fri, 01 Mar 1996 09:35
32 lines
1508 bytes
Hallo,
> 
> Ich habe folgendes Problem: Ich möchte gerne eine mit Delphi erstellte
> DLL (die ein Formular beinhaltet) in Borland C++ 4.5 einbinden. Die
> Sache funktioniert jedoch nicht. Ich erhalte immer folgende
> Fehlermeldung:
> 
> Linker Error: Undefinde symbol readvalue() in module DLLTEST.CPP

Hier liegt der Fehler:
> int FAR PASCAL ReadValue();

Probiers mal mit;
  extern "C" int FAR PASCAL ReadValue();

Der Speicherklassen-Spezifizierer ist notwendig, da DLLTEST ein
C++ Programm ist und somit bei den Funktionsnamen eine Namensersetzung 
durchfuehrt (Schlagwort "name mangling"). Deswegen auch der Fehler
"undefined symbol". 


ich hoffe, das loest das Problem

-- 
smail   Stefan Oblinger, Ferdinand-Sauerbruch-Weg 1 (G26), 89075 Ulm
email   Stefan.Oblinger@sol.wohnheim.uni-ulm.de
phone   (0731) 59307
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads