|
in the project settings -> Debugging -> Remote Debugger (Listbox above the list options)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Thanks Karsten, this looks exactly like what I was missing.
Sadly, it's not playing well over my long vpn link with different domains and users at each end - But it's a reason to make a VM locally and play again.
Thanks,
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Hi,
I have created an SDI application in which i am creating a client-server application using Socket Programming.I am connecting with multiple PCs.My application works fine if the remote PC gets connected.But when the remote PC is ShutDown the application hangs during gethostbyaddr function and takes some time to come out of it.If my client application is not running in remote PCs then it gets hang during connect function.Can anybody please help me out of this or suggest a different way to do it.Its urgent.
Thanks
|
|
|
|
|
Establish connection using thread AfxBeginThread . Then your main application thread won't stuck
|
|
|
|
|
Hi,
Thanks for your reply.I have already tried using AfxBeginThread. But i faced a problem with its synchronization.I am connecting with multiple PCs retreiving some information and then adding it to a tree in LeftView of my SDI application.So if i am using threading then it displays wrong information.Please suggest me another way other than this.
Thanks
|
|
|
|
|
using threads is the right way AND this leads syncronisation issues which you have to solve. You can use messages to your main window) to update the informations. Display some "Updating..." or empty fields til the needed information cames along.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
Can we give timeout for gethostbyaddr and connect function?
Thanks
|
|
|
|
|
You mean your server connects to multiple clients? Shouldn't it be the other way round? And read up on asynchronous sockets (on the server side). That will help you solve the 'hanging' issue.
CP has a section for articles on network programming. There's also Beej's Guide[^] which might help in clearing up the basics.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,
Thanks for your reply.But my problem is that my application hangs during gethostbyaddr and connect function which i am using for multiple pcs.Please suggest me a way so that my application takes least time durin the above mentiones operations.
Thanks
|
|
|
|
|
gethostbyaddr requires you machine to contact a DNS server to resolve the address.
If your DNS configuration is not correct or if the DNS server takes time to resolve (may be because of several indirections)gethostbyname can only wait the answer or wait for the connection timeout to occur (usually 40 seconds, where TCP is used).
Since this call is synchronous, there is no way to run around than multithreading.
All the communication tasks should be accomplished by secondary threads that send messages to the primary one (may be through the main window) as things happens, letting the primary one to manage the GUI by updating it and responding to user inputs.
Of course, you can set a timer that kills the communication thread if it doesn't signal events after a while, but consider that such "while" is not something you should decide (the response time of the DNS is a network administration parameter that is not relevant only to your application).
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Abinash Mohanty wrote: application hangs during gethostbyaddr
Hi Abinash! It's a known weakness in MFC's networking classes CAsyncSocket or CSocket , this is what you see when the GUI becomes unresponsive. You would need to implement an asynchronous hostname resolver, otherwise hostname lookups will be blocking everything (they can take quite a while). Btw, if you work with IP-addresses this problem will not occur.
As an alternative use one of the many C++ network classes, in alphabetical order: Alhem, Boost, SharkEngine, QT, and many others.
Hope this helps!
/M
|
|
|
|
|
hi,
i m again with localization issue.i have localized my app for japanese language.everything is showing correctly but tooltips are showing garbage instead of japanese.wat may be wrong?
|
|
|
|
|
have you copied the right string data to the tooltips structure or missed some conversions.
If all doesnt help can can provide the tooltip yourself. =>
CPPToolTip v2.1[^]
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
are u sure that the font used in the tooltip is installed?
|
|
|
|
|
yes font is installed that is why it is showing in other resources.
|
|
|
|
|
Hi,
I want to install usb device driver in xp machine through my mfc exe application.
My driver is a dll file with some other files referenced in an inf file.
User is able to install it by right clicking inf file and choosing "install".
But when I try to register it through my mfc, it does not install.
I have tried three functions..
1. SetupCopyOEMInf with inf file path
2. ShellExecute(NULL,L"open",L"rundll32.exe", infpath, NULL , SW_SHOWNORMAL);
3. ShellExecuteEx with rundll32.exe, driver path, and verb as "install"
but none succeed.
Any suggestion how to do it.
|
|
|
|
|
Hi,
I have a string from socket. Now I want copy some bits from this string . Like bits from offset 3rd to 27th.
Please tell that how can I do this?
Thanks and Regards,
Vishal Soni
|
|
|
|
|
Vishal Kumar Soni wrote: I have a string from socket. Now I want copy some bits from this string
Copy to what?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Copy these bits to long variable or in some other string.For different cases, I need to copy the bits in to different type of variables.
Thanks,
Vishal
|
|
|
|
|
const char s[]="foo";
int i= (*(int * )s) & 0x07FFFFC;
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini!
Regards,
Vishal Soni
|
|
|
|
|
|
|
Hi Alison,
I want to copy bits from string not byte. It can be starting from 4th bit of first byte to 5th bit of 6th byte.
GetAt is for bytes.
Thanks
Vishal
|
|
|
|
|