| View previous topic :: View next topic |
| Author |
Message |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 2:07 pm Post subject: DLL Console/GUI making? |
|
|
Hey guys,
I cant believe i dont know how to do that,
I'm trying to make a dll but i dont know how to make a console dll or dll with gui X_X
Anyone knows how to make a console in my dll or a gui?
like JAAC and such.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Mar 09, 2008 2:10 pm Post subject: |
|
|
Console - AllocConsole();
GUI: WNDCLASSEX struct, RegisterClassEx(), and CreateWindowEx().
Create a new thread on DLL_PROCESS_ATTACH that calls these functions.
_________________
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 2:11 pm Post subject: |
|
|
Yay,thank u
If i'll use the gui function i'll need to design it by codes right?
cuz i hate coding guis
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 2:11 pm Post subject: |
|
|
| OK,You can lock to avoid spam.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Mar 09, 2008 2:14 pm Post subject: |
|
|
| Aviram wrote: | Yay,thank u
If i'll use the gui function i'll need to design it by codes right?
cuz i hate coding guis  |
You can use a Dialog if you want from resources
Create a new thread at DLL_PROCESS_ATTACH that calls a function that calls DialogBox() - http://msdn2.microsoft.com/en-us/library/ms645452(VS.85).aspx
and create your own DialogProcedure Handler.
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sun Mar 09, 2008 2:21 pm Post subject: |
|
|
GUI: myWXWindow->Show();
:P
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 2:27 pm Post subject: |
|
|
Hmm,for some reason the console wont get open,
My dllmain.cpp:
| Code: |
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH: void console();
case DLL_THREAD_ATTACH: void console();
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
|
my memty.cpp:
| Code: |
#include "stdafx.h"
#include <iostream>
using namespace std;
void console()
{
BOOL WINAPI AllocConsole(void);
}
|
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Mar 09, 2008 2:32 pm Post subject: |
|
|
| Code: | #include <windows.h>
#pragma comment (linker, "/ENTRY:DllMain")
void Console()
{
AllocConsole();
// rest of ur shit here.
}
BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
UNREFERENCED_PARAMETER( hModule );
UNREFERENCED_PARAMETER( lpReserved );
switch( dwReason )
{
case DLL_PROCESS_ATTACH:
CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)Console, 0, 0, 0 );
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
} |
_________________
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 2:59 pm Post subject: |
|
|
| Game crashes ? O_o
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Mar 09, 2008 9:45 pm Post subject: |
|
|
Try changing the thread routine to a DWORD instead of void:
| Code: | DWORD Console()
{
AllocConsole();
// .. Other Code Here ..
return 0;
} |
I ran into this issue with using void as my thread type. Alternatively, you could also try changing the CreateThread line to:
| Code: | | CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)&Console, NULL, NULL, NULL ); |
_________________
- Retired. |
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Mar 09, 2008 11:28 pm Post subject: |
|
|
| Code: | case DLL_PROCESS_ATTACH:
CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)&Console, NULL, NULL, NULL );
Console(); // <<< added this line
break; |
now it starts console and closes maple second after the console gets open? o_o
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Mon Mar 10, 2008 2:28 am Post subject: |
|
|
| Why in the world are you running Console() twice?
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Mon Mar 10, 2008 7:45 am Post subject: |
|
|
OH FINNALY!
Thank you x0r.
|
|
| Back to top |
|
 |
|