visual-c++

Creating named Mutex in c# exe and Accessing it a dll in c++

Hi All, I have two exe's one in C# and other is a vc++ exe . Both of these exe need to access a file. So I am planning to create a named mutex in c#. vc++ how can i access this named mutex. Can any one give me sample codes for this ...

How could I simulate _set_abort_behavior in VC++7 and earlier?

In Visual C++ when terminate() is called the default behavior is to call abort() which by default shows a message box and then - after OK button on the message box is pressed - terminates the application. The "shows message box" part is not very good for programs that must work without human interaction since the program just hangs until...

CallBack function from c# to c++

Hi All, I have a C# exe and some vc++ dll's . I am creating a callBackFunction in C# whichh takes structure as its Parameters. My c++ dll will fill this structure and return it back.But 95% of the time My Exe crashes. My dll is multi threaded and my C# has backgroundWorker in it. I have put try catch block to check if any exceptions are...

Are there Visual C++ runtime implementations for other platforms?

Does Visual C++ runtime imply Windows platform? I mean if I write a program that only directly uses functions specific to VC++ runtime and doesn't directly call Windows API functions can it be recompiled and run on any OS except Windows? I don't mean on Windows system emulator, I mean a ready implementation of VC++ runtime for some other...

How to circumvent VC++2008EE JIT debugging restriction?

Is there some smart registry hack or so available to get Visual C++ 2008 Express Edition running Just In Time Debugging? Or is there some other (legal) way to circumvent this restriction? ...

Can somebody recommend a good U3D library?

I need to put some 3D images into PDF files, and PDF uses Universal 3D (U3D) formats. I don't like the U3D Sourceforge project (basically what Intel released after the ECMA standardization effort). Does anybody know of good U3D libraries I could use? I'm using C++ on Microsoft Windows, FWIW. ...

Class names that start with C.

The MFC has all class names that start with C. For example, CFile and CGdiObject. Has anyone seen it used elsewhere? Is there an official naming convention guide from Microsoft that recommends this style? Did the idea originate with MFC or was it some other project? ...

Setting up VC++ directories using environment variables in Visual Studio 2008

The Visual Studio 2008 environment(on Windows Xp) has some variables set in already WindowsSdkDir and VCInstallDir etc.. I want to setup portable cross platform packages like Xerces here : C:\Program Files\xerces-c-windows_2000-msvc_60 and configure Visual Studio 2008 environment VC++ include and lib directories with an environment va...

Call a class in Managed Type Form

Hi, Have a problem that has been bugging me for a couple of weeks now. I want to do two things... Change a textfield text or picturebox image from a native function.....It happens in the managed type(eg Form 1)....How can I change this image or text externally from the managed type... I'm getting the obvious code. C2065 - undeclar...

How to reference text Label outside of Form's code?

Code Sample 1 //Set Label. this->TextLabel1= (gcnew System::Windows::Forms::Label()); Code Sample 2 //When Button Clicked.... TextLabel1->Text = "Button has been pressed"; How do I reference (+ change) the Label that has been set, outside the Form's code. Eg. Another cpp or header file? ...

Byte array to UTF8 CString

Hi all, I'm using Visual Studio 2008 (C++). How do I create a CString (in a non-Unicode app) from a byte array that has a string encoded in UTF8 in it? Thanks, kreb EDIT: Clarification: I guess what I'm asking is.. CStringA doesn't seem to be able to interpret a UTF8 string as UTF8, but rather as ASCII or the current codepage (I th...

MFC : How to capture a link click event in a web browser control?

Hi All, I have an MFC application that has a webcontrol. When clickable links are clicked, it opens using IE, not the default browser. Questions : Is there a way to force it to open using the default browser? If not, how do I capture the Link Click event so I could just manipulate the click event later? Thanks... ...

Linker error LNK2019 while trying to compile prog with template declarations.

Here the code #include <iostream> #include <conio.h> using namespace std; template <typename T> class grid { public: grid(); ~grid(); void createCells(); private: T **cells; }; int main(int argc, char **argv) { grid<int> intGrid; _getch(); re...

Change the Color of a button in VisualC++

can anyone provide me the idea for changing the color of a button in VisualC++?ThanQ ...

How do i add a mclmcrrt.lib or (.lib) file when compiling with g++ Compiler

I have a algorithm code which uses matlab library(mclmcrrt.lib) it compiles well in my vc++ compiler when i add that library to it. My question is if i want to compile it on Linux g++ compiler how should i link the library can i use it? ...

Sorting/Arranging Rect buttons

how to Arrange/sort rectangle control buttons according to size or name im a dialog based application please help me I have 10 buttons created dynamically in a dailog with different sizes while running the application i will resize the buttons and i want arrange them.how to arrange them according to the sizes and according to name. ...

run my mfc dialog application in front of other application when system wakes up(after standby)

please any body give answer for run my mfc dialog application in front of other application when system wakes up(after standby). how to do in vc++ ...

Persist highlight in CListCtrl after double click

Figured it out. LVIF_STATE should have been LVIF_IMAGE. See, I knew it was elementary... I have a CListView derived class with an OnDoubleClick() handler in a VC++6.0 project. I need to persist the highlighting of the selected item after the OnDoubleClick() handler has done its thing. I had thought that GetListCtrl().SetItemState(m...

Dynamic memory allocation question

when you allocate dynamic memory on the heap using a pointer, char *buffer_heap = new char[15]; it would be represented in memory as: ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍýýýý««««««««þþþ why doesn't there be a NULL terminating character at the end instead of ýýýý««««««««þþþ? ...

Using multiple versions of the Windows Platform SDK with VS 2008 Professional

How do I use multiple multiple versions of the Windows Platform SDK for VC++ native code development with VS 2008 Professional : like The Windows SDK for Windows 7 and .NET Framework 3.5 SP1 and the one installed by default here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\ ...