|
If, by "complement", you mean is there a function to unlock the workstation, no there isn't. The user has to hit Ctrl-Alt-Del and login again. It can't be remotely unlocked for security reasons.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello folks,
I have never been in a project where I need to use legacy dll (non COM dll)
I looked at some examples from that I found in codeproject but I still have some question.
Suppose I have the following methods in my dll:
RF *rfOpen( const char *dev, int mode );
int rfTest ( RF *reader, char *namestr, int namesize, char *verstr, int versize );
where RF declared like this:
typedef struct rfreaderstruct RF;
struct rfreaderstruct {
HANDLE fh;
OVERLAPPED in_ov;
OVERLAPPED out_ov;
unsigned char buffer[BUFSIZ]; /* Read buffer */
int bufferPoint; /* Number of bytes used from inBuf */
int bufferCount; /* The number of bytes in inBuf */
char nonCommandBuffer[BUFSIZ];
int nonCommandBufferPoint;
int nonCommandBufferEnd;
int mode;
int requestInProgress;
int requestOutProgress;
int pendingWrite;
int pendingRead;
RFMessage rfmsg;
int responseState;
unsigned int responseDataCount;
RF *next;
};
how can I make them readable in .Net?
Thanks
|
|
|
|
|
If you never have to manipulate the members of the RF structure, it's pretty straightforward:
[DllImport("legacy.dll")]
public static extern IntPtr rfOpen( string dev, int mode );
[DllImport("legacy.dll")]
public static extern int rfTest( IntPtr reader, StringBuilder namestr, int namesize, StringBuilder verstr, int versize ); For an 'out' string parameter, you should use a StringBuilder . Set the Capacity appropriately and pass that for the namesize parameter.
If you do have to manipulate RF directly, it will be a lot harder.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
does anybody know an opensource report generator like jasper reports written in C#?
I need the ability to show a print preview, send report to printer and create a pdf-document.
Or is it possible to integrate a java-program into a .net-program?
Thanks
Alexander Roos
|
|
|
|
|
|
You need to implement the IInputObject interface.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for reply Andy
after revieing source file from the proejct
http://www.codeproject.com/csharp/dotnetbandobjects.asp[^]
i found the following mehtods in Bandojectlib.cs file
public virtual void UIActivateIO(Int32 fActivate, ref MSG Msg)
{
if( fActivate != 0 )
{
Control ctrl = GetNextControl(this,true);//first
if( ModifierKeys == Keys.Shift )
ctrl = GetNextControl(ctrl,false );//last
if( ctrl != null ) ctrl.Select();
this.Focus();
}
}
protected override void OnGotFocus(System.EventArgs e)
{
base.OnGotFocus(e);
BandObjectSite.OnFocusChangeIS(this as IInputObject, 1);
}
protected override void OnLostFocus(System.EventArgs e)
{
base.OnLostFocus(e);
if( ActiveControl == null )
BandObjectSite.OnFocusChangeIS(this as IInputObject, 0);
}
How can i cal these methods so that it can enable BACKSPACE key in the toolbar?
kindly guide me please
Thanks
|
|
|
|
|
Check out this article from Microsoft. It's C++, but you should be able to convert it over.
http://msdn.microsoft.com/msdnmag/issues/01/08/c/[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for your reply
i visited the site and did find clue like
it was handled like that in C++ like that:
if (msg==WM_KEYDOWN) {
// on keydown, pass to edit as WM_CHAR
::SendMessage(hwndEdit, WM_CHAR, key, pMsg->lParam);
}
in Delphi i found the following:
function TDelphiBand.TranslateAcceleratorIO(var lpMsg: TMsg): HResult;
// Passes keyboard accelerators to the object.
begin
if (lpMsg.WParam <> VK_TAB) then begin
TranslateMessage(lpMSg);
DispatchMessage(lpMsg);
Result := S_OK;
end
else Result := S_FALSE;
end;
i coudnt find TranslateMessage and DispatchMessage in C#
neither i found SendMessage Equivalent in C#
|
|
|
|
|
I'm trying to pull a list of links from a webpage. I have everything working, but my problem is that if a url has an "&" in it, my code returns it as "& amp;" Here is a snippet of my code:
<br />
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(Url);<br />
webRequest.Timeout = 10000;<br />
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();<br />
Stream responseStream = webResponse.GetResponseStream();<br />
string responseEncoding = webResponse.ContentEncoding.Trim();<br />
<br />
if (responseEncoding.Length == 0)<br />
{<br />
responseEncoding="us-ascii";<br />
}<br />
StreamReader responseReader = new StreamReader(responseStream, System.Text.Encoding.GetEncoding(responseEncoding));<br />
<br />
string html = responseReader.ReadToEnd();<br />
responseReader.Close();<br />
I know I can manually remove the "amp;" from the link, but I was hoping there was an easier way
-david
|
|
|
|
|
HttpServerUtility has the UrlDecode method that will do the translation.
[edit]
Since it is a Url, you would think that UrlDecode is the right method, but & would be encoded in %xx format, so HtmlDecode might be the correct method.
[/edit]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks alot for the help andy, thats just what I was looking for.
|
|
|
|
|
Good day everyone!
i had problem in returning a DataReader object from a ServicedComponent class. The dataset object was return fine, but when return the DataReader, the datareader object was a transparent_proxy object. I dont understand why only the return DataReader object is a transparent_proxy?
And if i use any method of the returned DataReader, the following error will be occur:
This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.
my codes is simplied as follow:
//First layer is DataAccess Layer
public sealed class DataAccess : ServicedComponent
{
//others methods here...
public OleDbDataReader ExecuteReader (OleDbConnection objConn, string
sql, CommandType commandType, OleDbParameters paramList)
{
//SomeOthers codes here...
return objCmd.ExecuteReader(CommandBehavior.CloseConnection);
}
}
//Second Layer is Data Access Logic
public class EmployeeDAL : ServicedComponent
{
public IDataReader GetEmployeesFirstName()
{
//someothers codes here...
DataAccess objDa=new DataAccess();
OleDbConnection objConn=new OleDbConnection();
return objDa.ExecuteReader(objConn,sql);
}
}
Thanks in advance for your help.
gkb
|
|
|
|
|
The DataSet and DataTable are designed for remoting, the DataReader is the fastest leanest class for reading data. It leaves off everything that isn't required like remoting support. Plus since it represents an open live connection, it isn't a good idea to do anything to extend the lifetime of the object. Ideally every data reader should exist in a using block. If you need data to live on past the connection, then use a DataTable or DataSet.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I've written a video jukebox that uses the Window Media Player as a control to play video/audio. The client has contacted their vendor for media, and they can get DVD quality files, but only if we write an algorithm for encryption, including coding per install, so they can provide a media file and it will only play on some installations of the software. Is there a way to access the streaming of WMP so that I can encrypt a file ( so that it's generally useless ), and make it play properly on WMP only within my jukebox program ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I've only played around with it, but the DirectShow API is based on hooking filters together. So you would create a filter for your encrypted format and just hook it up to the wmp filter for playback. I think you need to handle a little bit more of the ui with this route, creating your own play/pause buttons, etc. But I don't think that is too much extra work.
Another option would be to write your own codec that wrapped the WMP codec, I'm not sure if that is possible, but it might be an option.
Another option would be to distribute the content in an encrypted format. On installation, they would be decrypted and stored using NTFS file system encryption. As long as the customer never got access to the account that the software ran under, they'd never be able to read the content. That way you wouldn't have to do anything special for playback, just during installation.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Can I use the DirectShow API to hook my own filter if I'm just passing videos to WMP ? I tried using Direct Show, in fact I wrote the whole system in DS9 before discovering that it's a buggy piece of crap.
andy brummer wrote:
Another option would be to distribute the content in an encrypted format. On installation, they would be decrypted and stored using NTFS file system encryption. As long as the customer never got access to the account that the software ran under, they'd never be able to read the content. That way you wouldn't have to do anything special for playback, just during installation.
That sort of thing appeals to me, because it would not create overhead during playback. Sadly, the vendor will not accept it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
Can I use the DirectShow API to hook my own filter if I'm just passing videos to WMP
I'm not sure. I only played with it long enough to research creating an AVI from a C++ DirectX application. I ended up using the crusty old multimedia Avi api because it was easier then hooking all the filters together.
How about using something like Cassini to host ASP.Net and access the files from a local web server. That way you can embed the encryption logic in your web server and you just send WMP the local url for the file. Another option would be to use an asyncronous protocol handler to keep the translation in process, but I'm not sure that WMP would support that.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Christian Graus wrote:
Is there a way to access the streaming of WMP so that I can encrypt a file (so that it's generally useless), and make it play properly on WMP only within my jukebox program?
I don't have any experience with this topic, but isn't it a classical use case for Windows Media DRM[^]?
Best regards
Dennis
|
|
|
|
|
Thanks - that looks promising, but I want to work with standard MPEG and mp3 files.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
Thanks - that looks promising, but I want to work with standard MPEG and mp3 files.
Maybe you should discuss that with your client. Using MPEG standards certainly has some advantages, but they don't help you to meet your client's media vendor conditions. T-Online, one of the largest internet access providers in Europe, has been running a video on demand service based on DRM protected WMV streaming for about a year. After you've paid for viewing a title on that platform it generates a license that allows you to watch the title for 24 hours (so it wouldn't matter if the content was stored on the hard disk or not because the license runs out, anyway). I like MPEG too, but this scenario with WMV + DRM might exactly be what makes the media vendor happy.
Best regards
Dennis
|
|
|
|
|
It's my impression that the vendor is driving the decision to provide DVD quality MPEGs. I'll have to ask.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
If i use ListViewItem.BeginEdit How to determine where the Item is click
|
|
|
|
|
this code let me write optional 4 digits and 3 decimal
1234.000
const string REGULAR_EXP = "(^-?\\d{1,4}\\.$)|(^-?\\d{1,4}$)|(^-?\\d{0,4}\\.\\d{1,3}$)";
i don't understand why if i type a number for ex.
12 and then add a minus (-) in front it works,
but it doesn't if you type first minus (-) and then the number.
i want REGULAR_EXP to add optional minus (-) before u type a number
|
|
|
|
|
If you put an @ at the beginning of your string, you won't need to \\ your \'s, which makes the regex more readable.
This doesn't always match what you'd hope, if you enter 3444.223, it will match the 3444. because that's the first test that works. You should change this to be all one regex, instead of three. However, the - part work fine for me in expresso. Your regex is working, what you need to explain is in what context you feel it does not work if you type the minus first.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|