|
Try a separate thread dedicated to JUST socket I/O.
Use WSAEventSelect() to have an event object signaled on FD_READ (and maybe FD_CLOSE).
Use this event to wake your I/O thread and recv ALL received bytes (call recv until you get
WSAEWOULDBLOCK error), adding the received bytes to a buffer each call. Loop and wait again on the
event. Let another thread process the received data.
This works very fast even on TCP/IP because you are keeping the receive buffer flushed.
Much better than doing it on the UI thread through Windows messages like you are now.
Mark
|
|
|
|
|
hello,
I have a Table which has no. of columns.
I want to insert values into only 2 columns....
how to achive this..
INSERT INTO table-Name(Column-name1, column-name2) Values(value1,value2)
i used this one..bur shows errror in insert into statement.
Born To Code
|
|
|
|
|
Hi,
The values you supplied must be formatted with valid qualifiers that matches the DATA TYPE of the column where you want to insert it to.
Example if Column-name1 is a date then value1 should be like #value1#
if it is a string value1 should be 'value1'
Hope this help.
Angbo2006
|
|
|
|
|
Is this[^] helpful for you
|
|
|
|
|
rahul.shendurnikar wrote: i used this one..bur shows errror in insert into statement.
What error?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i am using mfc activex control wizard. I want to know how to split the bounding rectangle of the specified window in to two and to call the already created two dialog boxes on the splitted window.
thanx in advance,
zari
|
|
|
|
|
Hi
In my application i need to run another .exe thru a button click..Please help how i will do this...
Thanx In advance
birajendu
CyberG India
Delhi
India
|
|
|
|
|
See ShellExecute or CreateProcess
|
|
|
|
|
thanx...i think CreateProcesses is the right option for my need.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
|
use win32's createProcess(....) function... call this function in the MFC's button click handler function.. it will run new exe as a seperate process... refer MSDN for detailed documentation.
|
|
|
|
|
Hi i want to import favourites of current user who logged in , into the current working directory(for exampl my application runs from F:\ drive, then i want to import into F:\ drive), and i want to export from current working directory to Favourites?
How can i do it?
|
|
|
|
|
Have a look at <a href="http://www.codeproject.com/script/comments/forums.asp?msg=1705667&forumid=1647&mode=all&userid=1817418#xx1705667xx">SHGetSpecialFolderPath</a>[<a href="http://www.codeproject.com/script/comments/forums.asp?msg=1705667&forumid=1647&mode=all&userid=1817418#xx1705667xx" target="_blank" title="New Window">^</a>], GetCurrentDirectory and CopyFile
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
How do i can change keyboard language between my installed languages?
Please give me the code.Thanks.
|
|
|
|
|
I met a strange problem.
This is my code
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
DWORD datasize = 48000;
HWAVEIN mh;
WAVEFORMATEX wf;
wf.wFormatTag=WAVE_FORMAT_PCM;
wf.nChannels=1;
wf.nSamplesPerSec=8000;
wf.nAvgBytesPerSec=8000;
wf.nBlockAlign=1;
wf.wBitsPerSample=8;
wf.cbSize=0;
int r;// = ;
cout << "poo1";
int k = waveInOpen(&mh,WAVE_MAPPER,&wf,NULL,0L,CALLBACK_WINDOW);
cout << k;
cout << "poo2";
if (k == MMSYSERR_NOERROR)
cout << "success";
else
cout << "fail";
cout << "poo7";
//WAVEHDR mp;
//mp.dwFlags=0;
//mp.dwUser=0;
//mp.dwLoops=0;
//mp.dwBytesRecorded=0;
//mp.lpData = (char *)GlobalLock( GlobalAlloc(GMEM_MOVEABLE|GMEM_SHARE, datasize) );
//memset(mp.lpData, 0, datasize );
//mp.dwBufferLength = datasize;
//int p = waveInPrepareHeader( mh, &mp, sizeof(WAVEHDR) );
//cout << p;
cout << "poo4";
//waveInAddBuffer
int i ;
r= waveInGetNumDev();
cout << "poo5";
cout << r ;
cin >> i ;
//cout << " " << endl;
return 0;
}
and It runs the result following
poo0poosuccesspoo3
It's strange.
I change the code, but the program dont know.
Can somebody help me?
minihotto
|
|
|
|
|
#include<iostream.h>
#include<afxwin.h>
#include<mmsystem.h>
#pragma comment(lib, "winmm.lib")
int main(int argc, _TCHAR*argv[])
{
DWORD datasize = 48000;
HWAVEIN mh;
WAVEFORMATEX wf;
wf.wFormatTag=WAVE_FORMAT_PCM;
wf.nChannels=1;
wf.nSamplesPerSec=8000;
wf.nAvgBytesPerSec=8000;
wf.nBlockAlign=1;
wf.wBitsPerSample=8;
wf.cbSize=0;
int r;// = ;
cout << "poo1";
int k = ::waveInOpen(&mh,WAVE_MAPPER,&wf,NULL,0L,CALLBACK_WINDOW);
cout << k;
cout << "poo2";
if (k == MMSYSERR_NOERROR)
cout << "success";
else
cout << "fail";
cout << "poo7";
cout << "poo4";
//waveInAddBuffer
int i ;
r= waveInGetNumDevs();
cout << "poo5";
cout << r ;
cin >> i ;
//cout << " " << endl;
return 0;
}
Try out
mythili
|
|
|
|
|
Thanks^^
I know where is the problem.
|
|
|
|
|
It's called caching. You need to end each of the cout statements with endl .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
is it possible to use the slider control programatically? like when i move my mouse on the client area of my SDI, my slider control on my Form view is also being dragged corresponding to the movement of my mouse...if possible can someone help me.. thanks
positive vibes
|
|
|
|
|
dacky wrote: is it possible to use the slider control programatically? like when i move my mouse on the client area of my SDI, my slider control on my Form view is also being dragged corresponding to the movement of my mouse...
Handle the WM_MOUSEMOVE message. Each time your handler function gets called, you'll need to determine if you are moving left or right (based on the previous values). Move the slider control accordingly.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
I want to write my program settings into a configuration file, but I have CString object and CArray data structures, so what is the best way to do this?
My structures look like:
typedef struct tagFavoriteSettings<br />
{<br />
struct FavoriteElement<br />
{<br />
CString strName;<br />
CString strPath;<br />
};<br />
CArray<struct FavoriteElement,struct FavoriteElement> Elements;<br />
tagFavoriteSettings(){}<br />
}FavoriteSettings;
Thanks alot
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
The oldest way to do that is to create a .ini file (I don't recommend this approach)
The next old way would be to use CObject Serialization ( I don't recommend this but it might be best for you)
The current way is to use XML and XML API's (like MSXML.dll)
led mike
|
|
|
|
|
hi,
i have to program to validate countries, states and cities for North of America. Do you know a SOA or somethings else that returns all countries, states and cities?
thanks.
|
|
|
|
|
You will need to find a database to either download or query at runtime.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Before you said somethings to another person, you have to understand his needs and approches. If not, yours words are insignificant this means you are useless.
MK.
|
|
|
|