|
bkelly13 wrote: If the utilities put in a DLL are built without MFC and without ATL, can they be used by those types of projects?
Yes.
bkelly13 wrote: Can the products of multiple projects, within a single solution, be put into a single DLL?
Only if you consolidate the source code into a single project.
bkelly13 wrote: I just want to see the signatures of the functions contained by the DLL.
Only source code or documentation can tell you the function signatures. But the DUMPBIN utility can show you the function names that are exported from the DLL.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
ILMerge is not relevant for unmanaged code.
|
|
|
|
|
1. Yes, MFC/ATL applications can make calls to C++ functions or class methods, and pure C functions.
2. Yes, but you would need a single project for the final DLL.
3. See Decorated Names[^].
|
|
|
|
|
1. I expected that and thank you for the confirmation
2. I suppose that is not a big problem, may make for a large project, but that will have to do.
3. I was hoping for something easier, but this also is what it is.
Thank you for taking the time to reply.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
On point 3 I am sure I once found a tool or some source code (years ago now) that decoded them for you. Try some Google foo.
|
|
|
|
|
|
|
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
|
|
|
|
|
|