|
It would appear that your code, in response to the ERASEBKGND message, first draws the icon, then calls the default handler in the form. This will draw the icon, but then erase it in the next step. I think you show be calling the default handler first, then drawing your icon. You really shouldn't be drawing visible stuff within an erase message, but I don't know what your goal is, so...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave,
I am trying to paint sortingarrows in columheaders of a datagrid. The datagrid is a progress 4gl thing, I can only paint on the columnheaders using winapicalls. If I do these from within the 4GL the arrows are painted, but they disappear on WM_ERASEBKGND, they are not repainted. Since I cannot catch messages like WM_ERASEBKGND and WM_PAINT I am trying to do that within a C# dll.
Can you tell me how I should call the default handler first? If you mean that I have to rewrite the override of WndProc like following:
protected override void WndProc(ref Message messg)
{
// default first
base.WndProc(ref messg);
if (WM_ERASEBKGND == messg.Msg)
{
PaintExtras();
}
}
It does not help. I get the same result.
regards,
Stefan.
|
|
|
|
|
Hi all
please help me
What is the best programming language to program a satellite software?
|
|
|
|
|
SESCO Libya wrote:
What is the best programming language to program a satellite software?
I don't know why, I'm more worried about things falling from the sky from now on...
Yes, even I am blogging now!
|
|
|
|
|
For curiosity's sake, just what do you mean by "satellite software"?
Predicting their orbits? An operating system for a satellite? Command and Control software? Navigation software?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I mean digital receaiver software
i will programming sotware then i have remove the old software and put my software
|
|
|
|
|
You're still not providing anywhere near enough information to help you with anything. Digital Receiver software?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
No thanks... Don't have a dish and don't have any plans to get one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So you want to replace the operating environment on a DSS reciever with your own one? Any reason for this? To break the enryption code and see everything for free?
John
|
|
|
|
|
My vote would be to go with the language that is used for most weapons control and mission-critical systems... VB6, of course!
--Jesse
|
|
|
|
|
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
|
|
If you can get them to put in a PC with Windows I suggest C#
Gives a new meaning to the term Remote Desktop.
"A people that values its privileges above its principles soon loses both." -- Dwight D. Eisenhower
|
|
|
|
|
Hello
Does anyone know how i can create a drop-down menu in c# for the pocket pc.
Windows.Forms contains only a MainMenu and a ContextMenu but that's not what I need.
An example of how a drop down menu looks like is in the file explorer right at the top.
Someone told me i could create a toolbar with a button of style DropDownButton but that wil create a toolbar at the bottom and a menu that will fold upwards. I need something similar but the toolbar must be at the top and the menu should fold downwards and the in the .net cf I cannot set the location of the toolbar.
I know how to do this in Win32 API but not in .net since I'm quite new to .net . Please help.
Thank you.
|
|
|
|
|
Your question would be better handled in the Embedded/Mobile[^] Forum, which deals specifically with .NET Compact Framework developement.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I'm writing a small class to manage all my singlecall remote object. Ut basically return the transparent proxy of my object through the following code:
public object GetProxy()
{
object proxy=RemotingServices.Connect(myType,myUrl.AbsoluteUri);
return proxy;
}
The problem is that RemotingServices.Connect and Activator.GetObject will not throw any SockectExcpetion if the remote object is not accesible. This will only happen when I try to invoke any of the remote object's methods.
One of the main reasons I was making this manager class is to manage all socketExceptions in it. Is there anyway to test for a valid connection using Remoting.Channels.Tcp.TcpClientChannel or through any method of ChannelServices or RemotingServices?
I know u can do it through a normal System.Net.Sockets.TcpClient but cant seem to find the way when using the Remoting namespace's specific channels.
|
|
|
|
|
tooltip just appear when we move mouse over it parent, can we display notifyicon's tooltip when we click mouse on a button ?
thanks...
|
|
|
|
|
can we insert image to treeview's background ? and how ?
thanks...
|
|
|
|
|
The TreeView control doesn't support a background image. You'll have to write your own version of the TreeView control, supplying the code to draw the background image, or use a third party component.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I have this very strange problem:
When I set the propery FormBorderStyle.Sizable of a Form and when I set the size to be less than 122 in width the width is set to 122 by default.
It seems that there is a default width to a Form when I set FormBorderStyle.Sizable.
But when I set FormBorderStyle to any other value, than I can change the size to what ever I like.
Does anyone familiour with this problem? Is it a bug? How can I change this default width?
Please help me,
Anna.
|
|
|
|
|
I'm just guessing here, maybe you need space for the icons (maximize, minimize, close) on the title bar. Try removing them to see if this changes...
Yes, even I am blogging now!
|
|
|
|
|
This isn't the default size, but the minimum size a form can be while the ControlBox (Minimize, Maximize, and Close buttons) is enabled. Turning off the control box will enable you to shrink the form down further.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I hit this article which i was looking for.
Iam currently stuck in writing a Simple Multicast application. I would appreciate if any of you could trace out the exact problem.
I would like to know is there any problem with code, or we need to check some external settings. please also let me know how to do that.
I have pasted the code below:
Sender Code:
------------
#define DESTINATION_MCAST "235.6.7.8"
//#define DESTINATION_MCAST "224.0.0.2"
#define DESTINATION_PORT 2345
#define BUFSIZE 2000
void sendMulticast()
{
int nRet = 0, nSize = 0, nOptVal = 0;
SOCKET hSock;
char achInBuf[BUFSIZE];
struct sockaddr_in destAddr, socketLocalAddress;
u_short nSourcePort = 0;
struct ip_mreq stIpMreq;
/* create a datagram (UDP) socket */
hSock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
int error = WSAGetLastError();
if (hSock == INVALID_SOCKET)
{
printf ("Socket creation failed \n");
return;
}
// Bind the socket
// NOTE: Normally, we wouldn't need to call bind unless we were
// assigning a local port number explicitly (naming the socket),
// however Microsoft requires that a socket be bound before it
// can join a multicast group with setsockopt() IP_ADD_MEMBERSHIP
// (or fails w/ WSAEINVAL).
socketLocalAddress.sin_family = AF_INET;
socketLocalAddress.sin_addr.s_addr = htonl(INADDR_ANY); // any interface
socketLocalAddress.sin_port = 0; // any port
nRet = bind(hSock, (struct sockaddr*) &socketLocalAddress,
sizeof(socketLocalAddress));
if (nRet == SOCKET_ERROR)
{
printf ("Bind call failed \n");
}
// Join the multicast group
stIpMreq.imr_multiaddr.s_addr = inet_addr(DESTINATION_MCAST); /* group addr */
stIpMreq.imr_interface.s_addr = htonl(INADDR_ANY); /* use default */
nRet = setsockopt (hSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char FAR *)&stIpMreq, sizeof (stIpMreq));
if (nRet == SOCKET_ERROR)
{
printf ("Add membership option failed \n");
}
nOptVal = 32;
nRet = setsockopt (hSock, IPPROTO_IP, IP_MULTICAST_TTL,
(char FAR *)&nOptVal, sizeof(int));
error = WSAGetLastError();
if (nRet == SOCKET_ERROR)
{
printf (" set Sock Opt failed \n");
return;
}
/* disable loopback of multicast datagrams we send, since the
* default--according to Steve Deering--is to loopback all
* datagrams sent on any interface which is a member of the
* destination group address of that datagram.
*/
//By disabling this option we avoid getting the multicast packet back.
nOptVal = FALSE;
nRet = setsockopt(hSock, IPPROTO_IP, IP_MULTICAST_LOOP,
(char FAR *)&nOptVal, sizeof(int));
if (nRet == SOCKET_ERROR)
{
printf ("multicast loop option not supported ");
}
/* increase the IP TTL from the default of one to 64, so our
multicast datagrams can get off of the local network
*/
/*
Initialize the Destination Address structure
this is the address we send the multicast packet to.
*/
destAddr.sin_family = AF_INET;
destAddr.sin_addr.s_addr = inet_addr (DESTINATION_MCAST);
destAddr.sin_port = htons (DESTINATION_PORT);
//Init the buffer we send
memset (achInBuf,'\0',sizeof(achInBuf));
strcpy(achInBuf,"Saying Hi To You");
/*
We don't have to register for sending,, any host can send a multicast
packet, expect that the receiver one who registers only will get it.
*/
for (int nIndex = 1; nIndex <= 5; nIndex++)
{
nRet = sendto (hSock, (char FAR *)achInBuf,
strlen(achInBuf), 0,
(struct sockaddr FAR *) &destAddr,
sizeof(destAddr));
Sleep(2000);
if (nRet == SOCKET_ERROR)
{
printf (" Failed in send to \n");
return;
}
printf ("Sent the %d multicast packet %s\n",nIndex, achInBuf);
}
closesocket(hSock);
}
RECEIVER CODE
-------------
#define DESTINATION_MCAST "235.6.7.8"
//#define DESTINATION_MCAST "224.0.0.2"
#define DESTINATION_PORT 2345
#define BUFSIZE 2000
void receiveMultiCast()
{
int nRet = 0, nSize = 0, nOptVal = 0;
SOCKET hSock;
char achInBuf[BUFSIZE];
struct sockaddr_in srcAddr, destAddr;
u_short nSourcePort = 0;
struct ip_mreq stIpMreq;
/* get a datagram (UDP) socket */
hSock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
int error = WSAGetLastError();
if (hSock == INVALID_SOCKET)
{
printf ("Socket creation failed \n");
return;
}
#if 0
hostent* remoteHost;
unsigned int addr;
int namelen = sizeof(destAddr);
addr = inet_addr("172.21.37.109");
remoteHost = gethostbyaddr((char *) &destAddr.sin_addr.s_addr, 4, AF_INET);
// printf("host name %s",remoteHost->h_name);
int ret = getsockname(
hSock,
(struct sockaddr FAR *)&destAddr,
&namelen
);
error = WSAGetLastError();
remoteHost = gethostbyaddr((char *) &destAddr.sin_addr.s_addr, 4, AF_INET);
printf("host name %s",remoteHost->h_name);
#endif
//Winsock requires us to bind/name the socket before we become a member of group.
srcAddr.sin_family = AF_INET;
srcAddr.sin_port = htons (DESTINATION_PORT);
srcAddr.sin_addr.s_addr = htonl (INADDR_ANY);
nRet = bind (hSock,
(struct sockaddr FAR *)&srcAddr,
sizeof(srcAddr));
error = WSAGetLastError();
if (nRet == SOCKET_ERROR)
{
printf ("Bind call failed \n");
}
/* join the multicast group we want to receive datagrams from */
//Here initialize the group which we wish to join..
stIpMreq.imr_multiaddr.s_addr = inet_addr (DESTINATION_MCAST); /* group addr */
stIpMreq.imr_interface.s_addr = htonl (INADDR_ANY); /* use default */
//This calls creates and adds us as a member.
nRet = setsockopt (hSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char FAR *)&stIpMreq, sizeof (stIpMreq));
error = WSAGetLastError();
if (nRet == SOCKET_ERROR)
{
printf ("Set socket option failed \n");
return;
}
printf("\n Waiting for data \n");
for (int nIndex = 1; nIndex <= 5; nIndex++)
{
/* Recv the available data */
nSize = sizeof(destAddr);
nRet = recvfrom (hSock, (char FAR *)achInBuf,
BUFSIZE, 0,
(struct sockaddr *) &destAddr, &nSize );
if (nRet == SOCKET_ERROR)
{
printf ("receive from failure \n");
}
printf ("Received the %d Packet \n",nIndex);
achInBuf[nSize] = '\0';
char *recvIpAddressPtr = NULL;
recvIpAddressPtr = inet_ntoa(destAddr.sin_addr);
printf(" Received message::%s from IP:: %s \n",achInBuf,recvIpAddressPtr);
//drop the membership
} // for (int nIndex = 1; nIndex <= 5; nIndex++)
nRet = setsockopt (hSock, IPPROTO_IP, IP_DROP_MEMBERSHIP,
(char FAR *)&stIpMreq, sizeof (struct ip_mreq));
error = WSAGetLastError();
if (nRet == SOCKET_ERROR)
{
printf ("Drop membership socket option failed \n");
return;
}
closesocket(hSock);
}
|
|
|
|
|