Add my own compiler warning
When using sprintf, the compiler warns me that the function is deprecated. How can I show my own compiler warning? ...
When using sprintf, the compiler warns me that the function is deprecated. How can I show my own compiler warning? ...
How would one prevent the little dotted square that appears on a button when it has the keyboard focus in a dialog. (w/ apologies for the technical jargon). At one point I hacked together a solution by subclassing a button WindowProc and subverting some windows messages, but wanted to know the correct way. There's actually a problem ...
I down load blitz_0.9,I can build it in vs2008 and get blitzd.lib and blitz.lib but how can i get blitz.dll who have used it give me some advice thank you. ...
I come from UNIX world, I'm quite familiar with Linux, Solaris, Cygwin and MinGW development. Recently I ported one of my big projects (cppcms) to support MSVC, including building static and dynamic libraries with CMake. And I get all the time absolutely weird issues: I had CMake build issues because Windows programming lacks namin...
Hi All, I am new to c++ programming I have to call a function with following arguments. int Start (int argc, char **argv). When I try to call the above fuction with the code below I get run time exceptions. Can some one help me out in resolving the above problem. char * filename=NULL; char **Argument1=NULL; int Argument=0; int j = 0; ...
I have the following class: class MyClass { public: MyClass( char* what ) : controlled( what ) {} ~MyClass() { delete[] controlled; } operator char*() const { return controlled; } operator void*() const { return controlled; } operator bool() const { return controlled != 0; } private: char* controlled; }; This is com...
I am using GetModuleHandle in my function. That function gets called every time I do an operation. I want to know if that function gets called again and again, will the GetModuleHandle cause any handle leaking (stack overflow or memory leaks or anything else). I actually know when it is getting called and when the break point is hit. But...
I want to write something that will take care of: If possible the int main() loop, as in, I want the code for the main function located in this file Some mundane tasks like creating windows, initializing various things like opengl, opencv and what not. Various "events" (I quote because I what the c++ concept of events is) for things l...
I am writing two lines in memory using CMemFile::Write(): void CLISTCTRLDlg::Export(LPTSTR *pBlock) { CMemFile outMem(32768); CString csHeader = _T("EmpId EmpName EmpAddress\n"); outMem.Write(csHeader.GetBuffer(0), csHeader.GetLength()); CString csInfo = _T("1 TestName TestAddress\n"); outMem.Write(csInfo.GetBuffer(0), csInfo.Get...
I am trying to use _CrtDumpMemoryLeaks() to display memory leaks in my programs. But it does not display anything except for returning 0 in case of no memory leaks and 1 in case there is a leak. The link here shows the output should be like: Detected memory leaks! Dumping objects -> D:\VisualC++\CodeGuru\MemoryLeak\MemoryLeak.cpp(67) ...
I have a single-threaded application that uses COM objects. At the beginning I in effect call CoInitialize(0) twice - once in my code and the second time in the code of another subsystem of the application. The first call returns S_OK, the second returns S_FALSE - exactly as MSDN says. When the application stops it calls CoUninitialize(...
I'm looking at this bit of text in the documentation for Visual C++'s _ReadWriteBarrier intrinsic: In past versions of the Visual C++ compiler, the _ReadWriteBarrier and _WriteBarrier functions were enforced only locally and did not affect functions up the call tree. In Visual C++ 2005 and later, these functions are enforce...
I am currently learning VC++. I have created an application that has functionality to block/allow IP addresses and I would like to expose this functionality to a C# application. I have defined the following members in my header file, which reference methods in my .cpp file (bare with me if that's obvious, as this is my second day of C+...
Hi, In my application, I need direct access to the _environ variable because I must have something like the glibc unsetenv (you cannot have that with setenv or putenv). This is the code I need to use: ////////////////////// // unsetenv for WIN32, taken from libc source int unsetenv(const char *name) { size_t len; char **ep; if ...
Is there any reason for a program to leak when compiled in Debug mode and not in release? (Debug means debug informations, and compiler optimization disabled, Release means no debug info / full optimization) That's what it seems to do but I can't figure out why. Btw purify is not being helpful here ...
To be more precise, when I used eclipse for java, every time I typed it would check for errors. For example, if I typed a line and forgot a semi-colon, eclipse underlined the area in red and gave me an error, same with misspellings, variable names that have not been defined, etc, etc, etc. I'm now using Visual Studio 2008 (as the teache...
Hi, I developed a ClassLibrary in VC++ using VS 2005. Later I registered the dll, i got from building the project in MinRelease mode and when i tried to execute my application it failed. But the same application got executed successfully by registering the dll that i got from building the project in Debug mode What is the issue.? ...
In Win32 in order to paste data into the clipboard I have to call GlobalAlloc(), then GlobalLock() to obtain a pointer, then copy data, then call GlobalUnlock() and SetClipboardData(). If the code is in C++ an exception might be thrown between calls to GlobalLock() and GlobalUnlock() and if I don't take care of this GlobalUnlock() will ...
Hello, As a C++ programmer I've recently started to work with visual c++. I've get stuck with the properties. The idea is to create an inner class that would have 2 methods plus property like get/set functions. Does it even possible in visual C++ (i guess yes). The usage would be like this: Foo ^ foo = gcnew Foo(); int a; foo->Metho...
In C++ I have defined a class that has this as a member static const std::basic_string<TCHAR> MyClass_; There is also a getter function for this value LPCTSTR CClass::GetMyClassName() { return MyClass_.c_str(); } When I create an instance of this class and then try and access it intellisense pops up but the name has been change...