| View previous topic :: View next topic |
| Author |
Message |
TehBlue Newbie cheater
Reputation: 0
Joined: 14 Jul 2008 Posts: 10
|
Posted: Sat Dec 13, 2008 10:28 pm Post subject: How do you use resource files? |
|
|
well i made an .rc file but i didnt know how to use so my window would look like what i made in the rc file. so if anyone knows how or has a tut could you please tell me? Im also use VC++
Thanks in advance
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Sat Dec 13, 2008 10:42 pm Post subject: |
|
|
A resource.h file also should have been made. Include this in your main source file, and call a function like CreateDialog.
See my blog for a tut.
|
|
| Back to top |
|
 |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Sat Dec 13, 2008 11:05 pm Post subject: |
|
|
if u are using VSC++ 2008 express, u won't be able to access resource editing/design wihtout the use of 3rd party program ie resedit.
i suggest you get VSC++ pro. it has everything you need.
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils |
|
| Back to top |
|
 |
TehBlue Newbie cheater
Reputation: 0
Joined: 14 Jul 2008 Posts: 10
|
Posted: Sun Dec 14, 2008 10:41 am Post subject: |
|
|
I got this error
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
this is my winmain:
| Code: |
bool WINAPI MainWin(HINSTANCE hInstance,DWORD fdwReason,LPVOID lpvReserved)
{
DisableThreadLibraryCalls(hInstance);
DialogBox(hinstDLL, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)WindowProcedure);
return 0;
}
|
What did i do wrong?
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Sun Dec 14, 2008 10:48 am Post subject: |
|
|
| You're making a .dll or .exe? and you're making a win32 project? right?
|
|
| Back to top |
|
 |
TehBlue Newbie cheater
Reputation: 0
Joined: 14 Jul 2008 Posts: 10
|
Posted: Sun Dec 14, 2008 11:12 am Post subject: |
|
|
im makeing an exe and its a win32 project
Edit:
i followed another tut and it compiles but it dosnt show the GUI
|
|
| Back to top |
|
 |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Sun Dec 14, 2008 1:56 pm Post subject: |
|
|
| Code: | BOOL CALLBACK DlgProcMain(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER( lParam );
mainwindow=hWnd;
switch( uMsg )
{
case WM_INITDIALOG:
{
ShowWindow(hWnd,SW_SHOW);
}
return TRUE;
case WM_COMMAND:
//this will handle the command buttons that are part of the dialog
switch( wParam )
{
case WM_QUIT:
EndDialog(hWnd,0);
return TRUE;
case WM_DESTROY:
//we need the messages for handling when the dialog is destroyed
EndDialog(hWnd,0);
return TRUE;
}
break;
}
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
UNREFERENCED_PARAMETER( hPrevInstance );
UNREFERENCED_PARAMETER( lpCmdLine );
UNREFERENCED_PARAMETER( nShowCmd );
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG), 0, (DLGPROC)DlgProcMain, NULL );
return ERROR_SUCCESS;
} |
fix your settings if u still have link error
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Last edited by Bizarro on Sun Dec 14, 2008 3:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Sun Dec 14, 2008 2:19 pm Post subject: |
|
|
| Code: | | ShowWindow(hWnd,SW_HIDE); |
Why do you have this?
|
|
| Back to top |
|
 |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Sun Dec 14, 2008 3:41 pm Post subject: |
|
|
| smartz993 wrote: | | Code: | | ShowWindow(hWnd,SW_HIDE); |
Why do you have this? |
opps should be SW_SHOW lol. i had this on my other window
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils |
|
| Back to top |
|
 |
TehBlue Newbie cheater
Reputation: 0
Joined: 14 Jul 2008 Posts: 10
|
Posted: Sun Dec 14, 2008 9:12 pm Post subject: |
|
|
| i got it guys thx for your help
|
|
| Back to top |
|
 |
Travis13 Expert Cheater
Reputation: 0
Joined: 17 Feb 2007 Posts: 199
|
Posted: Sun Dec 14, 2008 10:33 pm Post subject: ? |
|
|
im actually still wondering on how to make a dialog with resedit and like.......make it work with my main.cpp.
example. i just made a little c++ application that if u press f1 is starts a timer/counter.........f2=stop and f3=close the program........how could i create a dialog in resedit that would show those things and stuff? its actually really confusing to me :S
_________________
Learning C++, trying, failing, never gonna give up tho  |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
Travis13 Expert Cheater
Reputation: 0
Joined: 17 Feb 2007 Posts: 199
|
Posted: Sun Dec 14, 2008 10:54 pm Post subject: |
|
|
im looking for using resedit as i said........and i want to just make dialogs like kitterz trainer..........not some ugly window (dont get me wrong u can make them sexy it would just take a lot longer)
_________________
Learning C++, trying, failing, never gonna give up tho  |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Dec 14, 2008 11:30 pm Post subject: |
|
|
| Travis13 wrote: | | im looking for using resedit as i said........and i want to just make dialogs like kitterz trainer..........not some ugly window (dont get me wrong u can make them sexy it would just take a lot longer) |
how about you actually look at the link? It explains dialogs
|
|
| Back to top |
|
 |
Travis13 Expert Cheater
Reputation: 0
Joined: 17 Feb 2007 Posts: 199
|
Posted: Sun Dec 14, 2008 11:49 pm Post subject: |
|
|
thanks for assuming but i have already looked at the link and as i said...i just want to learn how to use resedit with pair it up with my sources to make dialogs.......i want a generator for now...so i can look at them after and stuff......then learn them later
_________________
Learning C++, trying, failing, never gonna give up tho  |
|
| Back to top |
|
 |
|