Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] Trying to intialize a form

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Thu Jan 13, 2011 8:56 am    Post subject: [C++] Trying to intialize a form Reply with quote

My forte is C# but I decided to give it at try at C++


this is what I got so far but I just cant get it to work. I'm getting this:

"1>Test.cpp(9): error C3861: 'StartForm': identifier not found"

this is my code

Code:
#include "Test.h"

using namespace MapleAgain;

#pragma managed(push, off)
void WINAPI MyThread ()
{
        ::MessageBox(NULL, L"Ok Injected", L"Testing", MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
        StartForm();
       
}
#pragma managed(push, off)
bool WINAPI DllMain ( HMODULE hModule, DWORD dwReason, LPVOID lpvReserved )
{
     
    switch ( dwReason ) {
     
        case DLL_PROCESS_ATTACH:
         
            DisableThreadLibraryCalls(hModule);

           

            if ( CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MyThread, NULL, 0, NULL) == NULL ) {
           return FALSE;
            }

            break;

        case DLL_PROCESS_DETACH:
            break;

        case DLL_THREAD_ATTACH:
            break;

        case DLL_THREAD_DETACH:
            break;
    }


    return TRUE;
}


#pragma managed
void StartForm()
{
   
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);
    Application::Run(gcnew Test());
   
}
Back to top
View user's profile Send private message MSN Messenger
Jesper
Grandmaster Cheater Supreme
Reputation: 9

Joined: 21 Feb 2007
Posts: 1156

PostPosted: Thu Jan 13, 2011 9:04 am    Post subject: Reply with quote

Try putting "void StartForm();" bellow "using namespace MpleAgain; ". C++ doesn't check the entire scope, it only checks "above". When I made FormulaPyPQ I made a resource dialog as a form and called DialogBox.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Thu Jan 13, 2011 9:09 am    Post subject: Reply with quote

omg I can't believe that actually worked .____.

thanks
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites