|
In my EULA for VS.NET academic, it says I can install the software on up to three computers. You shouldn't have any problems unless you chnge your hardware more than two times. Then you'll have to call good ol' MS to get it straightened out.
James
|
|
|
|
|
I wanna read/write registry,Can anybody tell me the name of class I should use.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Easy: RegistryKey.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
Easy: RegistryKey.
Yeah
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
I waana define array of integers in C#.How can I do it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
I waana define array of integers in C#.How can I do it?
http://www.codeproject.com/useritems/csarrays01.asp
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Oh, Thanks Nish. It was stupid question,Wasn't it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
Oh, Thanks Nish. It was stupid question,Wasn't it?
Not at all Mazy, not at all.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
How can I add something like "default" attribute to button? When I press the ENTER key I simply want to activate specific button, but where is the "default" attribute? It was in Visual C++, but in C# I don't see it...
|
|
|
|
|
The behavior you are looking for is the AcceptButton property of a Windows Form class.
Example:
this.AcceptButton = this.myButton;
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Which, after all, is a more elegant modeling...
Crivo
Automated Credit Assessment
|
|
|
|
|
I need to receive an event whenever the mouse moves, anywhere on the screen (so I can test if the mouse has moved out of/into a target rectangle). The Screen object, however, has no mousemove event as far as I can tell.
My current solution involves a fullscreen semitransparent window. This is a hassle and a kludge, however.
|
|
|
|
|
try
<code>
protected override void OnMouseMove(MouseEventArgs mea)
{
}
</code>
Nick Parker
|
|
|
|
|
i don't know how to do this in c#, but in my c++-times i wrote a mouse-system-hook-dll to handle system-wide mousemoves. there was no other (easier) way half a year ago.
:wq
|
|
|
|
|
another idea: maybe you can use the MouseEnter and MouseLeave messages each control (and so each form) provides.
but if that still isn't your applications clientarea, this helps you only to make the transparent window smaller (so that its client-size fits the rectangle you need to observe), i.e. not the whole screen anymore.
:wq
|
|
|
|
|
Hi.
I have a problem to implement a WNetEnumResource API32 function in C#. Does anyone have a example.
|
|
|
|
|
Hi
can u explain me what wsdl exactly is and where actually u are going ot use it ....
Any links for this topics will be very helpful...
Thanks
Atul
|
|
|
|
|
|
Hi,
I'm trying (only trying) to write a C# wrapper for the WinPcap library. Of course I started with the simplest function: Get the version of the lib. This works fine
Second thing: I tried to wrap the PacketGetAdapterNames() function (also pretty simple). Here's the source code:
//----------------------------------------------------------------------------
//WinPcap API Source code:
BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize)
{
HKEY LinkageKey,AdapKey;
UINT RegKeySize=0;
LONG Status;
ULONG Result;
PTSTR BpStr;
char *TTpStr,*DpStr,*DescBuf;
LPADAPTER adapter;
PPACKET_OID_DATA OidData;
int i=0,k,rewind,dim;
TCHAR AdapName[256];
ODSEx("PacketGetAdapterNames: BufferSize=%d\n",*BufferSize);
OidData=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,512);
if (OidData == NULL) {
...
//----------------------------------------------------------------------------
//C#wrapper code I wrote:
[DllImport("packet.dll")]
extern static bool PacketGetAdapterNames(ref string pStr, ref ulong BufferSize);
//----------------------------------------------------------------------------
The function always returns false and the ref param variables are never updated (.
I have got a sample C app with source code, that uses the same API. This app works fine...
//----------------------------------------------------------------------------
WCHAR AdapterName[8192]; // string that contains a list of the network adapters
AdapterLength=4096;
if(PacketGetAdapterNames(AdapterName,&AdapterLength)==FALSE)
{
printf("Unable to retrieve the list of the adapters!\n");
return -1;
}
temp=AdapterName;
temp1=AdapterName;
while ((*temp!='\0')||(*(temp-1)!='\0'))
{...
-----------------------------------------------------------------------------------------
Has anybody got an idea?? I'm not very familiar with these kind of API calls.
G
|
|
|
|
|
A long in Win32 API is 32-bits, a long in .NET is 64 bits while an int is 32 bits.
If the string being passed in is a buffer (looks like it is) you should also be using StringBuilder instead of string.
With those two changes I come up with
[DllImport("packet.dll")]<br />
extern static bool PacketGetAdapterNames(StringBuilder pStr, ref uint BufferSize);
void GetAdapterNames() <br />
{<br />
System.Text.StringBuilder AdapterNames = new System.Text.StringBuilder(bufferSize);<br />
uint bufSize = (uint) bufferSize;<br />
<br />
PacketGetAdapterNames(AdapterNames, ref bufSize);<br />
}
I don't think ref is needed on the buffer because it will be passed like a char array to the function by the marshaler, putting ref on the buffer would be equivelant to WCHAR** in C/C++.
HTH,
James
Simplicity Rules!
|
|
|
|
|
You're the man! Thanks, it worked.
G
|
|
|
|
|
James,
Thanks again. I've got another question. Any idea how I can make a struct in C# that is the equivalent of: ??
typedef struct ADAPTER {
HANDLE hFile;
TCHAR SymbolicLink[MAX_LINK_NAME_LENGTH];
int NumWrites;
HANDLE ReadEvent;
UINT ReadTimeOut;
};
typedef struct PACKET {
PVOID Buffer;
UINT Length;
UINT ulBytesReceived;
BOOLEAN bIoComplete;
};
Thanks, G
|
|
|
|
|
Untested, but might work
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]<br />
public struct ADAPTER<br />
{<br />
public IntPtr hFile;<br />
public StringBuilder SymbolicLink;<br />
public int NumWrites;<br />
public IntPtr ReadEvent;<br />
public uint ReadTimeOut;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct PACKET<br />
{<br />
public byte [] Buffer;<br />
public uint Length;<br />
public uint ulBytesReceived;<br />
public bool bIoComplete;<br />
}
Good Luck
James
Simplicity Rules!
|
|
|
|
|
James,
(Not knowing anything about the WinPcap Library)
Explain to me why using a StringBuilder in place of the TCHAR SymbolicLink[MAX_LINK_NAME_LENGTH] array would work here?
Wouldn't a variation of something like the following be the right choice?
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst=MAX_LINK_NAME_LENGTH )]
public String SymbolicLink;
Thanks,
Neil
|
|
|
|
|
I don't know :-P
I originally had written what you had, then switched it to StringBuilder.
James
Simplicity Rules!
|
|
|
|