Many Controls/Class have their own EventHandle , Such as Button.Click ,... i want to write my own EventHandle for my own class. but i dont understand it too much. The samples on MSDN are a bit difficult for me. are there some article concerning on this issue ?
fu0
Posts
-
How to write my own EventHandle ? -
Crystal Report Error: System.NullReferenceExceptionhere is my COde:
public class REPORT : System.Web.UI.Page { protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1; override protected void OnInit(EventArgs e) { InitializeComponent(); CrystalReportViewer1.ReportSource = @"C:\Program Files\Microsoft Visual Studio .NET\" +"Crystal Reports\\Samples\\Reports\\"+"General Business\\World Sales Report.rpt"; //CrystalReportViewer1.DataBind(); base.OnInit(e); } }
while runing the web project, there turns out a System.NullReferenceException. i dont know why ? -
How to get two or more params' value in the Extend Procedure DLL ?How to get two or more params in the Extend Procedure DLL ? In DLL the method is : SRVRETCODE func( SRV_PROC* pSrvProc ) { ... } the pSrvProc might transmit two or more params. But i dont know How to get their values? for example, i SQL procedure, i will use this code: Exec func @param1,@param2,@param3 How to get the three params' value in the DLL ?
-
How to change a manageObject's value in WMI application?while writting WMI application, i could read many values by means of System.Management namespace. many examples show how to read the values in Win32_class. my question is : How to modify the value in Win32_class using System.Management namespace ? there are some methods which might do this work such as Put(), SetPropertyValue(). But How to use them ?
-
Can C# register my own windows message Like VC++ do?i am writting a C++ DLL in which i want to send my own windows msg to other app. Like this: // C++ Code #define MY_OWN_MSG value PostMessage(hWnd,MY_OWN_MSG,0,0); //////////////////////////////// the MY_OWN_MSG must be registered to a windows message. How to Register a windows message in C# ?
-
Can C# register my own windows message Like VC++ do?in VC++, i can register my own windows message and map it.Can it be done in C# ? for example, processing WndProc() function:
protected ovrerride WndProc(ref Message Msg) { switch (Msg.MsgID) { case MY_OWN_MSG: dosomething(); break; } base.WndProc(ref Msg); }
How to register "MY_OWN_MSG" so that my other C++ application could use it ? -
Error in CBT_HOOK functioni write a global CBT_HOOK function in a win32 DLL ,and i want to send a message to the DLL's calling windows.But it doesnt work. Here is my code:
HWND hCallWnd = NULL; // a global var to save the Dll's Caller LRESULT CALLBACK CbtProc(int nCode,WPARAM wParam,LPARAM lParam) { switch(nCode) { case HCBT_CREATEWND: SendMessage(hCallWnd,MyMsgID,0,0); // to Send a msg break; } return CallNextProc(nCode,...); } void InstallHook(HWND hcallwnd) { SetWindowsHookEx(WH_CBT,CbtProc,DllHandle,0); // set a global hook hCallWnd = hcallwnd; // save the Caller's handle }
the Error is : in InstallHook() function,the hCallWnd's value is correct. But in CALLBACK CbtProc() function, the hCallWnd's value is always ZERO! so my SendMessage() doesnt work at all. Who can point out reason ? -
How to get imported DLL handleTHanks for your suggestion!!
-
How to get imported DLL handlein my C# app, i want to import somefuntions from win32 dll. look like this: [Dllimport("own.dll")] public static extern void function(); then use the function(). i want to get the own.dll 's handle like LoadLibrary("own.dll") in VC++. but HOW ? and if i import 2 or more functions from defferent win32 dll, HOw to get their handles respectivly ? and last question: HOW to free the DLL like FreeLibrary do ?
-
is there any Win32 function help access SQL server?i want to write a win32 DLL which can access SQL2000 database. is there any win32 function existing? Or i have to use MFC/.NET functions ?
-
can i trigger an event to C# app in a C++ Win32 DLL ?i m writting a C++ Win32 DLL which is called by a C# application. i want the DLL can trigger an event to the Calling C# app after some operations which might like the Win MSG mechanism: The DLL send a message to the C# app and the C# app handle the msg. the C# use the EventHandle/EventArgs on this issue. But can i trigger an event to C# app in a C++ Win32 DLL ? please help me.
-
Can i trigger an event to a C# app in a C++ DLL?i m writting a C++ Win32 DLL which is called by a C# application. i want the DLL can trigger an event to the Calling C# app after some operations which might like the Win MSG mechanism: The DLL send a message to the C# app and the C# app handle the msg. the C# use the EventHandle/EventArgs on this issue. But can i trigger an event to C# app in a C++ Win32 DLL ? please help me.
-
question about WH_CBT hookThen , if the dialog is created by MessageBox() function, there is still no way to find out its icon style ? if the applcation turn out an exception, can Hook help recognise the error just happened ?
-
can i get some operation infomation from SQLsrv2k ?Triggers might be a solution for this. But it need to modify the database. So i prefer a third party application to do this without modify the database. i thought it can receive change notification like windows hook doing. where can i start ? And is there aother way ?
-
question about WH_CBT hookusing WH_CBT hook may get some information when a windows' status changed such as creating/destorying/size and etc. Some windows created may be dialog form , and some of them might be Information_style_dialog, some are warning_style_dialog through their icon style. So , which info from lParam or wParam can help judge dialog's style while using WH_CBT hook ?
-
can i get some operation infomation from SQLsrv2k ?i thought SQLsrv2k had a interface for 3rd part software to gain operation infomation. For example, while a record is inserted into a table, the 3rd part software might get this information. also it might like the windows message mechanism, any operation may produce a message to windows or others. is this possible ?
-
About error monitoring ?i think the real problem is: "The other applciation" is not my developing . So i want to find a way how to monitor other application 's status to comfirm whethere there occurs an error. in my opinion, if i can recorgnize a messagebox's displaying i can guess there might be an error occured.
-
About error monitoring ?in my original idea, i dont want my application to be tied into other applcation.i thought it would interfere with other appliction's nomarl process. from these words:but you don't want your application to be tied into the other application at all,i guess : if my application is tied into other application,will it have the ablitiy to do the work ? could you make a suggestion about your idea ?
-
About error monitoring ?my idea is this: in a sample, an application(not my own) displays a messagebox which might means some error happened. then my own application could know something happened by this event(messagebox's displaying). however, my application dont want to know any details about the error, it only write into a log like this: when, which application, something happened. And my application dont want to interfere with the application. it works like a shell. could i realize it ?
-
About error monitoring ?windows provides many win32 functions for error detection on system level. is there a possibility to detect error on application level? for example: while running an application, there comes out a warning dialog which might means error. Can i detect it timely ?