I have class, but I don't know how I should handle freeing its member string, when I don't have a prior knowledge of how the string would get allocated. So say that I created a class C1,
class...
Type: Posts; User: chiefmonkey
I have class, but I don't know how I should handle freeing its member string, when I don't have a prior knowledge of how the string would get allocated. So say that I created a class C1,
class...
I have a dll with DllMain() function defined as below.
int DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*pReserved*/)
{
BOOL fRet = TRUE;
switch (dwReason)
{
Hi all,
I have built a very simple MFC dialog application using Visual studio MFC application wizard. Now, I need to port this to MSBuild, so that the project would get built. I've created sources...
I need to create a simple Win32 application with UI. I've done some Win32 programming before, but haven't really created a Win32 non-console application.
There seem to be many options/combinations...
Ok, I see. Great, thanks!
I've been trying to figure out if it matters which calling convention we use for DLL's exported functions. It seems that since both caller (one that loads the DLL and calls the function) and callee...
If the function func() throws an exception, but we don't call the func() from try clause (to at least swallow the exception), let alone use catch clause, would that possibly show some undefined...
Yes, it does. Thank you for your comments.
Sorry about the confusion, I thought that people would assume that the function implementation is available. Ok, then what would happen if the function implementation is available? Where does get a...
How is a field function of a struct allocated in terms of a memory it occupies in a memory segment that's allocated for a struct object?
If I have a struct
Struct A
{
char* string;
...
I created a dll file, and I wanted the resources it uses to be initialized when the dll gets loaded, so I wanted to include DllMain function in the dll file.
// DllMain.cpp
#include...
Hi all,
1) I had few questions regarding C++ static keyword. Is there any difference in scope between a in following two code snippets?
//myfunc.h
const int a = 1;
int main(...)
Hi,
I think I understand the concept of static(.lib) vs. dynamic(.dll) libraries, but I don't think I fully understand the various kinds of .lib libraries.
1) I'm using MSBUILD to build a .dll...
Hi,
I added a public function to a class, built the source files, and tried to debug the resulting executable. The problem I found was that the new symbol file does not contain the added function....
Hi all,
I am trying to build two different dll files using a shared .cpp source file and two different header files using MSBUILD. So for an example, I want to use a.cpp and headera.h to compile...
In the code below, constantset_a.h and constantset_b.h define the same set of global constants but sets the constants with different values. Compiled myprogram.exe is to behave differently depending...
I didn't get your question. Does the problem require using the FoodLists class? If you want to have an empty class, why do you allocate memory for the tail node? And what does it mean to use tail and...
Hi,
I am trying to unit test a class I wrote. I wasn't sure how I should go about checking the values of private member variables after calling functions that set them. I was hoping that people...
Awesome, thank you guys :)
Just one more quick question regarding thread programming. After creating the thread, is it generally recommended to use WaitForSingleObject() to wait for the thread to...
So just by looking at the msdn document of the following kernal32 function,
HANDLE WINAPI CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,...
Understand what >> and & operators do. Then you'll be pretty much finished with the problem.
Please consider posting the entire code here, so that we can get a better idea.
Awesome, thank you guys!
Hi guys,
I wanted to create a programs that encode and decode videos using existing codecs (h.264, xvid, etc...), but I couldn't find much information on the web.
So how does such program...
Thank you for your answer Dirkmass. You need to use L"" when defining a wide character string literal. Wide character is a 2-byte character used to represent a UTF-16 character.