Please do be concise! Rather than a whine, obviously this message sings Chris' and The Code Project's praises to the skies. OK OK OK!! You don't have to repeat yourself five thousand times -- a long rambling message doesn't do anyone good :) Sorry, I really don't mean to be condescending -- just a friendly request. Yours, Brian
Brian Hart
Posts
-
Relax folks.... -
Programmatically Detecting System HangHello All, Does anybody know how to detect from the network if a particular machine has completely and totally locked up for good, as in you can leave it on overnight and it doesn't become unstuck? I ask this because I could ping such a machine and find out from that, but sometimes Ping works even when computers hang. Does anybody have an idea? Thanks! Brian
-
How to tell if you're a geekDavid, That's scary :) I am a Physics and Math third-year student, but I go out at night, I print neatly on my papers and don't get A's all of the time (but most of the time), participate in a variety of fun activities, etc. What is up with the T-Shirt deal? I like to wear colorful (and sometimes loud) Hawaiian collared shirts, t-shirts, dress in all black, and wear a tuxedo to perform classical music, either at weddings or in recital. But anyway, maybe I'm just not your average geek... :
-
Can someone over 30 learn to program?I work with a 43-year-old astronomer who's learning Windows, DCOM, MFC, and ATL (with my tutelage) from having spent all the time programming in FORTRAN and C...:) Don't let your age scare you... Cheers, Bria
-
Determining Whether or Not User is Logged On from ServiceHello :) I am writing a Windows NT Service. How do I determine if there is an interactive user logged on or not? Thanks! I'm running Windows NT Workstation 4.0 SP 5 and Visual C++ 6.0. Brian
-
How to format source code in discussion board message"can anybody tell me how i can format source code in discussion board messages?" Let's test. The following code is inside a < pre >...< /pre > block:
void CMyClass::OnSomeEvent()
{
// TODO: Add code here
} -
message passing bw 2 application"I want to trigger a started NT service on some event. i.e a service should activate on that event and perform its funtionality. The invoking event should be passed from another VC application. Can anybody tell me how can I do it. (I want something like as Message Passing within different applications)" You might try having a look at my DCOM programming tutorial, which shows you, step-by-step, how to do this with DCOM, where the server program (which has the events and the functionality) is a Windows NT Service. The tutorial starts with Step 1, and then Back and Next links are provided to help you move through the steps. Hope this helps :)
-
comThink of things this way... You know how, in a C++ program, you have all sorts of objects, like CWinApp, CMyView, CMainFrame, etc.? These are all called "code-level" objects; that is, the only thing that knows about them is the program's source code. COM takes objects to the next level, that is, the "binary level." Think again of a class, but this time another executeable program instantiates it in memory and calls its methods and properties. Although this time, the object is not in your code, it's in the binary. DLLs are simply libraries of functions that are like the .LIB files we use for linking things statically, only this time, the linking happens "dynamically", or during run time :) Cheers, Brian Hart
-
How does a Client know if there is a COM server that belongs to itCall CoGetClassObject() and test to see if it fails with the REGDB_E_CLASSNOTREG error: IClassFactory* pCF = NULL; HRESULT hResult = CoGetClassObject(CLSID_TheObject, NULL, CLSCTX_WHATEVER_YOU_WANT_TO_USE, (void**)&pCF); if (FAILED(hResult)) { if (hResult == REGDB_E_CLASSNOTREG) { // the server's not registered properly... } }
-
HTML help viewerA GUI comes with Windows which is like MSDN! :)
-
Webbrowser repaintTo have the view repaint, call CHtmlView::Refresh(). CHtmlView doesn't behave like a normal MFC view because all it does is wrap the WebBrowser control.
-
DCOM Tutorial AnnouncementHello Everybody :) I have written what I think to be a comprehensive, seven-step tutorial which is easy enough for beginners to use, and posted it on The Code Project to help you get started on DCOM programming. It guides you through using and doing: + Implementing a DCOM server as a Windows NT Service; + using the ATL COM AppWizard; + using all of the Visual C++-IDE features like New ATL Object Wizard, Add Method to Interface, etc etc - implementing Connection Points: + Over the network with DCOM + On the client side with MFC and ClassWizard (!) + MFC and AppWizard and ClassWizard on the client side Full source code provided for each step of the tutorial, and a full client that reports status is provided with the last step, plus a source code archive and Questions and Answers page. Check it out! It's as yet an "unedited reader contribution" but I want to invite you to look at it anyway and let me know what you think. Feedback is so very needed on this kind of a project. The tutorial starts with Step 1. Enjoy! (NOTE: "Step 1" above is a hyperlink to the tutorial.)
-
Getting the pointer to a CView from CMyAppAn approach is, instead of the app getting pointers to the views, how about the views giving the app pointers back to themselves? Add two public member variables to CMyApp, and #include lines, like this: #include "View1.h" #include "View2.h" class CMyApp : public CWinApp { ... public: CView1* m_pView1; CView2* m_pView2; } // IN MYAPP.CPP CMyApp::CMyApp() { // Initialize view pointers to NULL m_pView1 = NULL; m_pView2 = NULL; } void CMyApp::SetView1FromView2() { if (m_pView1 == NULL || m_pView2 == NULL) return; m_pView1->SetText(m_pView2->GetText()); } // NOW IN View1.cpp CView1::~CView1() { theApp.m_pView1 = NULL; } void CView1::OnInitialUpdate() { CView::OnInitialUpdate(); ... theApp.m_pView1 = this; } // AND IN View2.cpp CView2::~CView2() { theApp.m_pView2 = NULL; } ... void CView2::OnInitialUpdate() { CView::OnInitialUpdate(); ... theApp.m_pView2 = this; } And voila! :) Cheers, Brian
-
DCOM Tutorial AnnouncementHello Everybody, I know this is COM/DCOM but since Visual C++ is used so much to do this, I thought I would post here too :) I have written a comprehensive, seven-step tutorial which is easy enough for beginners to use, and posted it on The Code Project to help you get started on DCOM programming. It's as yet an "unedited reader contribution" but I want to invite you to look at it anyway and let me know what you think. Feedback is so very needed on this kind of a project. The tutorial starts with Step 1, and is at (for the moment) http://www.codeproject.com/useritems/HelloTutorial1.asp Cheers, Brian :)
-
polymorphismWhat you're talking about is called "overloading functions." Polymorphism is a different thing entirely! Plus, you *can* have such methods if they are in an IUnknown-based (custom) interface, but you have to promise never to use it with VB... :) Brian Hart
-
AfxConnectionAdvise"If the server is launched remotely by the client, I cannot establish the connection between them." Jose, Look soon for a tutorial I wrote, implementing a DCOM server and client with the full support for everything, including making the server a Service, which in your case would solve your problems. However, you don't have a service, you have an EXE. Here's what to do: 1. Click the Start button, and then click Run. 2. Type 'dcomcnfg' in the box. 3. Search in the list for the name you gave your server project (say 'EventSvr'). Double-click it. 4. Go to Identity. Click 'This user,' and type in the Administrator username and the Administrator password, if you know it. If you don't then ask your sysadmin. Voila! Hope it works :) Cheers, Brian
-
AfxConnectionAdvise"You can't fire events through the DCOM" Wrong wrong wrong. I have written working code on this, and I have almost completed posting a full tutorial on The Code Project (at http://www.codeproject.com/useritems/HelloTutorial1.asp) on this very thing! Beware; the tutorial is un-edited yet and is still incomplete, but hang with me and you shall see the light :) It's amazing what one thinks is impossible until one tries... :) Brian Hart
-
Outlook Express/IE Address BookHello, Say I have an application that sends e-mail, and I want the user to pick the recipients of their message using the Address Book that comes with Internet Explorer and Outlook Express. Any sample programs, classes, whatnot that you know of? :)
-
Displaying the Property Sheet for a fileDear Magesh, In the forum, you posted: "This call returns the error code SE_ERR_NOASSOC (0x1f) and does not display the property sheet for the file. What's wrong with this code?" I'm not sure, but I think that the "properties" and some other new verbs are only available on Windows 2000. The only ones available for Windows 95/98/NT are "open" "explore" and "print." (I think.) :) Cheers, Brian Hart
-
New browser as child window of existing one?Dear Mahesh, There are events that the WebBrowser control emits, which you can handle by implementing the DWebBrowserEvents2 dispatch interface in your program (or something, I forget :) ). The event OnBeforeNavigate or OnBeforeNavigate2 (I forget again :) ) are called or fired after the Navigate() method is called but before navigation begins. It is passed parameters like the URL, do we want to cancel, so forth. What I would do is to put new child-window-creation code in there, and pass the URL to the new window, which itself could contain a WebBrowser control. Cheers, Brian Hart :)