|
Some updates here are
If the path is given like
"\\?\c:\..."
things works
but for path
"\\?\UNC\c:\..."
things fails.
Most important I want to get shortpath name over network
so my path becomes
"\\?\UNC\ip_address\..."
Here things fails badly.
|
|
|
|
|
My test:
void main()
{
WCHAR szShort[MAX_PATH];
DWORD dw =0;
wstring m_UNCPath = L"C:\\Documents and Settings\\01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234.txt";
long length = GetShortPathNameW(m_UNCPath.c_str(), szShort, MAX_PATH);
}
resulting value of szShort :
"C:\DOCUME~1\012345~1.TXT"
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
|
|
|
|
|
Please recheck your path. I guess it's less then 255 chars.
|
|
|
|
|
Damn, you're right, Windows truncated the name...
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
|
|
|
|
|
See you can not create a long file path simply in windows explorer.It is not supported. You need to call apis like CreateDirectoryEx and CreateFileW to create such path and write a file inside it.
|
|
|
|
|
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
|
|
|
|