|
Dear All,
how can i access my office PC in home by Using TCP/IP Port, or can we make serial link b/w them using Port Listener Program.
thanks in Advance.
|
|
|
|
|
Hi,
could you please be a bit more specific about what you want to achieve?
Generally spoken there is no reason why you can't connect to your office PC via TCP/IP.
Regards
Sebastian
P.S.: What is a serial link with a Port Listener Program?
|
|
|
|
|
Hi,
I need to build file (any files) based caching algorithm for this i'm looking for a well proven and extensible Open Source which supports C#, can you please address some good open source.
Thanks...
|
|
|
|
|
Dear All,
I am running an windows application, which is used to create a public queue and send and receive messages from it.
Environment
The application runs on my development machine which is under a AD.
The application has to create a public queue in another (destination)
machine which is in the same domain and has the message queue.
In destination machine I have the admin rights too.
Issue:
When I ran the application it checks whether the queue exists in the
destination machine or not - Working.
When the queue doesn't exists it tries to create the queue - Not Working
Error:
"Access to Message Queuing system is denied."
Kindly give me the solution to rectify the same.
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
hi! everyone
I want to know what is the difference between
listbox.SelectedItem and listbox.SelectedValue.
How can I get the text of displayMember of databound listbox
and not the value member text which I can easily get by
listbox.selectedvalue ??
Thanks
|
|
|
|
|
SelectedValue is the value of the member property specified by the ValueMember property. SelectedItem is the item that's currently selected.
/ravi
|
|
|
|
|
I am creating a DLL wrapper for some old C++ libs so they can be used by C#. I have a communication structure that is allocated by the C++ functions and returned to C#, C# needs to fill in some data and pass it back into the C++ code.
I have it working but its nasty code - hoping someone will have a better idea.
C++ structure
typedef struct
{ uint32 qRequest; // set to desired operation
uint32 qStatus; // server to sets to status
uint32 qReqBufSize; // total size of buffer
uint32 qReqBufValidLen; // amount of valid data
char acReqBuf[1]; // request data buffer
// allocated for qReqBufSize bytes
} myREQUEST;
C# struct
[StructLayout(LayoutKind.Sequential, Pack=1) ]
public struct myREQUEST_CS
{
[MarshalAs(UnmanagedType.U4)] public uint Req; // set to desired operation
[MarshalAs(UnmanagedType.U4)] public uint Stat; // server to sets to status
[MarshalAs(UnmanagedType.U4)] public uint ReqBufSize; // total size of buffer
[MarshalAs(UnmanagedType.U4)] public uint ReqBufValidLen; // amount of valid data
// hardcoded for size for now
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 296)]
public char[] ReqBuf;
}
My big problem is the Buffer (ReqBuf) area in the Struct. This is allocated as contiguous memory chunk with the Struct. It is just a place holder that in C++ gets cast to another structure. I need to read and write to this area in C#.
I've been using combinations of Marshal.AllocHGlobal(), Marshal.StructureToPtr and Marshal.PtrToStructure - just hoping someone knows of a better way to access and write to the ReqBuf area of my structure
|
|
|
|
|
Hi,
if ReqBuf is actually a struct, why don't you provide its real definition? just smash it in, instead
of the char[]
BTW: making it 296 managed chars is rather odd, at best it is 592 bytes, isn't it?
Once the array is gone, all StructLayout and MarshalAs stuff looks redundant too.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Wednesday, January 28, 2009 6:40 PM
modified on Friday, June 10, 2011 11:57 AM
|
|
|
|
|
Hi
Is there a way to convert .flv to .WMV/.WMA/.MPEG file using C#? Please advise.
Thanks
Pankaj
|
|
|
|
|
It is not natively supported in .NET. You will have to use a third party utility.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I have written a Windows Form Application that updates a MS Access DB. I want to be able to install this application on a server and then allow my clients to create shortcuts to the .exe. When I try to do this I get an error:
System.Security.Permissions.FileIOPermissions, mscorlib? How do I fix this.
Thanks!
|
|
|
|
|
Google for Code Access Security (CAS) and you'll find out why and solutions.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Ok I tried to send keystrokes to msn with sendmessage but I Can't get it to work what I did:
IntPtr hwnd_Main = FindWindow(null, "name <someone@hotmail.com>");
IntPtr hwnd_imwindowclass = FindWindowEx(hwnd_Main, IntPtr.Zero, "IM Window Class", null);
IntPtr hwnd_child = FindWindowEx(hwnd_imwindowclass, IntPtr.Zero, "DirectUIHWND", null);
SendMessage(hwnd_edit, WM_KEYDOWN, Char.ConvertToUtf32("abc", 1), 1)
SendMessage(hwnd_edit, WM_CHAR, Char.ConvertToUtf32("abc", 1), 1)
SendMessage(hwnd_edit, WM_KEYUP, Char.ConvertToUtf32("abc", 1), 1)
I also tried using postmessage but all dont work.
And no I dont want to call settoforeground and use sendkeys cause the window needs to stay minimized.
btw also tried using this
string s = "hello";
for (int i = 0; i < s.Length; i++)
{
PostMessage(hwnd_child, WM_KEYDOWN, VkKeyScan(s[i]), 1);
PostMessage(hwnd_child, WM_CHAR, VkKeyScan(s[i]), 1);
PostMessage(hwnd_child, WM_KEYUP, VkKeyScan(s[i]), 1);
}
modified on Wednesday, January 28, 2009 2:53 PM
|
|
|
|
|
Schoolmelk wrote: but I Can't get it to work
You'll have to be more specific.
Are you checking the return values of any of your calls?
/ravi
|
|
|
|
|
yes I get all things I need it goes wrong with the sendmessage / postmessage part those return 0.
|
|
|
|
|
You may want to check the value returned by GetLastError() to see what went wrong. If you're running on Vista, a value of 5 indicates "Access denied".
/ravi
|
|
|
|
|
GetLastError() returns 0. Is there no other way to send keystrokes to a minimized window? I don't think it is possible anymore to use sendmessage to msn live convo's
|
|
|
|
|
Hmm, that would lead me to believe the message is getting through. Perhaps DirectUIHWND is not the correct target window?
/ravi
|
|
|
|
|
Must be.
I used Spy+ to detect where my key input was send to while typing. These all where send to DirectUIHWND . Also when I check if my commands with PostMessage and SendMessage came trough and yes they did but won't show up in the edit box.
|
|
|
|
|
If I have a class as below:
public class Employee
{
private Boss _boss;
public Boss Manager
{
get { return _boss;}
}
}
Although the property "Manager" is read only, however a programmer can still do this:
_employee.Manager = null;
How do I ensure programmers can access the Manager object but not allow them to set the reference to null?
|
|
|
|
|
That shouldn't be possible. Your property name is different in the class (Mananger) than in the assignment (Manager), perhaps you have another property or public field called Manager?
|
|
|
|
|
Just a typo. They should both be Manager.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Ok, but still this shouldn't be possible. Made a little test:
static void Main() {
Employee e = new Employee();
e.Manager = null;
}
public class Employee {
private string _boss;
public string Manager {
get { return _boss; }
}
}
And the compiler said:
Property or indexer 'Test.Employee.Mananger' cannot be assigned to -- it is read only
Just in case, select the _employee.Manager = null; and right click on the Manager word. Then from the menu, select "Go to definition". Does it end up to the place you posted?
|
|
|
|
|
Great, thanks.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|