|
|
Hi Folk,
I wanna create an application which should be run as a windows service. Application should receive HTTP request from the third party application. HTTP request hold xml data, i wanna parsing that and store it into local file. For above the constrains what type of application should i create using win32 or mfc?. Plz.. get me out from this confession...
thanks in advance
suzuuu
modified on Thursday, April 22, 2010 1:32 AM
|
|
|
|
|
Nor the Win32 or MFC, I better suggests you to use C#.net. It will be much easier to do that with C#.net. Also you can use MFC, if you want to do it.
|
|
|
|
|
Okay... should i use socket to receive http request?
|
|
|
|
|
Are you want to create your own http server?
|
|
|
|
|
I have no idea about server! But, my need is just receive HTTP request and parse xml then store it into local file. That's all
|
|
|
|
|
As I get you want to create server. Simple open a socket and start listening on a specified port.
for test
open internet explorer. type http://127.0.0.1:5000
5000 is port number on which server is listening request. It is changable but should be same on both server and client.
On server read socket.
|
|
|
|
|
TQ manish... Is there any specific socket for HTTP in windows? OR is there are any specific format to play with HTTP request through socket?
|
|
|
|
|
There is no specific socket for http.
|
|
|
|
|
Thank you very much for your reply...
|
|
|
|
|
|
|
Dear all,
I have a problem when using ParseDisplayName function to get ITEMIDLIST of USB Memory device. The scenario is: I insert USB into PC and catch an event by [OnDeviceChange] function, then I use ParseDisplayName function to get ITEMIDLIST of inserted USB memory, but it is failed.
This phenomenon only occur in Widows XP Service Pack 2, in Windows XP Service Pack 3, it doesn't happen.
Here is a code I use to get ITEMIDLIST by ParseDisplayName function(the input path is valid).
....
LPITEMIDLIST l_pIDL;
LPSHELLFOLDER pDesktopFolder;
if( ::SHGetDesktopFolder( &pDesktopFolder ) != NOERROR )
{
return NULL;
}
OLECHAR ochPath[MAX_PATH];
ULONG chEaten;
HRESULT hRes;
::MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, W2A(p_strPath), -1, ochPath, MAX_PATH );
hRes = pDesktopFolder->ParseDisplayName( NULL, NULL, ochPath, &chEaten, &l_pIDL, &p_uAttribute);
if( hRes != NOERROR )
{
l_pIDL = NULL;
}
.....
One more thing is: if I try to call this function again, and it will success.
But I don't know why I need to call it twice in Windows XP Service Pack 2.
If anybody knows this phenomenon, please help me make it clearly.
I'm looking forward to receiving your reply as soon as possible.
Thanks in advance.
nobitanha
|
|
|
|
|
kakalotasdf wrote: ::MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, W2A(p_strPath), -1, ochPath, MAX_PATH );
What's with this? W2A then back to wide again?!?
Steve
|
|
|
|
|
Hi Steve,
Because "p_strPath" is TCHAR type variable, so it need to convert to Multibyte character type by W2A macro.
Thx for your reply
|
|
|
|
|
Well use T2W and forget about calling MultiByteToWideChar .
Steve
|
|
|
|
|
Hi,In my vew class.Im drawing one rect and im displaying numbers in right side of corner.
Like
10.00
20.00
....
Like this.When the number is like more than five digits,then half then number get out of Rect.
Like
20.00|
20000|.00
500.0|0
Here '|' shows the rightside of rect.So i want to align the Numbers in Right Align,It should look like this
20.00|
20000.00|
500.00|
Now im using this code
pDC->TextOut(AlignX(x1+250),AlignY(y2+65),sPV);
here sPV contains that values.
How can i right align this?
Anu
|
|
|
|
|
i hope u trying to print the text from some fixed location.you dint tell the x1 and y2 values. you will get the correct solution if you adjust these values.
dffsfsdfdsfs
|
|
|
|
|
Use the text alignment options of CDC; see here[^].
It's time for a new signature.
|
|
|
|
|
use settextalign() property......
|
|
|
|
|
If you have a suggestion for the original questioner then please reply to them and not to me.
It's time for a new signature.
|
|
|
|
|
Hi
What all the properties to be changed while creating a FormView in splitter wnd.
I am trying to insert a list control in report view..
I couldnt able to set the columns names...
I m setting it in Oncreate or OnShowWindow,but neithr works..
Help me ...
|
|
|
|
|
See my answer to your later question. And please do not repost the same question.
It's time for a new signature.
|
|
|
|
|
Here is a code for create and delete a 3D array!
when i try to catch memory leak by the following code, It alerts that i have exactly 1600 bytes memory leak!
Where is the problem of my Code?
#define VAR_TYPE double
VAR_TYPE ** Create2Darray(int n, int l)
{
VAR_TYPE **temp = new VAR_TYPE*[n];
for (int i =0 ; i< n ; i++) temp[i] = new VAR_TYPE[l];
return temp;
}
VAR_TYPE *** Create3DArray(int x,int y,int z)
{
VAR_TYPE *** arrayd;
arrayd = new VAR_TYPE**[x];
for (int i =0 ; i< x ; i++) arrayd[i] = Create2Darray(y,z);
return arrayd;
}
void Delete3DArray(VAR_TYPE *** darray,int Xdim,int Ydim,int Zdim)
{
for (int k =0; k<Xdim;k++)
{
for (int j=0; j<Ydim;j++)
{
delete [] darray[k][j];
darray[k][j]=NULL;
}
delete [] darray[k];
darray[k] = NULL;
}
delete [] darray;
darray = NULL;
}
#ifdef _DEBUG
CMemoryState msOld,msnew, diffMemState;
msOld.Checkpoint();
double *** Sample_Temp = Create3DArray(182,218,182);
Delete3DArray(Sample_Temp,182, 218, 182);
msnew.Checkpoint();
if( diffMemState.Difference(msOld, msnew) )
{
TRACE( "Memory leaked!\n" );
diffMemState.DumpStatistics();
}
#endif
the output ofter running diffMemState.DumpStatistics() :
Memory leaked!
0 bytes in 0 Free Blocks.
120 bytes in 2 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 57659956 bytes.
Total allocations: 57661556 bytes.
Best,
MJM
|
|
|
|
|
I got no memory leaks with the code you provided (I'm using VS2010).
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]
|
|
|
|