visual-c++

How to return List from c# and use it in vc++ through com

Hi How to return List from c# method and Use the List return values in c++ can u give guidance how to do it?? I going like following way my complete scenario: in c# DemoLib.cs usng System;using System.Collections.Generic; public interface IDiscover { void GetList1(); String GetList2(); List<string> GetList3(); }; namespace Dem...

How to return List of Strings in c#

Hi can anybody tell me How to store and return List of Strings. I am asked this Because i have written a function which returns Collection of strings and i want to prepare a COM for that one and need to consume that COM(to get the returned list ) in vc++ where i can extend some functionality using that list of strings. i hope thi...

How do I use ArrayList in C++?

Hi, I have created a method who's return type is an ArrayList instead of List. And I have created a COM component. How do I access this ArrayList in my main application which is in C++? ex: ArrayList fun1() { ArrayList al = new ArrayList(); al.Add("one"); al.Add("two"); return al; } So how do I handle this retu...

Why aren't exceptions in C++ checked by the compiler?

C++ provides a syntax for checked exceptions, for example: void G() throw(Exception); void f() throw(); However, the Visual C++ compiler doesn't check them; the throw flag is simply ignored. In my opinion, this renders the exception feature unusable. So my question is: is there a way to make the compiler check whether exceptions are c...

How to make MSVC debug builds run faster

We have a large C++ application, which sometimes we need to run as a debug build in order to investigate bugs. The debug build is much much slower than the release build, to the point of being almost unusable. What tricks are available for making MSVC Debug builds execute faster without sacrificing too much on the debugability? ...

Are different compilers' C++ virtual inheritance implementations incompatible?

I have hierarchy of public interfaces like this: struct ISwitchable { /* Obtain pointer to another implemented interface of the same instance. */ virtual int switch(unsigned int interfaceId, void** pInstance) = 0; }; struct IFoo : public ISwitchable { /* Methods */ }; struct IBar : public ISwitchable { /* Methods */ }; struct ...

How to add additional include directory on solution level?

I have a big solution with ~30 projects(it's not my fault). I have several versions of boost. Each solution uses it's own version of boost. For now boost is set for each project(30 times). How to set boost on solution level? I want to say this solution uses boost_1.39, this solution uses boost_1.33. I can add path globally on VisualStu...

Audio capture to a file using DirectShow from a mic (Any alternative to 'AudioRecorder WAV Dest' )

Hi, reference: http www codeproject com/KB/audio-video/cacsave.aspx?msg=3094764#xx3094764xx I can't find anything like 'AudioRecorder WAV Dest'. Is there any alternative for this as in my PC graphEdit shows these: (Part 1 n related has worked nicely.) WM Speech Encoder DMO, WMAudio Encoder DMO, IAC2, IMA ADPCM, PCM, Microsoft ADPCM, ...

How to pass 2 string lists to c++ from c# through COM?

Hi I need to pass string lists to unmanaged c++ how can i do this ?? I have used IDictionary as method return type and send through com but it doesn't work How to achieve this. i write in c# as follows IDictionary postNames() { IDictionary post=Dictionary(); post.Add("Raj"); post.Add("Mahesh"); post.Add("john steek"); return...

How to split the strings in vc++?

Hi I have a string "stack+ovrflow*newyork;" i have to split this stack,overflow,newyork any idea?? ...

SetWindowPos() function not moving window?

I have a dialog that I want to place within another dialog and position relative to one of the controls on the main dialog. void CspAceDlg::DrawResultsArea() { CWnd* pTabCtl = GetDlgItem(IDC_BUILDTABS); CRect rectTabCtl; // Allocate CRect for control's position. pTabCtl->GetWindowRect(&rectTabCtl); int resX = rectTabCtl....

Designing an MFC App That Will Work on All Resolutions?

I'm currently designing my first ever GUI for Windows. I'm using MFC and Visual Studio 2008. The monitor I have been designing my program on has 1680x1050 native resolution. If I compile and send my program to one of my coworkers to run on their computer (generally a laptop running at 1024x768), my program will not fit on their screen. ...

MSVC precompiled headers: Which files need to #include "stdafx.h"?

Does every file need to #include "stdafx.h" when using precompiled headers? Or do only source files need to include it. EDIT: Also, my precompiled header file #includes a lot of STL headers. But, in my headers, I sometimes have functions that return std::vector or something like that, so I need to #include <vector> anyway. Is this worse...

How to remotely degug msgina.dll?

Hi all, I have a fully customized msgina.dll in module i need to remotely debug it? Ho will i achieve this Abdul Khaliq ...

Group box with title as Check box

Hi, I am using Visual Studio 6.0 (VC++ with MFC) in Windows XP platform. I am trying to create a group box with the title of the group box as a check box. My intention is this: If the check box is enabled, the controls inside the group box should be enabled; or else disabled. Is this possible to accomplish? If yes, please give me some ...

How to hook webcam capture?

Hi, I'm working on a software that the current version has a custom made device driver of a webcam, and we use this driver with our software, that changes the captures image before displaying it, very similar to YouCam. Basically, when any application that uses the webcam starts, our driver runs a processing in the frame before showing ...

MSVC++ 6.0: Fatal error C1509 "Too many exception handler states in function"

I'm working on a project that uses a lot of generated files for a GUI. After some recent updates, I get this error. If I remove some controls (the new ones or some old ones, doesn't seem to matter which), the error goes away. I've temporarily worked around the problem, but I'd like a more permanent solution. I've seen mentioned on th...

VC++ #import directive for GCC/G++

I'm trying to test out a library that provides a VC++ example; however, I use gcc/g++ for all of my projects. Well, the way the VC++ example accesses the library is it uses the #import directive, passing the location of the library DLL, then it does a using namespace LIBRARYNAME, and then it's able to create some undefined type (I'd ass...

How to take a pointer to a template function specialized on a string?

I was trying use a set of filter functions to run the appropriate routine, based on a string input. I tried to create matcher functions for common cases using templates, but I get a "type not equal to type" error when I try to store a pointer to the specialized function (in a structure, in the real application) Distilled example from a...

Why do I get a "member function not present" error when evaluting expressions on the VC++ debugger?

I've got a static method, MyClass::myMethod() on another DLL, MyDll.dll. In my code, I call this method, and it compiles and run fine. But when I try MyClass::myMethod() in the immediate window (or the watch window), I always get: MyClass::myMethod() CXX0052: Error: member function not present Why is that? Update: I've found out tha...