|
Hi,
We made a project of server and client which are connected through sockets in LAN.
Now we have a idea that to implemnt the same project in internet that the client can get access to server through Internet not through Sockets.
I dont know a small bit about internet connectivity.
Can u anyone pls give idea for this?
Whether i have to write the whole project in to a new thing or shall i make a small changes in old project for internet connectivity...
Pl help me out?
Anu
|
|
|
|
|
That depends on your needs. If you want security, you should use Web Services. DCOM and RPC are also possible, but they are only recommeded for trusted boundaries. Also, there are performance issues with these over the internet, since they are more OOP oriented. XML-Webservices can be implemented using the ATL-Server templates, check here :. In any case, there are certain design issues to be considered when stepping from LAN to Internet. Latency is usually much higher, so try to minimize the number of function calls (no chatty interfaces). Try to put as much information as possible into a single transmission. Bandwith is cheap, latency is expensive.
I hope that helps you a little.
|
|
|
|
|
Hi,
I am doing an application which display's the windows explorer in tree view format.Now when i double click a particular item ,folders and files will be listed below as subitems.They will open when we right click on that particular file and select open from the context menu. How can i open the file or folder straightly by double clking on that.
Thanks in advance,
Radhika.
|
|
|
|
|
use ShellExecute as follows
ShellExecute( 0, _T("open"), csFileName ,0,0,SW_SHOW);
give the full path of the file in the place of csFileName
nave
|
|
|
|
|
Thanks naveen ,it is working fine.
|
|
|
|
|
|
Dear members, i have a query, In my dialog box i have an Edit Control that takes numeric value,
Now after typing the value in the edit box, i press RETURN key for some validation to take
place, for this task i am handling the PreTranslateMessage() for the VK_RETURN message, Now the
problem is when i highlight the CANCEL button (with tab button)in the dialog box and try to close the Dialog Box by
pressing ENTER button it is not responding (the dialog box is not closing), the reason is obvious that
since i am handling the PreTranslateMessage() it is not responding, but i also want the dialog to
be closed when i hit the Enter button after highlighting the Cancel button, how can i accomplish
this??
OR is there any other way to handle the RETURN key validation stuff than using PreTranslateMessage(), so that the Cancel button's
original behaviour is not lost.
Please Help!!!
thanx in advance
kumar
|
|
|
|
|
The usual approach in MFC when overriding such functions for certain events is to call the base-class implementation of that function afterwards. You just do all Preprocessing you need, and then you call the base-class implementation and propagate its return value.
|
|
|
|
|
Along with the checking of VK_RETURN, check whether the handle is that of edit control.
if( WM_KEYDOWN == pMsg->message )
{
if( VK_RETURN == pMsg->wParam && m_edit.m_hWnd == pMsg->hwnd )// m_edit is the control variable of the edit control
{
// do ur computation
return TRUE;
}
}
nave
|
|
|
|
|
thanks a lot Naveen, its working
thanx in advance
kumar_windows
|
|
|
|
|
Hello,
ich have a question to threads and the function sleep.
We have a main programm and load from this a dll as a thread with AfxThreadStart and it is stopped with AfxThreadStop.
The dll has a method run in which is a loop which proofs a condition and runs as long as this condition is true. to stop this thread i set the condition to false. after the loop has stopped another boolean ist set to false so i know that the thread is stopped and i can delete everey references an stop the whole programm.
the pseudo code of the dll
start() {
afxThreadStart(this, true);
}
stop (){
running = false;
}
run() {
stopped = false;
while(running) {
do something
}
stopped = true;
AfxStopThread();
}
isStopped() {
return stopped;
}
I have a gui and a button, if i hit the button, the thread should be stopped and i wait until it has stopped, so i can delete all refereces to some other objects.
pseudocode for the main prog
hitButton() {
dllThread->stop();
while(!dllThread->isStopped()) {
sleep(1000);
}
delete references;
...
}
The main Problem is, that if i use the slepp method in the main Programm (see code for main prog.), it seems that the dll-thread sleeps too.
thanks for your help
Timo
|
|
|
|
|
hi,
How u knew that dll thread sleeps too ?
Regards
Velayudhan
|
|
|
|
|
Because the main prog ends and deletes all references to some objects, and then an error occurs beccause the thread still tries to use one of the objects and then everything crashes . the stop function of the main prog is faster than one iteration of the loop of the dll, so i inserted the sleep. but if i insert a AfxMessageBox bevor the sleep, then everything works fine. i dont know why, maybe the messagebox blocks the main prog and the dll-thread works and finds the stop flag.
|
|
|
|
|
Usual practice is to use an event as a trigger.
The original thread creates an event and keeps the handle to it, then creates the second thread.
The second thread does whatever it needs to do, but periodically waits for the event to be signalled. If the event is signalled, it's time to quit.
The original thread can stop the secondary by signalling the thread.
See:
CreateEvent(), SetEvent(), WaitForSingleObject() in MSDN
Steve S
Developer for hire
|
|
|
|
|
ok, thanks i'll try it as fast as i can
|
|
|
|
|
we can easy to get control when click left-mouse on button.
how do we get control when using right-mouse or
middle-mouse click during the mouse on the button?
thanks!
|
|
|
|
|
Hi,
Hope this might help you:
<a href="http://www.codeproject.com/cpp/gestureapp.asp?target=mouse%7Cgestures">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
michaelleetw wrote: we can easy to get control when click left-mouse on button.
how do we get control when using right-mouse or
middle-mouse click during the mouse on the button?
If you want to get a window that is under the mouse pointer use WindowFromPoint .
|
|
|
|
|
hello!! can anyone tell me how to read data from Base Address (also called as I/O Port, I/O address, I/O port Address and base port) of any device like a hard Disk? I am using inp() and outp() functions, but still not able to read data from the device. can anyone tell me how exactly i need to do that?? Thanks..
vijay.
|
|
|
|
|
On which platform, using which API, ... ?
Your post lack of information.
If you try to do that using the win32 API, I think you won't be able to do that (it is buried very deep in the core of the system and you don't have access to that).
Which device are you trying to connect ? Using which communication media ? Serial port, parallel port, ... ?
|
|
|
|
|
Hello sir!! thank for replying. Actually I am trying to Read a Sector Of the Hard Disk using the Base Address of the Hard Disk. I want to retrive the Model Number, manufacturer's serial number of the Hard Disk. i came to know from someone that all those information is stored in a sector in the Hard Disk. i have to retrive that sector to get the hard disk info. so i want to read that sector by using the Base Address of the device. The WMI classes will give the hard disk info but they dont work in Windows 9X. so, can u tell me what exactly i should do??
vijay
|
|
|
|
|
aroli vijay wrote: Actually I am trying to Read a Sector Of the Hard Disk using the Base Address of the Hard Disk. I want to retrive the Model Number, manufacturer's serial number of the Hard Disk. i came to know from someone that all those information is stored in a sector in the Hard Disk.
They are? I always thought that they were set in the firmware. On SCSI/ATAPI devices, you normally issue some 'identify' command to the device, and get the results that way.
On WinNT/XP/Server2003, you can't use inp() or outp(), although it's possible for some ports if you have a device driver. On 9x I believe that you would have to use a VXD (virtual device driver) anyway.
I'm happy to be proved wrong on any of the above, as I'd have learned something new!
Steve S
Developer for hire
|
|
|
|
|
hi how can i get total path of a file or a folder?
|
|
|
|
|
Quite obviously, if you don't have it, you have to search the entire file system to find it. You'd do better, if your list control contains files from more than one location, to store it when you are inserting the name, and know the path, for example in a map.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|