c++

Can I get DirectX(any version) to callback when logging an error?

I have output like this after choosing debug version in the directx cpl: Direct3D9: (WARN) :Ignoring redundant SetTextureStageState. Stage: 0, State: 3 Direct3D9: (ERROR) :Memory Address: 008307ec lAllocID=1 dwSize=00004bc4, ReturnAddr=7248d5ea (pid=000017d4) Is it possible to define a callback which is triggered when these notificati...

Handling large files

Hello there, I need to do some file I/O(mainly reading) on a very large file(>3GB), can someone suggest the best way to do so? I want to do in C++. ~calvin ...

WMI Error in Windows Server 2008 (WMI Provider)

Hi, I've implemented a WMI provider (Window service, Instance, Methods and Properties provider). It works fine on Windows Server 2003, but when it run on Windows Server 2008 with non-local administrator user, I cannot query it. The error I get is 0x8004101d - unexpected error. When the service user is a local admin everything is OK. Wh...

Launching applications silently?

My C++ application calls VLC as a subprocess. Is there a way to avoid having the GUI pop-up? I am looking for a Mac and a Windows solution. Hackish workarounds are welcome too. PS: I know there is such a thing as cvlc (command-line version of VLC), but I haven't found any builds for it online. You do get it when you make the build yours...

Parsing an XML file to populate a structure in C /C++

I have the following xml file which has attributes corresponding to a structure. How do i read the content from the XML file and populate the coresponding values in the structure?Please see the XML file below. <Struct> <StructEntry name="presenceNotification"> <Enum>PRESENCE_NOTIFICATION_UEMOBILITY_UPDATE</Enum> </StructEntry> <Str...

Passing around fixed-size arrays in C++?

Basically I'd like to do something like that: int[3] array_func() { return {1,1,1}; } int main(int argc,char * argv[]) { int[3] point=array_func(); } But that doesn't seem legal in C++. I know I can use vectors, but since I know the size of the array is a constant, it seems like a loss of performance is likely to occur. I'd a...

Best way to return early from a function returning a reference

Let us say we have a function of the form: const SomeObject& SomeScope::ReturnOurObject() { if( ! SomeCondition ) { // return early return ; } return ourObject; } Clearly the code above has an issue, if the condition fails then we have a problem as to how to return from this function. The crux of my ...

Receive WM_COPYDATA messages in a Qt app

I am working on a Windows-only Qt application, and I need to receive data from a Microsoft OneNote plugin. The plugin is written in C#, and can send WM_COPYDATA messages. How do I receive these messages in a C++ Qt app? I need to: Be able to specify the "class name" a window registers as when it calls RegisterClassEx, so that I can ma...

C++ linker options for DLL (DEF, LIB, etc)

I have downloaded a library for the purposes of writing a program that can uncompress a RAR file. (http://www.rarlab.com/rar/UnRARDLL.exe) This supplies me with unrar.dll, unrar.h, unrar.lib and UnRDLL.def. I have copied the C example code and have tried compiling it with both Dev-Cpp and Eclipse. I don't have much experience using DLL...

Supressing warnings for a codeblock using gcc 4.1.2?

I have a section of code that uses a Boost library that results in a lot of these type of warning messages: class x has virtual functions but non-virtual destructor Using g++ 4.1.2, how do I temporarily disable warnings for this codeblock then enable them again after it. Everything I try (pragma gcc diagnostic, etc) seems to only be ...

Is every application using anything dependent on VC++9 runtime required to have a manifest embedded?

I don't get what this article on R6034 says. Looks like it states that every application dependent on VC++9 runtime must have a manifest. Now we have a DLL that we ship to customers, that depends on VC++9 runtime and has a manifest embedded. Does every application using our DLL also need to have a manifest embedded? ...

C# delegate with string reference to c++ callback

I wrote a C# application that uses an unmanaged c++ dll via managed c++ dll. In the unmanaged dll, there's a callback that one of its params is std::string &. I can't seem to find the right way to wrap this with the managed dll. When I use String ^, the callback works, but the C# application does not get anything in the string. When I u...

Anyone used libvlc on Mac?

Edit I've been able to simplify the reproduction of the error: When trying to build this sample: $ cc example.c -arch i386 -lvlc.2 -L/Applications/VLC.app/Contents/MacOS/lib/ -I/Applications/VLC.app/Contents/MacOS/include/ -o example $ ./example dyld: Library not loaded: @loader_path/lib/libvlc.2.dylib Referenced from: /Users/fran...

Enumerating all IDispatch implementing objects on a machine.

Hi there, I'd like to enumerate all IDispatch supporting objects on a machine. At the moment I need to know what the class id or prog id is but, for inspecting my machine, I'd like to know if I can just enumerate all the objects that implement IDispatch. Is this even possible? Any help would be much appreciated :) ...

Stack Size Estimation

In multi-threaded embedded software (written in C or C++), a thread must be given enough stack space in order to allow it to complete its operations without overflowing. Correct sizing of the stack is critical in some real-time embedded environments, because (at least in some systems I've worked with), the operating system will NOT dete...

ATL COM Server - cretaing COM object defined in ATL Server from this server

Hello I have created the ATL COM Server C++ project using Visual Studio 2005 wizard. I added a new COM class using the ATL Simple Object wizard. Now when I try to create this COM class instance from my server (calling CoCreateInstance within the ATL server) I get CO_E_SERVER_EXEC_FAILURE error from CoCreateInstance. When I try to create...

how to talk to an asmx service using C++

I have an existing asmx Web Service I need to acces from a native C++ implementation ( no it cant be c# ). What are my choices ( Visual Studio User here ) to do this as fast as possible ( anything that does the add aweb reference equivalent would be lovely ) Thanks ...

Compile Qt application for Windows Mobile 5

Hi, I'm trying to compile a small Qt application for windows Mobile 5. so I've few questions: currently i'm using ubuntu 9.10, I've hear some thing about cross-compilation but I din't found a real example of have to do it. Will it be possible to compile from linux? How to compile an application for mobile anywhere(windows(VS, mingw,et...

iphlpapi / ifdef.h

I'm trying to use iphlpapi (GetAdapterInfo) and am having trouble compiling the code. I have iphlpapi.h from SDK 7 and have added the appropriate path to the include files in visual studio. I get the following error... c:\program files\microsoft sdks\windows\v7.0\include\ifdef.h(154) : error C2146: syntax error : missing ';' before...

XCode and the iPhone SDK: C++ Standard Library Type?

Because I'm a novice to all things C++ and gcc related I need to understand something that's potentially critical. If I use .mm files in a new iphone project whose output is a static lib I get this error: "___gxx_personality_v0", referenced from: If I change the C++ Standard Library type from Dynamic (the default) to static the err...