|
You can teach yourself C++. In fact that's the only way I guess. Even if you have gone for some private course, you'd need to do a lot on your own in the way of self-teaching and books and MSDN and code-project before you can be a moderately competent C++ programmer
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I had one basic C++ course in school but for the most part I've learned though books and experience.
|
|
|
|
|
Yes, I'm completely self taught and everyone at work, although they went to uni, got there knowing a lot from teaching themself. To survive in IT you need to *keep* learning your entire career, so if you can't teach yourself, you're kinda screwed.
I believe that there is a Tetris game here on CP. Yes, Pong is probably easier still, although not by much. Calculating the bounce of the ball convincingly is probably more painful than figuring if a Tetris block fits in a certain space.
A game is always a big thing to start with though, you need graphics, you need sound, you'll probably want to use DirectDraw, etc. You're better off IMO trying some non game stuff first. To give you an idea, I did a fair bit of non-game stuff to learn and when I did try a game, I was able to do a reasonable Asteroids. Had I started with that, I'd probably have given up in despair, but I kenw how a lot of other stuff fit together so I was able to concentrate on graphics and physics.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I'm a self taught programmer. However I had the easier route of moving from Sinclair Basic, to Turbo Pascal, to Turbo C, to Borland C++ and then onto Visual C++. It is a lot easier if you start at the bottom, sadly that isn't so easy nowadays. I remember my early days of the move from Pascal to C. C was a very scary language to me back then.
My advice, stick with the breakout program. Breakout is a much simplier app than Tetris. However learning to program by writing a game is very difficult, especially a Windows game if DirectX is involved.
Feel free to ask questions though, that is the best way to keep on learning.
Michael
|
|
|
|
|
If you want to start with C++ start with Sams Teach Yourself C++ in 24 Hours Second Edition. For game programming I would look for a Tearch Yourself DirectX. Another good book that teaches MFC is Teach Yourself Visual C++ 6 in 21 Days. If you can find it look for Game Programming Starter Kit from Macmillan Software 4.0 gives you VC++ in 21 and DX in 24 but 5.0 is the current version. It also has some game programming tools.
-Matt Newman
-Matt Newman
|
|
|
|
|
|
You send/post WM_CLOSE to a window when you want to close it. Normally the WM_CLOSE handler then calls DestroyWindow which sends a WM_DESTROY message to the window. later the WM_NCDESTROY message is sent. This is the last message that window receives
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I use WM_CLOSE to ask the user if they want to save the document they are working on. If they click cancel I don't call DestroyWindow and the program returns to its previous state. I use WM_DESTROY to release all my resources.
|
|
|
|
|
I am creating a utility that does not have a main window. I show different dialogs, one after the other, depending on the situation. It seems the 1st put up dialog gets to be the taskbar button. I would like the next dialog to get its own taskbar button, but I can't figure out how to do it.
Please enlighten me,
Cathy
Cathy
|
|
|
|
|
|
Thanks, but I already tried that with no luck. I changed it in the .rc file. Was that the correct place?
Cathy
|
|
|
|
|
I want to get the title of Internet Explorer:
#include <windows.h>
LPSTR strIE;
LPSTR str2;
HWND IE;
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
IE = FindWindow("IEFrame",NULL);
if( IE != NULL )
{
GetWindowText(IE, strIE, GetWindowTextLength(IE));
MessageBox(NULL, (LPCTSTR) strIE,"",MB_OK);
}
return 0;
}
But no MessageBox(...) at all will appear!
What is wrong?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
The problem is that your whole app should be exploding. You haven't actually allocated any memory for your string, so the behavior will certainly be unexpected. Try allocating enough space for the string first then calll GetWindowText passing in the amount of space you actually allocated then do the message box then remember to clean up the memory you allocated. A good start would be to learn C/C++ programming before jumping head first into windows development.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
Since the IEframe does not belong to your app's process you need to send the WM_GETTEXT message to the hwnd of the IE. This is the correct way:
TCHAR wndText[512];
::SendMessage(IE,WM_GETTEXT,sizeof(wndText)/sizeof(TCHAR),(LPARAM)(void*)wndText);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello, the codegurus around the world.;)
I think that your approaches works to get the text in Edit box as
Paul Delicika sais in MSDN artile.
The following code works for me.
void CCodeTestDlg::OnOK()
{
CString ieTitle;
TCHAR title[MAX_PATH];
CWnd *pWnd = CWnd::FindWindow ("IEFrame",NULL);
if (pWnd) {
MessageBox ("IE is opened!", "Info");
pWnd->GetWindowText (ieTitle);
GetDlgItem (IDC_MYSTATIC)->SetWindowText (ieTitle);
::GetWindowText (pWnd->m_hWnd, title, MAX_PATH);
MessageBox (title, "Test");
}
else {
MessageBox ("IE isn't opened!", "Info");
}
}
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Hi All!
under MS Visual Studio, we have a tool call Package Deployment Wizard for Visual Basic. This tool helps make a setup package for an EXE file of VB. It attaches all the dll files to the VB exe file basically. Do we have anything like that for VC++? I ask this because one of my applications does not run under NT4.0 SP6 when I compile it using "use MFC in a shared dll". The file needed is MFC42.dll;
Thanks
Vu
vucsuf
|
|
|
|
|
There is InstallShield for this.
I vote pro drink
|
|
|
|
|
Hi!
I use install shield to make setup disk. However, the installed package does not fix the problem. The OS still complains about the MFC42.dll
Do I miss anything?
Thanks
Vu
vucsuf
|
|
|
|
|
VC++ 7 has a built-in setup feature, that should be enough for most deployment needs.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvc60/html/redistribvc6.asp
and
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q259403
Now hopefully I will have enough good karma for someone to answer my question.
Cathy
|
|
|
|
|
I have to detect if there is a RAS connection active on the machine, so I wrote the following code
RASCONN * lpRasConn;
DWORD lpcb;
DWORD lpcConnections;
lpRasConn = (LPRASCONN) GlobalAlloc(GPTR, sizeof(RASCONN));
lpRasConn->dwSize = sizeof(RASCONN);
lpcb = sizeof(RASCONN);
int nRet = RasEnumConnections(lpRasConn, &lpcb, &lpcConnections);
if (nRet != 0)
{
TRACE("RasEnumConnections failed: Error = %d", nRet);
return(FALSE);
}
else
{
TRACE("The following RAS connections are currently active\n\n");
return(TRUE);
for (DWORD i = 0; i < lpcConnections; i++)
{
TRACE("Entry name: %s\n", lpRasConn->szEntryName);
lpRasConn++;
}
return(TRUE);
}
The fuction fails everytime and I always have the same error message (even I test it on different computers)
the message is "632 : The structure size is incorrect".
Any help would be great..
Thanks,
Fakhri
The best way to predict the future is to create it..
|
|
|
|
|
Hello, the codegurus aroudn the world.;)
This is the latest RASCONN struct.
typedef struct _RASCONN {
DWORD dwSize;
HRASCONN hrasconn;
TCHAR szEntryName[RAS_MaxEntryName + 1];
#if (WINVER >= 0x400)
TCHAR szDeviceType[ RAS_MaxDeviceType + 1 ];
TCHAR szDeviceName[ RAS_MaxDeviceName + 1 ];
#endif
#if (WINVER >= 0x401)
TCHAR szPhonebook [ MAX_PATH ];
DWORD dwSubEntry;
#endif
#if (WINVER >= 0x500)
GUID guidEntry;
#endif
#if (WINVER >= 0x501)
DWORD dwSessionId;
DWORD dwFlags;
LUID luid;
#endif
} RASCONN ;
So, if we didn't download the latest Microsoft SDK, and didn't get the ras.h file, RASCONN struct size may be conflicted in rasapi32.dll in OS.
To avoid this kind of the conflict, you may be better explicit intialization of RASCONN struct in your code. Otherwise, you had better install the latest Microsoft SDK.
However, this is my guess.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Thank you, it was helpful
The best way to predict the future is to create it..
|
|
|
|
|
i have implemented the funcion in my filter driver.
a problem is i need to change the shell's activity.
when user only press DEL, the shell will not send the
file to recycle and delete forever.
i know i can change the recycle's propertiy. but i want to
set that value in program and not allow user to set back.
how can i do this? thanks.
|
|
|
|
|
The following code:
// Get file accessed date from _stat
struct _stat buff;
_tstat ( (TCHAR*)m_szFilePath, &buff);
TCHAR* l_szTime = _tctime(&buff.st_atime);
TCHAR* p_eol = _tcsstr(l_szTime, _T("\n"));
// Remove the '\n' from the end of the returned string from atime.
*p_eol = L'\0';
// Return the file accessed date.
*p_szDate = (_bstr_t) l_szTime;
produces Fri Dec 07 11:23:13 2001.
Does anyone know how to get the prettier way Properties does it? (Today, December 7, 2001, 11:23 AM)
Please let me know if there is such a way. If not, does someone know of any code that does the formatting?
Thanks,
Lilian
|
|
|
|