c++

Is it possible not to include a class variable in a class header file?

I want to hide an implementation in implementation file. If the object is not public, I don't want the object's header to leak everywhere my class is used. Suppose I have header file A.h for my class A: #include "Foo.h" class A{ private: Foo foo; public: do_stuff(); }; Now wherever I would include A.h, Foo....

C++: using std::wstring in API function

I'm using the SHGetSpecialFolderLocation API function. My application is set to "Use Unicode Character Set". Here's what I have so far: int main ( int, char ** ) { LPITEMIDLIST pidl; HRESULT hr = SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &pidl); /* Confused at this point */ wstring wstrPath; wstrPath.resiz...

difference between cstdint and tr1/cstdint

What is the difference between <cstdint> and <tr1/cstdint>? (apart from that one puts things in namespace std:: and the other in std::tr1::) Since this stuff isn't standard yet I guess it's compiler specific so I'm talking about gcc. To compile with the non-tr1 one I must compile with -std=c++0x, but there is no such restriction when us...

Create a big array in C++

Possible Duplicate: Segmentation fault on large array sizes Hi all I am trying to create a very big array in the VS 2010 using C++. When I try to create a array like below int dp[4501][4501] or int dp[1000][1000] It threw an exception "Stack Overflow" Then I change it to: int dp[100][100] everything is fine. So if I w...

Preprocessor macro based code yields a C2400 error

#define CANCEL_COMMON_DIALOG_HOOK(name) \ void __declspec(naked) ##name##CancelCommonDialogHook(void) \ { \ __asm \ { \ add esp, [k##name##CancelCommonDialogStackOffset] \ jz RESTORE \ jmp [k##name##CancelCommonDialogNewFileRetnAddr] \ RESTORE: \ pushad \ call ...

C++ Importing and Renaming/Resaving an Image

Greetings all, I am currently a rising Sophomore (CS major), and this summer, I'm trying to teach myself C++ (my school codes mainly in Java). I have read many guides on C++ and gotten to the part with ofstream, saving and editing .txt files. Now, I am interested in simply importing an image (jpeg, bitmap, not really important) and renam...

C++ simple string replace, non complicated code, but producing crazy error

First, thank for you all your help! The error I am getting is: Unhandled exception at 0x7c812afb (kernel32.dll) in Readerboard.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0012f8a8.. I have found the problem to be with this line: str.replace(str.find(sought), sought.size(), replacement); It is lo...

Why Global variable not initialized with string what I have given in extern variable

//s_request_view() constructor is declared as below namespace Identity_VIEW { Published_view_identity s_request_view("SAMPLE"); }; //The constructor is called in another source file as below, bind_view(Identity_VIEW::s_request_view); This same code is working fine on windows but on SBC (PowerPC) s_request_view is passed as NULL. Can ...

C++ pointer question

Hi, still working at C++, but this came up in my book and I don't understand what it's for: MyClass * FunctionTwo (MyClass *testClass) { return 0; } My question is what is the signifigance of the first indirection operator (MyClass *[<- this one] FunctionTwo(MyClass *testClass))? I tried making a function like it in codeblocks...

SiteLock Implementing IObjectSafety BUT Not Working in IE

Hello folks, I have used the SiteLock 1.15 template to restrict domain access to my ActiveX control so that only a list of pre-approved domain can use it. Everything compiles ok, and even the SiteList.exe application that is supplied with the SiteLock template correctly shows the list of domains that I defined inside the ActiveX Control...

How to rotate yuv420 data?

Hi Everyone, I need to know how to rotate an image, which is in yuv420p format by 90 degrees. The option of converting this to rgb, rotating and again reconverting to yuv is not feasible. Even an algorithm would help. Regards, Anirudh. ...

CreateThread issue in c under window OS

I have the following code which initiate the thread. int iNMHandleThread = 1; HANDLE hNMHandle = 0; hNMHandle = CreateThread( NULL, 0, NMHandle, &iNMHandleThread, 0, NULL); if ( hNMHandle == NULL) ExitProcess(iNMHandleThread); My question is What will happened if I run this code while the thread already in the running state. I want ...

gcc 4.3.3 compiler options enabled by default

I have moved from gcc version 4.0.3 to 4.3.3 and realized that -mfpmath was set to sse by default in gcc 4.3.3. This actually caused errors in my application. In 4.0.3 the -mfpmath was 387. I want to know how I can get all the default options enabled by gcc for a given version. How can I dump set of all options used by gcc while compil...

DLL registering and Unregistering

Hi, I have created a context menu dll (C++ COM DLL) to show iconoverlays (using IShellIconOverlayIdentifier interface). To show the iconoverlays initially I have restarted the explorer. If the system restarts, to display the icon overlays, I need to manually register the dll and restart the explorer once again. Is there any way to regi...

Festival TTS API / CodeBlocks Build problems!

Hi, I want to use Festival TTS API with CodeBlocks. I have created a new project, and added in build options>linker settings: libFestival.a libestools.a libestbase.a libeststring.a I also added in the global compiler settings>search directories>compiler: festival\src\include speech_tools\include I am using gnu gcc compiler (ming...

How to implement Outlook Express alike address field control

Hi All, I was thinking about inserting some object (button, panel or static text) into textctrl, like Outlook Express does this. You can see from a pic "group1" is an object, you can double click on it, when you delete it, it gets deleted the whole text not just a part of it. I made some research and this text field is just a sim...

convert utm to Geo wgs84

hi everyone. is any one knows where i can find some open source code (in c++) that converts UTM point to Geo (WGS 84) thanks, Liran ...

Building ActiveQt (COM) applications with MinGW

I am using Qt 4.6.3 with MinGW on Windows to build Qt apps and now need to add a COM interface to my application. I enabled ActiveQt but was getting post-link errors because I was missing a copy of the MIDL compiler. I downloaded a copy of the latest MS Windows SDK, which includes MIDL, but now MIDL complains it cannot find cl.exe. Th...

Not able to write on pipe Windows visual cpp

Hi, I created two pipe to redirect child process stdin and stdout to parent process as given in http://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx The child process is an exe file. when executed using console it first returns a warning on STDOUT and then asks for a yes/no input from STDIN. when i am running the child proce...

c++ boost conditional remove from container

hello stack overflow! i want to do something like c# linq style : SomeColection <SomeType> someColection; someColection.Remove(something => something > 2); and it'll remove all the things that are bigger then 2 (or any other boolean condition)... using boost in the project... ...