|
See this[^] useful article about global keyboard and mouse hooks.
I hope this helps.
Regards
|
|
|
|
|
Thanks a lot Mehdi Ghiasi
|
|
|
|
|
You are welcome!
|
|
|
|
|
I need to set the camera source for each of 4 video windows in C# without using the windows dialog box.
I have a video capture card that has 4 inputs that can be accessed simultaneously. I have a working application that calls the VideoCapture class. Each time after the first instance I get the Windows Video Device Selection pop up from which I have to manually choose the input for each remaining window. I could live with this except, whatever I choose as the last input is automatically assigned as the device to the first window the next time the application starts. This is unacceptable because the camera assignments are never in the same location.
I would prefer to assign each of the inputs in code and never see the Windows Video Device Selection pop up.
Anyone have an idea how to obtain and pass the device id to the WebCam_Capture.dll?
Thanks
|
|
|
|
|
I also have the same problem...
|
|
|
|
|
My company has a database (MSSQL 2005) system for managing and archiving communications that contain certain sensitive information. It is web-based and allows us to transmit information via https rather than potentially unsecured email. It uses two tables, one for the message itself and one for any attachements that go along with the message. The attachement table is very simple, with only three columns: INT CommId (which maps to the primary key of the messages table), VARCHAR(100) Descr (a user-friendly name for the attached file) and VARBINARY(max) Att (the attached file itself.) This system, clunky as it may seem, serves our security and data-retention needs very well and has allowed us to integrate it gracefully with several back-office apps.
We have an app written in VB6 that I am trying to translate to VB.net 2008. It processes client information and sends a secure communication to our field reps when something comes up for their attention. The communication has a PDF attachement which is the same for every rep but may be changed in the future.
The VB6 app uses the ADODB library -- specifically the ADODB.Stream object -- to put the PDF into the Attachement column. The code looks like this:
Set Strm = New ADODB.Stream
Strm.Type = adTypeBinary
Strm.Open
Strm.LoadFromFile DocPath
With AdodbCmd
.CommandText = InsertQuery
.Parameters.Append .CreateParameter("@CommId", adInteger, adParamInput, , CommId)
.Parameters.Append .CreateParameter("@Descr", adVarChar, adParamInput, 100, Descr)
.Parameters.Append .CreateParameter("@Att", adLongVarBinary, adParamInput, 2147483647, Strm.Read)
.Execute
End With
I want to do exactly this same thing using the 3.5 framework, without having to interop with the ADODB COM library. I cannot guarantee that future versions of the PDF will be below the 8000 character limit, so any solution needs to handle a file of arbitrary length.
Suggestions?modified on Thursday, February 25, 2010 9:59 AM
|
|
|
|
|
The ADO.NET replacement you are looking for is based around the SqlCommand , SqlConnection classes."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I am very familiar with SqlConnection and SqlCommand ; I have been using them extensively for some time. My question was about getting a large binary file from the file system into a VARBINARY(max) database column. I can do this pretty easily using ADODB.Stream , as shown in my code in the OP. I'd like to learn the .Net equivalent and avoid using COM interop.
|
|
|
|
|
You should set the parameter to SqlDbType.VarBinary . Set SqlParameter.Value to the byte[] that corresponds to the byte array you have read in from the file (it is just a stream after all)."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Your solution is actually one of the first things I tried, but I kept getting an exception when the code was executed. Turns out, the problem -- revealed by an inner exception and not by the outer one I was reading -- was bad syntax.
Yeah, it's working now, and without running into a 8000 byte limit that some documentation seemed to state: the PDF file is 97k. I assume that the only practical limit to this method is available memory? And I assume there is no problem with streamlining the parameter declaration to AttParam.Value = System.IO.File.ReadAllBytes(DocPath) ?
Thanks for your assistance. Now, if you'll excuse me, I have a wall to bang with my head.
|
|
|
|
|
TechBearSeattle wrote: I assume that the only practical limit to this method is available memory? And I assume there is no problem with streamlining the parameter declaration to AttParam.Value = System.IO.File.ReadAllBytes(DocPath)?
Shouldn't be any problems there, and I'm glad I could help."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Dear friends on the block, my name is danso and i'm getting hands on .NET FRAMEWORK for the fist time.
I will be glad to get supports from anyone here. Thanks
|
|
|
|
|
|
Thnaks....i now understand it's a programming language, with pre-biult codes that enhance on developing a system or application.
|
|
|
|
|
danso sackey wrote: ....i now understand it's a programming language
Uhhh, read it again. No, it's not a programming lanugage.
The .NET Framework is a huge collections of classes that can be used acrossed a wide range of languages, all targeting the .NET CLR, making writing applications easier, among other things.
The .NET CLR is a managed execution environment that runs these applications.
|
|
|
|
|
No it's not. It's a framework that provides common facilities for any language that subscribes to it to develop against. These languages must support the common runtime and common language specs to be classed as .NET compatible."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
I have a desktop application in .Net 2.0
I have a com class added in bin folder Interop.prjBatPrt.dll
now running the application I'm getting the following error...
ComException Was Unhandled...
Retrieving the COM class factory for component with CLSID {00A4F4E0-380D-4DDD-9752-50FDA24BAC15} failed due to the following error: 80040154.
can anyone help me to figure it out....
|
|
|
|
|
This is a general error. What you can do is ,
1. Check that the class installed is actuallt installed properly.( if not then re-installe that correctly)
2. Reset the identity user id/passwork that you might have there in com explorer.
2. Lastly, make sure that COM component is working correct at runtime. That can be tested this way: You can write a vb script file(.vbs) and try to invoke that COM component by just creating an instance of the class. If that is created then using the vbscript itself call the method to see whether that method which you might have used is actually invoked correctly.
Sample VBscript code.Save this as "test.vbs" and double click and run.
obj = CreateObject("yourcalssname")
msgbox(IsObject(obj)) Thanks,
Arindam D Tewary
|
|
|
|
|
thanx arindam ...problem solved
|
|
|
|
|
vkumar09 wrote: I have a com class added in bin folder Interop.prjBatPrt.dll
No, that's not a COM class. That is a wrapper used as an interface between your managed code and the COM component you're code is using. A common newbie mistake is to deploy just that .DLL with the application and wonder why the app suddenly doesn't work. You also need the COM component you're using installed on the target machine as well as the wrapper .DLL's.
|
|
|
|
|
How to print 1000 line in one page.
i use POS printer.
C.Kumarasinghe
|
|
|
|
|
Make the text really small I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Just set your page size to 1000 / lines per inch - calculated from font height. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
C.Kumarasinghe wrote: i use POS printer.
Go buy a good one then."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|