S
so hab mir den link von elise mal angesehen hat mir zwar weitergeholfen aber der von dev c++ erstellten dll gibt es scon unterschiede im aufbau ich poste daher mal beide dateien
DLL.H
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
class DLLIMPORT DllClass
{
public:
DllClass();
virtual ~DllClass(void);
private:
};
#endif /* _DLL_H_ */
DLLMAIN.CPP
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>
DllClass::DllClass()
{
}
DllClass::~DllClass ()
{
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
und wenn ich versuche wie im beispiel von elise die funktion dort hinzuklatschen gibts gleich ne fehlermeldung
also die funktionen die dort in der dll haben will sehen alle ungefähr so aus
std::string ForumThreat(std::string body, std::string catID, std::string catTITEL, std::string threatID, std::string threatTITEL)
{
std::string dat_ein;
char * token;
char sLine[256];
char Trenner[] = "|@|";
dat_ein = "forum/cat" + catID + "/threat" + threatID + ".txt";
ifstream Datei(dat_ein.c_str());
body +="<center>";
body +="<table border='0' width='760' cellpadding='0' cellspacing='0'>";
body +="<tr>";
body +=" <td class='logo' id='head' align='left'>";
body +=" <h1><a href='/Forum/?catID=";
body += catID;
body +="' title='Skippy - sagt: das macht spaß'>SKIPPSerV - Test Forum - ";
body += catTITEL;
body +=" - ";
body += threatTITEL;
body +="<span></span></a></h1>";
body +=" </td>";
body +="</tr>";
body +="<tr>";
body +="<td align='left'>";
body +="<div class='BigPhorumForumTitle'><strong>SKIPPSerV Beta version Forum</strong></div>";
body +="<br />";
body +="<table width='100%' cellspacing='0' cellpadding='3' border='0'><tr>";
body +=" <td nowrap='nowrap' align='left' bgcolor='#f2f2f2'><FONT color='#267e9b' class='PhorumNav'> <a href='index.php?f=0'><FONT color='#267e9b' class='PhorumNav'>Forum List</font></a> | <a href='post.php?f=6'><FONT color='#267e9b' class='PhorumNav'>New Topic</font></a> | <a href='list.php?f=6'><FONT color='#267e9b' class='PhorumNav'>Topics List</font></a> | <a href='search.php?f=6'><FONT color='#267e9b' class='PhorumNav'>Search</font></a> | <a href='login.php?f=6'><FONT color='#267e9b' class='PhorumNav'>Log In</font></a> </font></td>";
body +=" <td nowrap='nowrap' align='right' bgcolor='#f2f2f2'><FONT color='#267e9b' class='PhorumNav'> <a href='read.php?f=6&t=2256&a=1'><FONT color='#267e9b' class='PhorumNav'>Newer Topic</font></a> | <a href='read.php?f=6&t=2256&a=2'><FONT color='#267e9b' class='PhorumNav'>Older Topic</font></a> </font></td>";
body +="</tr></table>";
if ( !Datei )
{
cout << "Kann Datei ( " << dat_ein << " ) nicht öffnen" << endl;
}
while(!Datei.eof())
{
Datei.getline(sLine, 256);
//cout << "Zeile :" << sLine << endl;//für debugzwecke
// Zeile auseinandernehmen.
token = strtok(sLine, Trenner);
body +="<a name='reply_2256'></a>";
body +="<table class='PhorumListTable' width='100%' cellspacing='0' cellpadding='2' border='0'>";
body +="<tr>";
body +=" <td bgcolor='#31a2c6'><FONT class='PhorumTableHeader' color='#FFFFFF'> ";
body += token;//Titel des Posts
body +="</font></td>";
body +="</tr>";
body +="<tr>";
body +=" <td bgcolor='#FFFFFF' valign='TOP'><table width='100%' cellspacing='0' cellpadding='5' border='0'>";
body +="<tr>";
body +=" <td bgcolor='#FFFFFF' width='100%' valign='top'><font class='PhorumMessage' color='#303030'>";
body +="Author: <a href='http://forum.pspad.com/profile.php?f=6&id=1'>";
token = strtok(NULL, Trenner);
body += token;//Author
body +="</a> (---.brno.tiscali.cz)<br />";
body +="Date: ";
token = strtok(NULL, Trenner);
body += token;//Datum
body +="<br />";
token = strtok(NULL, Trenner);
body += token;//Text
body +="<br /><br /></font><p>";
body +="</td>";
body +="</tr>";
body +="</table>";
body +="</td>";
body +="</tr>";
body +="<tr>";
body +=" <td valign='TOP' width='100%' align='RIGHT' bgcolor='#FFFFFF'>";
body +=" <a href='read.php?f=6&i=2256&t=2256#REPLY'><FONT color='#303030' class='PhorumNav'>Reply To This Message</a></font>";
body +=" <br />";
body +="</td>";
body +="</tr>";
body +="</table>";
body +="<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
body +="<tr>";
body +=" <td width='100%'><FONT color='#303030' class='PhorumNav'> </font></td>";
body +="</tr>";
body +="</table>";
while( token != NULL )//entfernt überflüssige token um fehler zu vermeiden
{
//cout << "Token = " << token << endl;// für debug zwecke
token = strtok(NULL, Trenner);
}
}
return body;
}