Hi all, I am looking for a solution that allows me to verify if a number of applications on a number of servers and workstations are functioning properly and take appropriate action if they don't. I was wondering what techniques are being used for checking application functionality in an enterprise environment, and what your experiences are with these techniques. What do you use ? SNMP ? ICMP pings ? custom or commercial solutions ? Regards, Alwin
Alwin75
Posts
-
Application checking solutions ? -
Identical methods/properties in separate interfaces ?Hi all, ATL question: suppose I have two interfaces (IFirst, ISecond), and both interfaces have a method Test(). Now I would like to implement both IFirst and ISecond in a single object, but still have two separate implementations of the Test() method. Any pointers on how this can be done ? Thanks, Alwin
-
Passing complex type through COM interface ?Hi all, Can anybody give me some pointers on how to pass the following complex type through a COM interface ?
typedef struct ComplexType
{
Type type; // can be INT, BSTR, BYTE* etc.
union
{
int intVal;
BSTR strVal;
BYTE* pbyteVal;
AnotherComplexType* pcomplexVal;
};
};The real type contains different fields but you should get the idea: it basically is just like a VARIANT only with more levels of indirection. I need to pass these structures between my COM component and non-COM legacy code. Unfortunately, there is a threading issue that causes a proxy and stub to be created even for in-process deployment of my component, so simply passing a pointer doesn't work. Should I resort to custom marshalling ? Kind regards, Alwin!
-
CFileDialog MULTISELECTHi Nick, the following code allows you to open multiple files in a MDI app. Tabbing got lost :)
void CManagerApp::OnFileOpen() { // Query files to open CFileDialog dlg(true, _T("process"), NULL, OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, _T("Process definitions (*.process)||")); DWORD dwMaxFile = 4096; dlg.m_ofn.nMaxFile = dwMaxFile; LPTSTR pszFilenames = new TCHAR[dwMaxFile]; dlg.m_ofn.lpstrFile = pszFilenames; dlg.m_ofn.lpstrFile[0] = NULL; if (dlg.DoModal() == IDOK) { // Open selected file(s) POSITION pos = dlg.GetStartPosition(); while(pos) OpenDocumentFile(dlg.GetNextPathName(pos)); } delete[] pszFilenames; }
Alwin -
Network NotificationsHi Steve, maybe my response to another question might help you, unless you are the same person i originally replied to :) Alwin
-
Sending emailHi there ! An alternative to the excellent articles on MAPI in the corresponding section of this site could be the MSMAPI32.ocx control that installs with VS5.0+, which is documented in MAPI98.CHM. I use it to send emails from JScripts without using Outlook:
// Open MAPI connection var mapi = new ActiveXObject("MAPI.Session"); mapi.Logon(profileString); // Create message var message = mapi.Outbox.Messages.Add(); message.Subject = "The message subject"; message.Text = "The message body"; // Set recipients var recip = message.Recipients.Add(); recip.Name = "me@here.now"; recip.Type = 1; recip.Resolve(); // Send it ! message.Send();
You could convert this sample to VC++ using the #import directive and some COM knowledge, or search the microsoft site for MAPI.Session examples. Good luck! Alwin -
How to get notified when netowrk connection up or down?Hi, It turned out that I did not read the article in Dr. Dobbs but in MSDN, which is available electronically here. The article indicates that SENS does not work well for what you want to do but describes an alternative using WMI (Windows Management Instrumentation) that might help you. Regards, Alwin
-
Installation toolHi anthony, Take a look at Ghost installer at www.ginstall.com, it can register COM servers during install. Bye, Alwin
-
How to get notified when netowrk connection up or down?Hi ano, take a look at the System Event Notification Service (SENS), and especially the ISensNetwork interface. I believe there is an article about this in a recent Dr. Dobbs, or search the Microsoft site. Bye, Alwin
-
How do I handle "enter" key in a listbox?Hi there, I respond to "del" keys in my listviews by handling the KEYDOWN notifications, this solution should also work for listboxes: In your message map add: (you should use LBN_*)
ON_NOTIFY(LVN_KEYDOWN, IDC_LIST_FILES, OnKeydownListFiles)
Add the handler:void CUpdateDlg::OnKeydownListFiles(NMHDR* pNMHDR, LRESULT* pResult) { LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR; if (pLVKeyDow->wVKey == 46) { // Delete key pressed } *pResult = 0; }
Hope this helps ! Alwin -
How can I speak like a professional ?Hi all, I am wondering how to pronounce tier in N-tier architecture ! Is it like in "To tie ones shoelaces", or "To drink beer" ? Please help me so I can get back to sleep at night X| Alwin
-
Would Like To Know How To Architect As Well Program Client/Server using CSocketFile For Transferring a "Case" Object...Hi there, To allow the server app to forward received objects to other clients, you first need to expand your server to allow multiple clients to connect. Just call ServerSocket.Accept() in a loop and store the returned CSocket (or derived) objects, one for each connected client, somewhere (you could use a CList for this). I guess the easiest way to handle client requests is to derive a class from CSocket and pass instances of these objects to Accept(). By overriding the OnReceive() method (see CSocket's base class CAsyncSocket in the online docs), you can cause code to be executed then data is received from a client. Just receive the object like you did in your example and forward it to all other connected clients using the socket objects you stored. You should also override the OnClose() method to remove socket objects from the socket list if the connection is being closed. As an aside, you could change your CaseId and CaseName member variables of CCase to CStrings, which allows you to (de)serialise them using the << and >> operators, ie. ar << CaseID << CaseName << ConsultationCount; Hope this helps (and works ;) ) Alwin
-
Outlook automationBen, the microsoft knowledge base article Q171603 shows an example on how to get the unread message count of an outlook folder. Hope this helps. Alwin
-
Any fast File read/write method?An alternative is to use memory-mapped files, for which some examples can be found on the Microsoft knowledge base. There also exists a sample called ProcessWalker. The downside is that it only works on NT or higher (I believe). Alwin
-
Tree Item PositionHi Raffi, Do you mean testing if an item is at the end of a branch ? In that case, you could simply test to see if it has any child items with GetChildItem(hItemSelected), which will return NULL if no children exist. Alwin
-
Outlook 97 AutomationHi, Take a look at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q259298 which explains what to #define and #import for each Outlook version. I don't know if it is possible to detect the Outlook version at runtime and do some late binding. Regards, Alwin
-
Throwing exception on thread end ?Hi All ! I have read that the C# threading classes in .NET causes an exception to be thrown in a thread if that thread is being ended by another thread. Any idea's on how to implement this with VC 6.0 ? This could provide an excellent alternative to polling for stop flags. Kind regards, Alwin
-
Adding another IDispatch derived interface?Hi Dave, You are deriving a new class from two other classes that both implement IDispatch, therefore the compiler does not know which one to use. You can select which one should be implemented in your new class in your COM_MAP by using COM_INTERFACE_ENTRY2 instead of COM_INTERFACE_ENTRY: COM_INTERFACE_ENTRY(IObj1) COM_INTERFACE_ENTRY2(IDispatch, IObj2) //COM_INTERFACE_ENTRY(IDispatch) // Removed See the COM_INTERFACE_ENTRY2 docs. Hope this helps (and it is the correct answer :) Alwin Beukers
-
Worker thread in COM objectHi All, I'm interested in your thoughts about the following: I have created an ATL COM object with an interface that consists of the methods Run and Stop. From a client application I would like to be able to call the Run method which causes my COM object to start a long operation. However, the Run method should return immediately because i don't want any multithreading code in my client. The long operation can be stopped by calling the Stop method. Currently, I create a worker thread in my objects Run method and set a stop flag when the Stop method is called. The worker thread periodically checks this flag and exits if it is set. For this to work, my object is created in the MTA. However, I have the feeling this can be done much simpler. (Also, there are warnings everywhere about creating threads in COM objects) I have looked into Asynchronous method calls but this limits my application to Win2000 and does not work with IDispatch derived interfaces. Any other idea's, pointers, samples ? Thank you, Alwin! Alwin Beukers
-
MSXML SAX Attributes QuestionMost functions use the wchar_t datatype, which is two bytes per character. To use this data in functions which expect one byte per character you can use some MFC conversion macros. I use the following code to extract an attribute and print it:
wchar_t* val;
int valLen;pAttributes->getValueFromQName(
L"attribute", lstrlenW(L"attribute"),
&val, &valLen);USES_CONVERSION;
cout << W2T(val) << "\n";Hope this helps, Alwin Beukers