Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 04:55

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[GER]Dll-Funktion funzt net

Discussion on [GER]Dll-Funktion funzt net within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2008
Posts: 4
Received Thanks: 1
[GER]Dll-Funktion funzt net

habe folgendes problem:
wenn ich die funktion meiner dll mittels cmd aufrufe also rundll32 testdll.dll,HelloWorld

sagt er mir dass der eintrag HelloWorld nicht funzt und auch wenn ich meine dll in andere prozesse injecte wie zb notepad oder eigene progs passiert nichts oder sie stürzen ab.

benutze Windows Vista Home Premium 32bit und dev-c++

hier ist der code der dll
Code:
//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 */

DLLIMPORT void HelloWorld(void);

class DLLIMPORT DllClass
{
  public:
    DllClass();
    virtual ~DllClass(void);

  private:

};


#endif /* _DLL_H_ */
und dllmain.cpp
Code:
#include "dll.h"
#include <windows.h>

DLLIMPORT void HelloWorld ()
{
    MessageBox (0, "HelloWorld", "HelloWorld", MB_ICONINFORMATION);
}



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:
           HelloWorld();
        break;

      case DLL_PROCESS_DETACH:
           HelloWorld();
        break;

      case DLL_THREAD_ATTACH:
           HelloWorld();
        break;

      case DLL_THREAD_DETACH:
           HelloWorld();
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}
dazu sollte ich noch sagen dass ich anfänger in sachen dll bin^^
deathcruzer is offline  
Old 01/05/2009, 16:13   #2
 
elite*gold: 0
Join Date: May 2008
Posts: 489
Received Thanks: 210
Was soll die Klasse dort? Und warum willst du HelloWorld importieren? Wenn überhaupt mächte ein Export Sinn. Wenn du nur deine Funktion bei Attach usw. callen willst, reicht das aus:

Code:
#include <windows.h>

void HelloWorld ()
{
    MessageBox (0, "HelloWorld", "HelloWorld", MB_ICONINFORMATION);
}

BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
    if(NULL != reason)
        HelloWorld();
    return TRUE;
}
Hier gibt's ein schönes .
schlurmann is offline  
Old 01/05/2009, 16:29   #3
 
elite*gold: 0
Join Date: Feb 2008
Posts: 4
Received Thanks: 1
danke für das tut ich werds mir mal durchlesen gibt soviele tuts und meistens wirds nur flüchtig erklärt
deathcruzer is offline  
Reply


Similar Threads Similar Threads
cryptload funktion
09/07/2010 - General Coding - 2 Replies
hey, hab mal ne frage. Also in cryptload gibt es die reconnect funktion, damit der Router reconnected(neue Ip). Kann man einen "bot" schreiben das er dieses automatisch in einem bestimmten interval macht z.B alle 5 min. und dann nach dem reconnecten eine internet Seite öffnet und wieder schliest.müsste anversich einfach zu coden sein hab aber keine Ahnung vom coden:( mfg goro93
[C++]Funktion einer Klasse in einer anderen Funktion der Klasse verwenden, aber wie?
07/25/2010 - C/C++ - 3 Replies
Mein Problem ist eigentlich recht simpel und die Lösung wahrscheinlich auch. Da ich bisher fast 0 mit Klassen am Hut hatte, wollte ich mich doch mit dem Thema anfreunden und hatte gleich angefangen: int test::Funktion2() { int temp; cin>>temp; return temp; }
No DC sro_client not funktion why???????????????????????????????
06/13/2009 - Silkroad Online - 1 Replies
Why my no dc_sro_client no funktion???
[C++] Funktion aus DLL laden
11/29/2008 - C/C++ - 5 Replies
Ich möchte eine Funktion (URLDownloadToFile) aus einer DLL laden (urlmon.dll). Dazu benutze ich LoadLibrary() und GetProcAddress(). Ich habe nun folgendes Problem... #include <cstdlib> #include <iostream> #include <windows.h> #include <stdio.h> using namespace std;
Mob Log Funktion!
11/03/2008 - Metin2 - 7 Replies
Hi Leute, habe eine wichtige Frage. Wieso werde ich immer nach 1mal aura oder 1mal sk gekickt? Ihc werde sowohl bei hoher serverauslastung als auch bei niedriger gekickt ennt einer einen Tipp wie ich kicks umgehen kann???:confused:



All times are GMT +1. The time now is 04:56.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.