|
|
|
I am following the example about setting up Direct3D rendering area on this link:
Tutorial 1: Direct3D 11 Basics[^]
All I did is just wrapped it in my own class and instantiated within MFC project.
However, my question is, why no matter what values I put as width/height in the DXGI_SWAP_CHAIN_DESC structure, I still get all window filled with blue?
shouldnt width/height in that structure or in the D3D11_VIEWPORT structure make difference at all?
|
|
|
|
|
Windows 10, Visual Studio 2012,C++
I need a version of FormatMessage() for Unicode, WCHAR. Google and MSDN deny all my searches for same. I want to call a function of my own that accepts a pointer to WCHAR and the error number, and puts the resultant string in the passed array.
Lacking that, I need a version of swprintf() that has an argument for a max number of characters to move into the string and accepts the LPSTR that is returned by FormatMessage().
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
I presume you mean something like:
void ShowError(DWORD dwError,
PWSTR pszMessage,
int maxMessageSize
)
{
if (dwError == 0)
{
dwError = GetLastError();
}
if (FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pszMessage, maxMessageSize, NULL ) == 0)
{
swprintf_s(pszMessage, maxMessageSize, L"Error code: %d (0x%X)", dwError, dwError);
}
}
Which you call by:
WCHAR szMessage[512];
ShowError(nErrorCode, szMessage, _countof(szMessage));
wcout << "Exception: " << szMessage << endl;
modified 31-Jan-16 8:59am.
|
|
|
|
|
Message Removed
modified 21-Jan-16 4:17am.
|
|
|
|
|
Message Removed
modified 21-Jan-16 3:54am.
|
|
|
|
|
The dot H file contains:
const WCHAR DEFAULT_DlRECTORY[ ] = L"C:\\LOG_FILES\\";
const WCHAR DEFAULT_FILENAME_PREFIX[] = L"Log_File_";
The dot CPP file contains
C_Log_Writer::C_Log_Writer(
const WCHAR *new_directory_name = &DEFAULT_DlRECTORY,
const WCHAR *new_name_prefix = &DEFAULT_FILENAME_PREFIX[0] )
{ ... }
The new_directory_name lines does not compile and produces the error:
Error 1 error C2440: 'default argument' : cannot convert from 'const WCHAR (*)[14]' to 'const WCHAR *' e:\code_tests\common_code_dll\c_log_writer\c_log_writer.cpp 73 1 C_Log_Writer
I thought new_directory_name would be a pointer that would by default point to the first character of the array. Why is that thinking wrong?
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
modified 15-Jan-16 17:58pm.
|
|
|
|
|
Because you're trying to assign a pointer-to-a-pointer to a pointer:
const WCHAR *new_directory_name = &DEFAULT_DlRECTORY
should be
const WCHAR *new_directory_name = DEFAULT_DlRECTORY
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
And that is because DEFAULT_DlRECTORY is an array and passing it as an argument means the address of the first character is passed. Ok, I must confess to being ate up with the dumb ass there.
Thank you for taking the time for a gentle kick in the butt.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
I had created an ATL Dialog based application in visual studio 2012,On Scrolling the mouse wheel I want my dialog to be scrolled.
What should i write inside:
LRESULT CUIWindowPage::OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
??
}
|
|
|
|
|
|
I am using Microsoft speech sdk v 11 (https://msdn.microsoft.com/en-us/library/jj127898.aspx[^]). the below call fails, when I check GetLastError, observed that it fails to message "Class not registered". visual studio 2008, windows 7
hr = cpVoice.CoCreateInstance(CLSID_SpVoice);
Please advise
modified 14-Dec-15 7:05am.
|
|
|
|
|
When using Windows 7 64-bit, check if you have installed the version of the Microsoft Speech Platform - Runtime that matches your project settings (32 or 64 bit), or just change your project to match the installed version.
|
|
|
|
|
Thanks for response. project is 32 bit and I installed x86. I think that should be ok. what could be other reasons please advise. thanks in advance.
|
|
|
|
|
Did you have called CoInitialize[Ex] before?
To check if it is registered you can look into the registry at HKCR\CLSID\value_of_CLSID_SpVoice. If it is not present, it may help to re-install the runtime.
|
|
|
|
|
Windows 7, Visual Studio 2010, C++
An application I wrote that has been running for over a year has just started getting an unhandled exception. It is _com_error and the exact return value if E_FAIL, an unspecified error. That is unhelpful. The crash window specifies an address where the crash occurred.
Question:
How does one take that address and find the place in the code where the program was executing when the exception was first thrown?
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
|
|
Windows 7, Visual Studio 2010, C++
How can an application determine the maximum size for a single chunk of data to be sent from a server application to a client application on another computer?
This is on a private network, not not accessible outside of the control room. There is a switch between the two computers but that is about it.
I presume this can be done a run time. My application sends large amounts of telemetry data to a client for display. The goal is to reduce buffering as much as possible. The app uses overlapped I/O with completion events.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
|
I am getting back to my application that ingests telemetry data and sends it to a display device. There will be a lot of data and a lot of packets. The data to the display device will be about 4.5 megabytes per second per stream. I think I need the program to have the ability determine the MSS and MTU so it can build the buffers and get them out in the most efficient manner possible. I would prefer for the app to get this data on the fly rather than hard code numbers into the app.
I have seen all those links via my search but nothing tells me how to get these values via code, c++ code specifically.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
|
MTU size dictates this...
To figure out the system MTU size at run-time, in Linux use getsockopt() with IP_MTU.
ip(7): IPv4 protocol implementation - Linux man page[^]
Windows has a similar call but not sure if the MTU option is readily available.
Keep in mind that every device that the packet touches will impose it's own MTU size restrictions on it and you can't necessarily control all of them (depends on setup of course). In another words, even if your device doesn't fracture a packet, another one down the line may choose to do so. There are ways to do "mtu" discovery to find the max size transferrable. Just something to be aware of.
|
|
|
|
|
Hi,
I am just to trying to customize folder selection dialog by deriving a class from CFolderPickerDialog in VS2012. But VS2012 Wizard does not provide the option to add class with base class from CFolderPickerDialog. The base class list in Add Class wizard does not contain this class CFolderPickerDialog. Any idea why this base class is missing?
Also i tried manually added a class with CFolderPickerDialog as base class with correct message map related maros, function etc. But still i cannot get WM_TIME event handler, OnInitDialog is getting called in derived class. If anybody having any ides pls let me know.
Thanks,
Prasanth
|
|
|
|