|
Yeah, I should try to ignore it though it irritates a bit. It just says playful kids are around! Funny
286? WOWW!
|
|
|
|
|
I would guess it was because you didn't bother to look at the documentation before making your reply that questioned the relevance of a correct statement.
|
|
|
|
|
Anyone can vote as they please; they are free to vote you down for no other reason then that it amuses them to do so. I don't see what Chris can (or will be willing) to do about it; he's not about to turn the CodeProject into a dictatorship!
Steve
|
|
|
|
|
I'm using the win32 API, so I would like to be able to use the SendMessage Function to change the text in these two controls.
eg:
SendMessage(GetDlgItem(hDlg,IDC_TIMESLIDER),UDM_GETPOS,0,0);
*this code is for getting the position from a slider*
Anyone know where I can find the flag for changing text, or for that matter some decent documentation on this?
|
|
|
|
|
For instance see [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
hi!
i compiled the following code...
some error is being shown in _endthreadex and _beginthread
mpr.lib and wsock32.lib is included but still not working...
pls tell me if any other changes has to be made...
// HEADER FILE
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include<stdlib.h>
#include<stddef.h>
char buffer[]="ANY DATA"; // Static Global Data
/*-------------------------------------------------------------------*/
void MyFunction( void* Arg )
{
SOCKET Client=(*(int *)Arg);
while(1)
{
send(Client,buffer,100,0);
}
_endthreadex(0);
}
/*--------------------------------------------------------------------*/
void main(void)
{
int a,b,c,d; // For Server Address or Address of P1.
int port; // For Port No of Server or Port of P1.
struct sockaddr_in serv_addr,cli_addr;
SOCKET Server;
SOCKET Client;
int clilen=sizeof(cli_addr);
/***************************************************/
/* SOCKET INITIALISATION */
/***************************************************/
WSADATA WsaDat;
if (WSAStartup(MAKEWORD(1,1),&WsaDat) != 0)
{
printf("\n\n WSA Initialization failed! STOP!!!");
exit(1);
}
/***************************************************/
/* SOCKET CREATION */
/***************************************************/
Server = socket(AF_INET, SOCK_STREAM, 0);
if (Server == INVALID_SOCKET)
{
printf("\n\n Socket creation failed!STOP!!!");
exit(1);
}
else
printf("\n\n SOCKET IS CREATED SUCCESSFULLY...");
/***************************************************/
/* SERVER ADDRESS */
/***************************************************/
serv_addr.sin_family=AF_INET;
printf("\n\n ENTER THE SERVER IP ");
scanf("%d%d%d%d",&a,&b,&c,&d);
serv_addr.sin_addr.S_un.S_un_b.s_b1 =a ;
serv_addr.sin_addr.S_un.S_un_b.s_b2 =b ;
serv_addr.sin_addr.S_un.S_un_b.s_b3 =c ;
serv_addr.sin_addr.S_un.S_un_b.s_b4 =d ;
printf("\n\n ENTER THE PORT NO ");
scanf("%d",&port);
serv_addr.sin_port = htons(port);
/***************************************************/
/* BIND THE SOCKET*/
/***************************************************/
if (bind(Server,(struct sockaddr *)(&serv_addr),sizeof(serv_addr)) == SOCKET_ERROR)
{
printf("\n\n Attempt to bind failed!STOP!!!");
}
else
printf("\n\n BIND PROCESS IS CREATED SUCCESSFULLY...\n ");
/***************************************************/
/* LISTEN FOR RECEIVING CONNECTION*/
/***************************************************/
if(listen(Server,5)==SOCKET_ERROR)
printf("\n Error in Listenning The Socket!STOP!!!");
/*---------------------------------------------------*/
while(1)
{
printf("\n SERVER IS RUNNING ...");
Client=accept(Server,(struct sockaddr*)&cli_addr,&clilen);
_beginthread(MyFunction,0,(void *)&Client);
}
getch();
}
tell me the solution to remove the error:
unresolved symbol_@winmain16
pls do reply me as soon as possible..
|
|
|
|
|
Hi,
WSAStartup
Have you linked the following lib file to your project:
Library Use -> Ws2_32.lib : Link WSAStartup[^]
_beginthread
Have you included the following header file to your project:
#include <process.h> /* _beginthread, _endthread */
Link _beginthread[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
thanks a lot for ur earliest reply..
i will try out with ur information sir....
thanks again...
|
|
|
|
|
Hi all,
I have created a tab control with 4 tab items.2 tab items are disabled initially.Only the enabled tab items must be focussed when the mouse pointer is placed onto the corresponding enabled tab item.
problem i am facing here is even the disabled tab items are focussed when the mouse pointer is moved onto the corresponding disabled tab item
pls suggest me how to avoid getting focus on the disabled tab item
Thanks,
Sireesha
|
|
|
|
|
You could try catching the GetFocus event and setting the focus back to the previously-focused tab.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
I seen many examples about ListBox,in DrawItem they use the state and the action to decide how the item should be drawn. I am puzzled that what is difference between focus and the select or selected.Besides,is the whole ListBox redrawn when I click the item when the program are running?Could somebody give details~?
Thanks~
|
|
|
|
|
In many controls (like a standard listbox) the focus state and selected state are set at the
same time.
Having both states gives custom controls a way to indicate keyboard focus without an item being selected or vice-versa.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
In the standard listbox rendering, Focus typically draws a dashed rect around the "current" item and Selected shows the item in color. The difference is useful if you want to e.g. keep the Selected item highlighted when the listbox is not focused.
Usually only the affected items are redrawn. For example, if you have item 1 selected and click on item 2, you'd get draw messages for item 1 (with the selected flag cleared) and item 2 (with the selected flag set), but no draw msgs for items 0 or 3. If oyu *scroll* the listbox you'll get draw messages for all visible (either partially or fully) items, but not for those items whose rects fall outside (above/below) the window's client area.
|
|
|
|
|
Hello friends, this me back with a question. I ve got a code snippet for finding the list of systems in a LAN.It lists the computer name and the IP address. Now i wanted to know how i can find the status of the system ie. if it is active or not.
here is the piece i used to found the systems:
for ( unsigned int i = 0; i < BufferSize/sizeof(NETRESOURCE); i++, NetResource++ )
if ( NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY )
{
if ( NetResource->lpRemoteName )
{
CString strFullName = NetResource->lpRemoteName;
if ( 0 == strFullName.Left(2).Compare("\\\\") )
strFullName = strFullName.Right(strFullName.GetLength()-2);
gethostname( szHostName, strlen( szHostName ) );
host = gethostbyname(strFullName);
ptr = (struct in_addr *) host->h_addr_list[0];
int a = ptr->S_un.S_un_b.s_b1; // 211.40.35.76 split up like this.
int b = ptr->S_un.S_un_b.s_b2; // 40
int c = ptr->S_un.S_un_b.s_b3; // 35
int d = ptr->S_un.S_un_b.s_b4; // 76
lpszSystemInfo = tchBuffer;
// Get and display the user name.
GetUserName(lpszSystemInfo, &cchBuff);
strTemp.Format("%s --> %d.%d.%d.%d",strFullName,a,b,c,d);
pList->AddString(strTemp);
}
}
}
this is a downloaded code friends. but still i want to know how.if we can find the IP address, then there must be a way to find its status. Pls do let me know if anyone of you know this.Thanks (in anticipation)
Malini
|
|
|
|
|
Malini Nair wrote: Now i wanted to know how i can find the status of the system ie. if it is active or not.
(If I understand your question correctly ...)
What about the function:
FILE *_popen(const char *command,const char *mode)
You can uses this function to ping the other machine, and know the status.
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
char psBuffer[128];
FILE *pPipe;
if( (pPipe = _popen( "ping 192.168.0.1", "rt" )) == NULL )
exit( 1 );
while( !feof( pPipe ) )
{
if( fgets( psBuffer, 128, pPipe ) != NULL )
printf( psBuffer );
}
printf( "\nProcess returned %d\n", _pclose( pPipe ) );
}
Hope this helps ..
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
How did you get your array of NETRESOURCE structs? If an item is in the array then I would assume
it is active. What do you mean by active status?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Im having a problem with creating an object of a crystall report. In C# we can create an object of a crystal report by simply
Report1 rpt = new Report1();
but in c++ how to do that? c++.net doesnot allow it. if some one knows how to create an object of a report pls let me know. please. thanks.
Pubudu
|
|
|
|
|
Hi everybody!
I downloaded a project.When I compiled it, I got an error saying 'Cannot open Iphlpapi.lib'.
Then i downloaded the library file and included it in the project.
Still it shows this error!
I dono what has to be done!
Please help me!
Thanks in advance!
|
|
|
|
|
you have to tell the linker where to find the .lib file.
look in your project settings, and reach the linker "additionnal libraries" option...
|
|
|
|
|
Do you have the latest platform SDK installed.
To include a lib file you can also use...
Another option is use #pragma comment( lib, "Iphlpapi.lib" )
|
|
|
|
|
Nibu babu thomas wrote: #pragma comment( lib, "Iphlpapi.lib" )
Why is that called "comment" any relavance?
286? WOWW!
|
|
|
|
|
_8086 wrote: Why is that called "comment" any relavance
From MSDN:
#pragma comment( comment-type [, commentstring] )
Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation.
lib:
Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.
|
|
|
|
|
Thanks I get it now.
286? WOWW!
|
|
|
|
|
_8086 wrote: Thanks I get it now.
Really !
|
|
|
|