|
Tanks monty, with that mayn characters, I think I´m on the safe side
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
how to get syetem ip addres in an dialog box
i use ipadress control for that
but can somebody tell me wat code i write on a button to get ip address of the sytem
Ashish Dogra
MCA
Noida
|
|
|
|
|
gethostname() for getting name of system and then call
gethostbyname()
See MSDN for more help on these function
Regards
Abhishake Lahare
|
|
|
|
|
thanks
but can you tell me what are parameters in the gethostname()
as a code to help me
Ashish Dogra
MCA
Noida
|
|
|
|
|
Hi jigar .
void GetIPAddress(char *ipAddress)
{
#define MAX_NAME_LEN 65
WSADATA wsaData;
if ( WSAStartup( MAKEWORD( 2, 2 ), &wsaData ) == 0 )
{
char HostName[MAX_NAME_LEN];
struct in_addr *ptr;
gethostname (HostName,MAX_NAME_LEN);
hostent *host = gethostbyname(HostName);
if(host == NULL)
{
ipAddress = NULL ;
WSACleanup( );
return ;
}
ptr = (struct in_addr *)host->h_addr_list[0];
CString str;
str.Format("%d.%d.%d.%d",
ptr->S_un.S_un_b.s_b1,
ptr->S_un.S_un_b.s_b2,
ptr->S_un.S_un_b.s_b3,
ptr->S_un.S_un_b.s_b4);
strcpy(ipAddress,(char*)str.GetString());
}
WSACleanup( );
}
|
|
|
|
|
|
how can i get the images into listcontrol.
thanx
|
|
|
|
|
Hi,
Use setimagelist function.
Thanks
|
|
|
|
|
ok
thanx for it but i forget to tell u one thing more that i have to Add string
also with image in the next column.these record will be in row.
thanx
|
|
|
|
|
See GetImageList in CListCtrl Members
whitesky
|
|
|
|
|
ok
thanx for it but i forget to tell u one thing more that i have to Add string
also with image in the next column.these record will be in row.
thanx
|
|
|
|
|
See SetItem and SetImageList
whitesky
|
|
|
|
|
How can i find whether a microphone is connected or not in my system?
Thanks,
Poornima
|
|
|
|
|
im not sure see Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Hello everyone,
I am wondering what is the easiest and safest way to find the value of a macro? For example, if I,
#define FOO "value1"
The value of FOO I can get is "value1" and if then I,
#undef FOO
#define FOO "value2",
then the value of FOO I can get is "value2".
thanks in advance,
George
|
|
|
|
|
Hi,
I didnt get the question,basically the macros are replaced by the preprocessor,so there is nothing like finding the value at the runtime.
Hope this helps.
Thanks
|
|
|
|
|
Thank you Code_Zombie!
Do you mean we can only get the value during compile time other than during runtime?
My question is, during compile time, how can we (developer, other than compiler itself) know the exact value of a specific macro -- which compiler is using -- to avoid mis-defining the value of a macro?
(I know compiler knows the value, but during normal compile stage, it is not exposed to the end user which value is defined to a specific macro, so there may be mis-defined macro value.)
regards,
George
|
|
|
|
|
I'm using CSingleLock , When one thread lock an object, and other thread wants to lock that object at that time , The second thread will wait for unlocking by the 1st thread or it just skip that locking code.
If it need to wait, It will automatically wait or have to give code to wait ?
--------------------------------------------------------------------------
CMutex g_m1;
CSingleLock lock1(&g_m1)
- - - - - - - -- - - - - - - - - - - - - - - - - - - -
if (lock1.Lock()) {
m_LockStatus = "Got Lock";
UpdateData(FALSE);
} else {
m_LockStatus = "Failed";
UpdateData(FALSE);
}
}
-----------------------------------------------------------------------------
Thanks to all.
|
|
|
|
|
you may try :-
WaitForSingleObject
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi all,
I am working with vc++(6).I have an application,in which i need to display list of printer names in a Listbox.How can i get list of printers
thanks
vinod
|
|
|
|
|
See EnumPrinters
whitesky
|
|
|
|
|
Thank you,
Now i am getting list of printer names using EnumPrinters
|
|
|
|
|
Hi,
I am trying to assign a drive letter for the newly created raw volume. I
used the code example mentioned for DefineDosDevice function. This program
takes drive letter and devicename as parameters. I could successfully run the
program on 2k3 servers. But when i try the same code on 2k server, it runs
for first time. then again from disk management console, i delete the drive
letter and try to run the same program but this time it fails with error 87.
I have passed the drive letter for the program which is not existing on the
system but still it throws an error. Can somebody please help me in this
regard or any pointers to such related problems.
I took the program from the link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/editing_drive_letter_assignments.asp
The error i got is as below
editdrive.exe v:\ \device\harddisk2\partition1
(editdrive.exe is my program )
error 87: could not add v:\
I have compiled my program on windows XP.
On 2k professional i saw that it assigns the drive letter but not the one i
requested. even in this case the error is still popped out.
Thanks with best Regards,
Pavan
|
|
|
|
|
hello
i want to know that as animation control is used to play clip of .avi type.
now i use folloeing code in a button to play a clip
m_ani.Open(_T("Findfile.avi"));
m_ani.Play(0,-1,-1);
but clip is not playing .now i want to know that (_T("Findfile.avi") how this will pick clip as .avi clip is stored at c:\MSDN\samples\vid98\content\mmedia now plz tell me.
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|