|
Here,I want the client connect the sever using translate its username and password in the login dialog.When the server checked the user account correct, the server would return a success flag to the client,then,the client create the second dialog. Others who using the likely second dialog would send messages to it and it also cound return messages to the others.
There also would create the third dialog and translate messages each other.
But all the clients should keep connected to the server and doesn't create second connect. I have no idea to resolve such problems.
I had done such things by changing the m_socket from protected to public as you said. Since there will be some wrong way,I could not know how to do,now.
Thanks
|
|
|
|
|
kcynic wrote: I want the client connect the sever using translate its username and password in the login dialog.
When you've received the request for authentication in the main window, you should pop up a modal dialog asking the user for login information, i.e. user name and password. This means that the main window is the parent of the "login dialog" and the dialog itself doesn't need to have a connection; it simply takes some user input that the main window can get when the dialog is dismissed by the user. The login information should then be sent by the socket thread by the main window in order to reach the server for authentication.
kcynic wrote: There also would create the third dialog and translate messages each other.
I don't really understand the point of this third dialog.
In Newcomer's example there is a control that displays the data sent and received. Does the third dialog substitute this control?
If the answer is 'yes' I suggest you create the third dialog modeless and put the information there from the main window, keeping the main window as "information collector".
kcynic wrote: But all the clients should keep connected to the server and doesn't create second connect. I have no idea to resolve such problems.
If you by "all clients" mean "all your windows", you don't need more than one connection. Simply let the main window be the central point that gathers the information and reacts to it, dispatching the information to other windows if needed.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
And the theApp is the main thread.But if I pass messages to it,how to retrieve returns from theApp?
|
|
|
|
|
how to insert a picture control in following article :::
http://www.codeproject.com/directx/LiveVideo.asp?df=100&forumid=50103&fr=26
i wanna know the steps...
NT
|
|
|
|
|
tyagineha wrote: i wanna know the steps...
You could always download the source code from the article - I bet the steps are there
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: You could always download the source code from the article - I bet the steps are there
I think yes but if we always have source code.;)
|
|
|
|
|
Can u tell me the link........
NT
|
|
|
|
|
I got the link from you
The Link[^]
Look for the "Download source files" link at the top of the article.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
It can be done with GetExtendedXXXTable functions of IPHelper API , but i cannot use under Windows2000 , i only have GetXXXTable for it but they dont give me process ids , i mean i want to learn which processes do any thing on tcp/udp ports in Win2000. How can it be done like TCPView on Pre-XP Systems ?
Thank you very much...
|
|
|
|
|
Hi,
I have a for loop, which executes for 100 times. I want to skip initial 50 iterations, and from 51st iteration, I want to execute the code statement by statement.
Please suggest, if any easy method is there.
Thanks and regards,
Raja Pratap
|
|
|
|
|
|
I want to debug using the visual studio debugger. Meaning using F9 and F10..etc mechanism.
I meant to ask, if there is some way to iterate for 'n' many times in a particular loop.
|
|
|
|
|
Raj Prathap wrote: I meant to ask, if there is some way to iterate for 'n' many times in a particular loop.
I see ... well Naveen solotion should work
Regrads
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
you can put a conditional break point. To do this follow this steps
eg
for( int nIdx =0;nIdx<100;nIdx++)
{
...
}
1. Put a break point in the next line after for loop.
2. Take the breakpoint window( uner the edit menu or press ctr + B )
3. select the break point you put in the for loop
4. Press the "condition" button.
5. In the new dialog box apperared enter put nIdx>=50
|
|
|
|
|
Thanks, that solved my problem
|
|
|
|
|
Naveen.R wrote: eg
for( int nIdx =0;nIdx<100;nIdx++)
{
...
}
1. Put a break point in the next line after for loop.
2. Take the breakpoint window( uner the edit menu or press ctr + B )
3. select the break point you put in the for loop
4. Press the "condition" button.
5. In the new dialog box apperared enter put nIdx>=50
Another suggestion is...
#ifdef _DEBUG
#define DBREAK( condition ) if(( condition )){ _asm int 3; }
#else
#define DBREAK( condition )
#endif
for( int nIndex = 0; nIndex < 100; ++nIndex )
{
DBREAK( nIndex == 50 )
}
|
|
|
|
|
Hi all
Let me explain my requirement.
I want to create a Activex control which has two methods SetPicture() and GetPicture().
SetPicture(VARIANT data) should copy the contents of the data to the clipboard and VARIANT GetPicture should return the contents of the clipboard. I know how to manage clipboard.
But I dont know how to manage the VARIANT to hold the bitmap. Could anyone point me to a good resource or spare time to tell me how to accomplish this.
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: SetPicture(VARIANT data) should copy the contents of the data to the clipboard and VARIANT GetPicture should return the contents of the clipboard
Since you need to pass the bitmap between the same process, it better to pass the handle of the bitmap to and from the active-x.
Other option is to pass the bitmap's pixel data. i.e retrive the pixel data. set the pointer of the bits array to the VARIANT object then pass it. The activex should again covert this pixel data to bitmap.
I think the first one is simple.
|
|
|
|
|
Thankyou
If I want to pass the handle of the bitmap what should be the type of the VARIANT?
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: what should be the type of the VARIANT?
VT_I4
cast the handle to a long value and set it to the lVal of the VARIANT.
|
|
|
|
|
Hi
Thats fine. Thankyou.
Now to test my activex i am using vb.
There I created a picturebox and am trying to set the picture property of picturebox using MyControl.GetBitmap (After copying a bitmap to the clipboard)
Should this work or is there anything else am to do. (Anyway this is not working as expected am getting an Object required error.
This is the VB code. Sorry for posting VB code in this forum, just for clarity
<br />
Dim bit As Variant<br />
bit = AaClipboard1.GetBitmap<br />
Picture1.Picture = bit
End Sub)<br />
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
hmm my VB is weak. How ever the Picture1.Picture is a IPictureDisp object. Please search whether there is any method to create IPictureDisp from HBITMAP.
like
Dim pic As IPictureDisp
pic == somefunction( var )
Picture1.Picture = pic
|
|
|
|
|
Hi
thankyou, i got it working.
I made it VARIANT long.
In vb I used a win32 api CreateFromHandle and passed the variant type.
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: win32 api CreateFromHandle
Win32 API??? I didnt find it in MSDN. Can you tell me where it is declared?
|
|
|
|
|
Hello Friends
I am trying to make the user browse a file and save its contents in a folder (on local hard disk) I already did the browse part.
for the saving contant in folder, i am writing it inside this function:
char string[1001];
CString strLine = "";
CString buffer = "";
CStdioFile file;
file.Open("m_file", CFile::modeRead); [ m_file ==> file name ]
while(file.ReadString(strLine))
buffer += strLine;
file.Close();
text->SetWindowText( buffer ) ;
I am confusing m_file is file name or path name . and how i will be read the contant from buffer .
When i run this program an assertion occur
Plz any one help me or give some example for done this task.
Regard's
Kaushik
|
|
|
|