|
Hi! I have some transport which based on winsock. Client(FTPS) send to me some data over SSL, and i receive it with (for example):
<br />
...<br />
if (WSARecv(AcceptSocket, &DataBuf, 1, &RecvBytes, &Flags, &AcceptOverlapped, NULL) == SOCKET_ERROR){<br />
if (WSAGetLastError() != WSA_IO_PENDING)<br />
printf("Error occured at WSARecv()\n");<br />
}<br />
...<br />
how can i decrypt received data in DataBuf, if i have certificate, puclic and private keys?
|
|
|
|
|
|
helo,
I want to write socket client application by using c or c++ in window without using any Winsock or MFC class.
how do i achieve it.
I search it but not getting exactly .
Regards,
Amit
|
|
|
|
|
Are you kidding?
AFAIK even Cygwin uses Winsock library.
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
|
|
|
|
|
There are many network libraries out there. For instance, take a look at Boost Asio[^]
|
|
|
|
|
Don't you have to write your own communication interface between the TCP/IP stack and your software ? or something like that ?
|
|
|
|
|
|
See here[^] does helpful?
|
|
|
|
|
Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer to play as my game background-music ?
If not, why not ?
The other option, AFAIK, is having 'streaming' buffer for that. Which will be more complicated programmatically.
|
|
|
|
|
Hanan888 wrote: Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer
Yes.
Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo
audio samples is around 10MB (if I did the math correctly ).
Should work fine.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks.
So, my kitschy background music won't break the system after all... perhaps the people listening to it would...
Mark Salsbery wrote: Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo
audio samples is around 10MB (if I did the math correctly ).
Have you calculated something like this -
buffer size:
0X0FFFFFFF = 16^7 - 1 bytes = 268,435,455 bytes
WAV size:
40 sec * 3 bytes per sample (24-bit) * 44100 samples per second = 5,292,000 bytes
|
|
|
|
|
Hanan888 wrote: Have you calculated something like this -
buffer size:
0X0FFFFFFF = 16^7 - 1 bytes = 268,435,455 bytes
WAV size:
40 sec * 3 bytes per sample (24-bit) * 44100 samples per second = 5,292,000 bytes
Yes, except I took a worse-case scenario (unless you use a higher sampling rate ) and chose
stereo, so I multiplied your WAV size by 2.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm developing an animated-game on Win32.
It runs only in windowed mode.
I'm creating my window with the styles WS_OVERLAPPED | WS_SYSMENU so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user.
We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that.
The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?
|
|
|
|
|
Take a look at the SystemParametersInfo API function.
|
|
|
|
|
|
Hanan888 wrote: If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified
AFAIK the above is wrong.
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
|
|
|
|
|
As i said, the entire size is more than 800X600, so how can it fit into 800X600 screen ? some parts will be 'out of the screen'.
I tried it now, don't look that horrible, actually.
Maybe we'll just say, If you got a 800X600, it's your own problem... (in the About dialog)
|
|
|
|
|
If you set 800x600 on CreateWindow, then the overall size of the window (including borders) will be 800x600.
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
|
|
|
|
|
I now realized thats correct. My Question should have actually been what should be the size of my background image so that it will fit.
So I guess I'll figure out what the dimensions of the border and I'll reduce the dimensions of the background image by that.
Thanks.
|
|
|
|
|
GetClientRect [^].
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
|
|
|
|
|
Thanks again, I'll try that.
|
|
|
|
|
I've created a MFC project in Visual Studio 2008.
The manifest is correctly getting embed in the program if the configuration is Unicode otherwise, it will show an error like this (on changing the character set to Multibyte and build, (not rebuild) the soulution).
1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\SampleProgram.exe.embed.manifest". The parameter is incorrect.
This error will resolve when I Rebuild the entire project but manifest is not embedding inside the executable
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I do get same error during build but not always. Typically if I build (not rebuild) again it do not occur again. Well I don't have solution but just sharing my expereince.
-Saurabh
|
|
|
|
|
The comctl32.dll version 6 supports only UNICODE version. If you open the stdafx.h you can find the switch as follows
#ifdef _UNICODE<br />
#if defined _M_IX86<br />
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")<br />
#elif defined _M_IA64<br />
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")<br />
#elif defined _M_X64<br />
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")<br />
#else<br />
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")<br />
#endif<br />
#endif
|
|
|
|
|
Dear Naveen,
Thanks for your reply.
Naveen wrote: The comctl32.dll version 6 supports only UNICODE version
I just removed the #ifdef _UNICODE and #endif. and it's working fine. In a post of Raymond Chen, it's saying that Common Control 6 supports only UNICODE[^]. When I started using Windows XP, I enabled visual styles for existing applications by just putting "exe_name.exe.manifest" file in the same folder. I can't figure out how it's working it in a non-UNICODE build (even if Common Control 6 supports only Unicode).
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|