IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Ah yes a C++ tutorial for VB programmers.
[link|http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=42500&lngWId=1|http://www.planetsou...Id=42500&lngWId=1]

C++ Tutorial for VB programmers. Yeah! Good loving! :)



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Re: Ah yes a C++ tutorial for VB programmers.
That looks exactly like a C++ for Windows book I read 12 years ago.

Norm, there are no silver bullets. If you want to learn C++, your VB knowledge is worthless, and in any case, to learn C++ at this stage is pointless. Why do you keep beating up the same thing over and over? STOP.

OK I glanced over this. It's stupid and useless for learning. It's all in the Windows environment and it's the Windows-ized C++ style, which is horrible. You can do the same things with VB by calling API functions, so what the hell does this buy you?

Now for some real C++ on Windows code.
\n// This is a part of the Microsoft Foundation Classes C++ library.\n// Copyright (C) 1992-1998 Microsoft Corporation\n// All rights reserved.\n//\n// This source code is only intended as a supplement to the\n// Microsoft Foundation Classes Reference and related\n// electronic documentation provided with the library.\n// See these sources for detailed information regarding the\n// Microsoft Foundation Classes product.\n\n#include "stdafx.h"\n\n#ifdef AFX_CORE2_SEG\n#pragma code_seg(AFX_CORE2_SEG)\n#endif\n\n#ifdef _DEBUG\n#undef THIS_FILE\nstatic char THIS_FILE[] = __FILE__;\n#endif\n\n#define new DEBUG_NEW\n\n/////////////////////////////////////////////////////////////////////////////\n// CMultiDocTemplate construction/destruction\n\nCMultiDocTemplate::CMultiDocTemplate(UINT nIDResource, CRuntimeClass* pDocClass,\n\tCRuntimeClass* pFrameClass, CRuntimeClass* pViewClass)\n\t\t: CDocTemplate(nIDResource, pDocClass, pFrameClass, pViewClass)\n{\n\tASSERT(m_docList.IsEmpty());\n\n\tm_hMenuShared = NULL;\n\tm_hAccelTable = NULL;\n\tm_nUntitledCount = 0;   // start at 1\n\n\t// load resources in constructor if not statically allocated\n\tif (!CDocManager::bStaticInit)\n\t\tLoadTemplate();\n}\n\nvoid CMultiDocTemplate::LoadTemplate()\n{\n\tCDocTemplate::LoadTemplate();\n\n\tif (m_nIDResource != 0 && m_hMenuShared == NULL)\n\t{\n\t\tHINSTANCE hInst = AfxFindResourceHandle(\n\t\t\tMAKEINTRESOURCE(m_nIDResource), RT_MENU);\n\t\tm_hMenuShared = ::LoadMenu(hInst, MAKEINTRESOURCE(m_nIDResource));\n\t\tm_hAccelTable =\n\t\t\t::LoadAccelerators(hInst, MAKEINTRESOURCE(m_nIDResource));\n\t}\n\n#ifdef _DEBUG\n\t// warnings about missing components (don't bother with accelerators)\n\tif (m_hMenuShared == NULL)\n\t\tTRACE1("Warning: no shared menu for document template #%d.\\n",\n\t\t\tm_nIDResource);\n#endif //_DEBUG\n}\n\nCMultiDocTemplate::~CMultiDocTemplate()\n{\n#ifdef _DEBUG\n\tif (!m_docList.IsEmpty())\n\t\tTRACE1("Warning: destroying CMultiDocTemplate with %d documents alive.\\n",\n\t\t\tm_docList.GetCount());\n#endif\n\t// delete shared components\n\tif (m_hMenuShared != NULL)\n\t\t::DestroyMenu(m_hMenuShared);\n\tif (m_hAccelTable != NULL)\n\t\t::FreeResource((HGLOBAL)m_hAccelTable);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// CMultiDocTemplate attributes\n\nPOSITION CMultiDocTemplate::GetFirstDocPosition() const\n{\n\treturn m_docList.GetHeadPosition();\n}\n\nCDocument* CMultiDocTemplate::GetNextDoc(POSITION& rPos) const\n{\n\treturn (CDocument*)m_docList.GetNext(rPos);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// CMultiDocTemplate document management (a list of currently open documents)\n\nvoid CMultiDocTemplate::AddDocument(CDocument* pDoc)\n{\n\tASSERT_VALID(pDoc);\n\n\tCDocTemplate::AddDocument(pDoc);\n\tASSERT(m_docList.Find(pDoc, NULL) == NULL); // must not be in list\n\tm_docList.AddTail(pDoc);\n}\n\n\nvoid CMultiDocTemplate::RemoveDocument(CDocument* pDoc)\n{\n\tASSERT_VALID(pDoc);\n\n\tCDocTemplate::RemoveDocument(pDoc);\n\tm_docList.RemoveAt(m_docList.Find(pDoc));\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// CMultiDocTemplate commands\n\nCDocument* CMultiDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName,\n\tBOOL bMakeVisible)\n{\n\tCDocument* pDocument = CreateNewDocument();\n\tif (pDocument == NULL)\n\t{\n\t\tTRACE0("CDocTemplate::CreateNewDocument returned NULL.\\n");\n\t\tAfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);\n\t\treturn NULL;\n\t}\n\tASSERT_VALID(pDocument);\n\n\tBOOL bAutoDelete = pDocument->m_bAutoDelete;\n\tpDocument->m_bAutoDelete = FALSE;   // don't destroy if something goes wrong\n\tCFrameWnd* pFrame = CreateNewFrame(pDocument, NULL);\n\tpDocument->m_bAutoDelete = bAutoDelete;\n\tif (pFrame == NULL)\n\t{\n\t\tAfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);\n\t\tdelete pDocument;       // explicit delete on error\n\t\treturn NULL;\n\t}\n\tASSERT_VALID(pFrame);\n\n\tif (lpszPathName == NULL)\n\t{\n\t\t// create a new document - with default document name\n\t\tSetDefaultTitle(pDocument);\n\n\t\t// avoid creating temporary compound file when starting up invisible\n\t\tif (!bMakeVisible)\n\t\t\tpDocument->m_bEmbedded = TRUE;\n\n\t\tif (!pDocument->OnNewDocument())\n\t\t{\n\t\t\t// user has be alerted to what failed in OnNewDocument\n\t\t\tTRACE0("CDocument::OnNewDocument returned FALSE.\\n");\n\t\t\tpFrame->DestroyWindow();\n\t\t\treturn NULL;\n\t\t}\n\n\t\t// it worked, now bump untitled count\n\t\tm_nUntitledCount++;\n\t}\n\telse\n\t{\n\t\t// open an existing document\n\t\tCWaitCursor wait;\n\t\tif (!pDocument->OnOpenDocument(lpszPathName))\n\t\t{\n\t\t\t// user has be alerted to what failed in OnOpenDocument\n\t\t\tTRACE0("CDocument::OnOpenDocument returned FALSE.\\n");\n\t\t\tpFrame->DestroyWindow();\n\t\t\treturn NULL;\n\t\t}\n\t\tpDocument->SetPathName(lpszPathName);\n\t}\n\n\tInitialUpdateFrame(pFrame, pDocument, bMakeVisible);\n\treturn pDocument;\n}\n\nvoid CMultiDocTemplate::SetDefaultTitle(CDocument* pDocument)\n{\n\tCString strDocName;\n\tif (GetDocString(strDocName, CDocTemplate::docName) &&\n\t\t!strDocName.IsEmpty())\n\t{\n\t\tTCHAR szNum[8];\n\t\twsprintf(szNum, _T("%d"), m_nUntitledCount+1);\n\t\tstrDocName += szNum;\n\t}\n\telse\n\t{\n\t\t// use generic 'untitled' - ignore untitled count\n\t\tVERIFY(strDocName.LoadString(AFX_IDS_UNTITLED));\n\t}\n\tpDocument->SetTitle(strDocName);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// CMultiDocTemplate diagnostics\n\n#ifdef _DEBUG\nvoid CMultiDocTemplate::Dump(CDumpContext& dc) const\n{\n\tCDocTemplate::Dump(dc);\n\n\tdc << "m_hMenuShared = " << (UINT)m_hMenuShared;\n\tdc << "\\nm_hAccelTable = " << (UINT)m_hAccelTable;\n\tdc << "\\nm_nUntitledCount = " << m_nUntitledCount;\n\tdc << "\\nwith " << m_docList.GetCount() << " open documents";\n\tPOSITION pos = GetFirstDocPosition();\n\twhile (pos != NULL)\n\t{\n\t\tCDocument* pDoc = GetNextDoc(pos);\n\t\tdc << "\\nwith document " << (void*)pDoc;\n\t}\n\n\tdc << "\\n";\n}\n\nvoid CMultiDocTemplate::AssertValid() const\n{\n\tCDocTemplate::AssertValid();\n\n\tPOSITION pos = GetFirstDocPosition();\n\twhile (pos != NULL)\n\t{\n\t\tCDocument* pDoc = GetNextDoc(pos);\n\t\tASSERT_VALID(pDoc);\n\t}\n}\n#endif //_DEBUG\n\n#ifdef AFX_INIT_SEG\n#pragma code_seg(AFX_INIT_SEG)\n#endif\n\nIMPLEMENT_DYNAMIC(CMultiDocTemplate, CDocTemplate)\n\n/////////////////////////////////////////////////////////////////////////////\n

You think this cretin-level "tutorial" is going to help with this? Think again.

You'd be far better off learning web programming idioms than this low-level Windows horseshit.
-drl
Expand Edited by deSitter Jan. 28, 2004, 11:07:36 PM EST
New Well it is a start
but you are right it did not cover MFC classes, etc. It is just enough to get my feet wet.

So should I stick with VB or try to learn something else at this point?



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New No, it is NOT a start
It's precisely the opposite - an END, the final disgusting morphing of C into something worthless and unusable by a company of monopolists who are primarily responsible for the current fetid state of personal computing.

C++ can be a decent language if used right. It it worth learning in its proper realm. But, first you have to know C. Do you? There is no way you can do C++ at any level without knowing C first. There is no way you can appreciate what C++ is trying to do without knowing objects first. Do you?

Why don't you get a Linux box going and learn Python? Haven't the brilliant programmers around here like Scott and Fu raved enough about it? It's actually USEFUL. What about Todd and his raves about Smalltalk? It's USEFUL. What about Ben and his Perl gems? It's USEFUL. What about Conrad and his Delphi? If you have to stay glued to Windows like a milky tit, at least get into a worthwhile idiom. MFC and C++ on Windows are the WORST CONCEIVABLE WAY to learn C++, GUI programming, and messing with it will drive you crazy. It's SHIT SHIT SHIT from the bottom to the top.

Don't trust me, compared to them I'm a hack, but I know enough to know enough.

You want me to tell you what to do? GET THE FUCK OUT OF WINDOWS AND MAKE A LINUX BOX.
-drl
New Learning something new

C++ can be a decent language if used right. It it worth learning in its proper realm. But, first you have to know C. Do you? There is no way you can do C++ at any level without knowing C first. There is no way you can appreciate what C++ is trying to do without knowing objects first. Do you?


I know C, I got an A out of both C classes I took in community college. I admit I am a bit rusty, and am relearning how to program in C. Like a muscle, if I don't use it often enough it gets weak. It will take some time to build back up.

I looked at many C++ tutorials, but they assume the reader already knows about objects. Might as well be written in greek. I understand that a class is a definition of an object, and that methods and properties are encaspleated into objects. I also understand that new objects can be based on existing objects. Some things I am trying to grasp are polymorphism and inheritence. Objects inherit properties and methods from objects they are based on, is this right? Classes are also reusable and can help cut down on the development time of code by reusing objects from one program to another. All this is new to me and I am trying to digest it all without properly learning what objects are, as I never found a good source to explain it to me in plain English. So I pick up what I can from tutorials that already assume I know it. Of course I could have the concept of objects all wrong.


Why don't you get a Linux box going and learn Python? Haven't the brilliant programmers around here like Scott and Fu raved enough about it? It's actually USEFUL. What about Todd and his raves about Smalltalk? It's USEFUL. What about Ben and his Perl gems? It's USEFUL. What about Conrad and his Delphi? If you have to stay glued to Windows like a milky tit, at least get into a worthwhile idiom. MFC and C++ on Windows are the WORST CONCEIVABLE WAY to learn C++, GUI programming, and messing with it will drive you crazy. It's SHIT SHIT SHIT from the bottom to the top.


So many choices, Python, Smalltalk, Perl, Delphi/Kylix, etc do not forget Ruby, REXX, and many others. Not like throwing a lot of choices at me helps when I cannot make up my mind what to learn.


You want me to tell you what to do? GET THE FUCK OUT OF WINDOWS AND MAKE A LINUX BOX.


Don't you think I want to? All attempts to install Linux have met with failure so far. I am waiting until the current kernel stabilizes and is included in the distros. Then I have a choice on what distro to use, and yet again cannot make up my mind on it. SuSE, Red Hat, Debian, Lindows, Slackware, can't seem to find which one I want to use.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New just wait for the microsoft version of linux
It wont fuckin work either but you will be compfortable enough to try it I'll bet.
thanx,
bill
same old crap, con artists ripping off fools. Ah, hell, Catholic Church it start off that way. They All do. Jesus probably had three walnut shells one pea, then he's dead and can't be questioned,
Gabriel Dupre

questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New No I won't
most likely MS will charge $360 for it, and SCO will require $699 for a user license.

I just need to find the time to muck around with Linux again, last time took hours and wasted my time and fustrated me. So I am taking a big break until I have extra time to do so again. Last success I had was on my brother's system with Red Hat 9.0 but it would not run his games properly.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Pull the other one
You're either too lazy or too stupid to install Linux because deep down you love Windows.

At no point have you ever posted anything approximating a serious attempt to install Linux with proper problem reports and step-by-step stuff. Never.

If I can put Linux on an HP9000 D330 with no display hardware and a serial console and a network connection by way of connectivity, you can put it on a PC.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home Page - Now with added Zing!]
New You pull the other one
I gave exactly what the screen said. I listed the hardware used and talked about how far the install went. I honestly have no idea what you think a proper problem report looks like.

I would use my Red Hat 9.0 disks, but support is going away. Fedora may be better to download then. Only it seems to upset the SuSE and Debian lovers here when I talk about using a different distro than they use. Lindows I had considered, but I'll have to buy a copy as it is not free.

I actually tried to ask other Linux users, not here, but on #Linuxhelp on a (shudder) IRC channel on what distro to use. No replies and I was ignored. Reminds me why I hate IRC so much.

I use Windows because I already know how to troubleshoot it, I can work through botched install. I cannot seem to work through a botched install with Linux, nor is anyone willing to help me without a proper problem report or whatever the f*ck I got to do to get help, secret handshake, passphrase, and taking an oath to never run Windows again. :(



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Linux takes study
to use it. It WILL require a level of dedication from you.

If you don't want to use it, or you don't want to put the effort into learning it, that's fine - don't use it.

As for which distro - pick one. I don't care, and am not going to get pulled into a debate on which distro is better. However, most of the people on here know debian and will help you with debian problems because that's what they know. (Asking Redhat questions to Debian users isn't going to elicit a multitude of responses).

But the first question must be a desire to learn. There is NOTHING wrong with not wanting to learn Linux. If Windows works for you, why switch?
Expand Edited by Simon_Jester Jan. 30, 2004, 01:12:35 PM EST
New Why switch?
Actually I want to be able to use both. Get the best of both worlds.

I will put in the effort to learn, but my time set aside for learning is limited.

If I download Debian, will I get help from here? I am willing to fill out a problem report, if someone sends me a blank one.

I am trying to figure out DragonLinux, I did a search on distros and found it interesting. It should be one of the most painless to install due to its nature and simplicity.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Re: Why switch?
I offered you a direct solution and you refuse. Why?
-drl
New Too many choices
I made a choice, and you do not like it. What am I supposed to do run SuSE like you instead of DragonLinux? No matter what choice I make, most people here are going to be unhappy.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New No choice
You don't have to make any choices - just follow my directions to the letter. I don't even have to visit you. Once you are up I can remotely set things up with VNC or even simple telnet access. You get a Linux system, configured by an experienced person, and then you can go to town.

The differences in distributions are not important enough for a newbie to be showstoppers. They all have good and bad points.

Repeat: send me a detailed hardware report on the target system and we'll get started. You don't have to do anything at all.
-drl
Expand Edited by deSitter Jan. 30, 2004, 04:00:11 PM EST
New Let me consider it
I have to go out of town tomorrow and then study for a final exam. Will this be SuSE? Also give me some time to get data off the 98SE system before I get ready to format it.

For VNC access, I'll need the port number to punch a hole through my DSL router firewall.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Dude...
You don't fuckin care who you make happy/unhappy here. Just fuckin do it, awready!

Your ability and willingness to take on a new endeavor cannot be based on whether it will make me happy. (Unless, of course, you're planning on supporting Duh in the next election; in which case, we'll have some words!)
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating that facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
New How 2 pick a distro and get running today
Step 1:

Go to the linux forum.

Step 2:

Ask which distro most people are using. Be sure to post what kind of hardware you want to run it on.

Step 3:

Select a recommended distro and make the individuals who recommended it your coaches. Put them on the hook for walking you through it. Post specific issues as you go. You will have a working linux distro within a week (probably in a day) with this approach. You just gotta adopt a coach and keep after him. I think I see Peter volunteering in another message BTW...



.....To the future or to the past, to a time when thought is free, when men are different from one another and do not live alone -- to a time when truth exists and what is done cannot be undone:
.....From the age of uniformity, from the age of solitude, from the age of Big Brother, from the age of doublethink -- greetings!

     -- George Orwell, 1984
New Saving a step
Step #1 - Complain that Linux is too hard to install
Step #2 - Go To Step #1
New Help me pick a Linux distro (new thread)
Created as new thread #138841 titled [link|/forums/render/content/show?contentid=138841|Help me pick a Linux distro]



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New FWIW, you don't have to use Linux to use Python
But thanks for the compliment. :)

All my current work in Python is:

1) Developed on Windows, yes, but

2) Deployable on Windows or Linux, without a single modification.

Have your cake and eat it too.
New **Gak**...**choke**...*wheeze**...>>faint<<
Do you actually purport to call that C++?!?
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating that facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
New Yes
Like it or not, that's what it is. It found its natural home, like pee in a ravine.
-drl
New Beg to differ
As soon as you stumble across:
\n#define new DEBUG_NEW

You start to have your doubts about its veracity as real C++.
But then, the kicker:
\nCMultiDocTemplate::CMultiDocTemplate

And you've exitted the world of C++ and entered into the byzantine parallel universe of "Micros~1 C++ surrogate", where, to quote the old song: "The rules do not apply".
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating that facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
New Re: Beg to differ
I'm not saying it's "good" C++, just that it "is" C++. Windows is the eternal monument to C++ in the Real::World.

Note that KDE is much better C++ but only because of "slots". So that's not really C++ either.
-drl
New MFC and its templates, documents and views
is a huge unwieldy solution in the search of a problem. It allows you to write a generic "editor" with OLE, print preview and all the trimmimgs in 50 lines of code (not counting 5000 generated lines behind the scenres). Trouble is, nobody writes generic editors. And MFC is useless for anything else.
--

"...and pronounce all four E's in the word 'shit'"
     Ah yes a C++ tutorial for VB programmers. - (orion) - (24)
         Re: Ah yes a C++ tutorial for VB programmers. - (deSitter) - (23)
             Well it is a start - (orion) - (17)
                 No, it is NOT a start - (deSitter) - (16)
                     Learning something new - (orion) - (14)
                         just wait for the microsoft version of linux - (boxley) - (1)
                             No I won't - (orion)
                         Pull the other one - (pwhysall) - (8)
                             You pull the other one - (orion) - (7)
                                 Linux takes study - (Simon_Jester) - (6)
                                     Why switch? - (orion) - (5)
                                         Re: Why switch? - (deSitter) - (4)
                                             Too many choices - (orion) - (3)
                                                 No choice - (deSitter) - (1)
                                                     Let me consider it - (orion)
                                                 Dude... - (jb4)
                         How 2 pick a distro and get running today - (tuberculosis) - (2)
                             Saving a step - (ChrisR)
                             Help me pick a Linux distro (new thread) - (orion)
                     FWIW, you don't have to use Linux to use Python - (FuManChu)
             **Gak**...**choke**...*wheeze**...>>faint<< - (jb4) - (4)
                 Yes - (deSitter) - (3)
                     Beg to differ - (jb4) - (2)
                         Re: Beg to differ - (deSitter)
                         MFC and its templates, documents and views - (Arkadiy)

It'll be gradual, but faster than you expect. One day it won't be there, and the next day you'll be surprised at just how fast it still isn't.
192 ms