Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
all groups > visual c > june 2007

Filter by week: 1 2 3 4 5

Using C++/CLI wrapper to call .NET assembly from native code?
Posted by cctv.star NO[at]SPAM gmail.com at 6/29/2007 7:48:01 AM
I need to dynamically load and call .NET assembly from native application, written in C++. I'm trying to do this by creating a (managed) module, written in C++/ CLI, whose header can be #included from native code like normal C++ header, and whose .cpp file uses C++/CLI to actually load and ca...more >>


Bizarre behaviour in VS2005 when debugging
Posted by pinkmonkey4ever at 6/29/2007 12:00:00 AM
I have a VC6 ANSI C (console) project that I have recompiled sucessfully under VS2005. However, when I attempt to debug the code (step through) - my breakpoints are disabled (msg : "beakpoints will not be hit"), and worse still - I find that instead of steopping through my code, I am steppi...more >>

Organizing a World
Posted by Peter Oliphant at 6/28/2007 1:27:02 PM
I'm creating an application which is game-like, in that it has entities which move in a World composed of adjacent grids. At first, the 'natural' way to build the World object as a class is to create a Grid class, and then create an array of Grid objects to represent the World. That is, ...more >>

Using VS2005 on a project that earlier used VS2003
Posted by TonyJ at 6/28/2007 10:45:04 AM
Hello! What is the right way to go when I have a C++ project that earlier used VS2003. When I compile now I get a lot of compile error. //Tony ...more >>

Compile error when having __gc
Posted by TonyJ at 6/28/2007 9:35:43 AM
Hello! I get compile error in VS2005 but not in VS2003 for the same project. Here is the row that the compiler complains about public __gc class ReasonDialog : public System::Windows::Forms::Form I read in the documentation that this is the old syntax but I want to use the new syntax. So i...more >>

Does anyone know any commercial C++/CLI GUI library with source code?
Posted by Philip at 6/28/2007 6:29:16 AM
Does anyone know any commercial C++/CLI GUI library with source code? Thank you very much. ...more >>

Compile error in vs2005 but not in vs2003
Posted by TonyJ at 6/27/2007 3:17:34 PM
Hello! I get compile when using VS2005 but not in VS2003. The compile error is the following "Error 1 error C3867: 'MeltPracCommon::ReasonDialog::tbReason_TextChanged': function call missing argument list; use '&MeltPracCommon::ReasonDialog::tbReason_TextChanged' to create a pointer to mem...more >>

Editable mult-column table
Posted by kelvin.koogan NO[at]SPAM googlemail.com at 6/27/2007 8:38:12 AM
I want to display a two column multi-row table in a Windows Forms app. I want the user to be able to edit all values in both columns. Table will need to scroll vertically. What is the best control to use? I've tried using a ListView but it seems to only let you edit the left- hand column an...more >>



Random numbers
Posted by Peter Oliphant at 6/27/2007 7:44:01 AM
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000, or between 0 and 99999 (inclusive). Further, the I want the range to be a variable. Concretely...more >>

Can not find the resource
Posted by sealo at 6/26/2007 11:53:37 PM
Hello, dear guys, I met another curious issue of finding the resources. There was a dynamic file, which include a resource: ///////////////////////////////////////////////////////////////////////////// // // RCDATA // IDR_FX_CLASSICMATERIAL RCDATA "..\\Shaders\ \Classic...more >>

The static library benefits
Posted by sealo at 6/25/2007 7:25:27 PM
Hello, In VS2005, if APP A is using a static library B.lib, although there are many objects contained in the B.lib, but App only use part of it, will the compiler only adopted the part that the App actually need, or bind all the objects of B.lib into the App? App A --> B.lib ...more >>

Static library contain dynamic library
Posted by sealo at 6/25/2007 6:46:11 PM
Hello, I have a test in VS2005 that static library A.lib use the dynamic library C.dll. Then a application App use the A.lib. App-->A.lib-->C.dll It works. But if I remove the C.dll, the app tell me can not find the C.dll. I think because A.lib is a static library, so it should contain th...more >>

Any libmtmalloc, hoard-like library from MSFT on Win32?
Posted by kiranbhogadi NO[at]SPAM gmail.com at 6/25/2007 12:56:25 PM
I'd like to know if there is a hoard-like drop-in library from MSFT to replace the default C-lib implementation of malloc/free provided by Visual Studio. We have a program - multithreaded, runs on multi processors and very dynamic-memory intensive -- which we determined for sure has heap cont...more >>

Object initialization
Posted by Bob Altman at 6/25/2007 12:29:54 PM
This question deals with unmanaged C++ (Visual Studio 2005). Suppose I have a class named MyClass with a constructor that takes an argument. How do I create an instance of type MyClass as a member variable (see below)? Class Test { public: Test(void); // Constructor ~Te...more >>

Wrapper Component in C++/CLI to use Legacy C++ code/functionality in C#
Posted by Subodh at 6/25/2007 8:12:35 AM
Hi, We have legacy code in C/C++, I am writing a wrapper component in C++/ CLI that will allow using this legacy code functionality in C#, I have linked all my static libraries to this C++/CLI DLL project I have created a wrapper public static ref class in C++/CLI project that will expose fu...more >>

Handling callbacks from unmanaged code
Posted by kelvin.koogan NO[at]SPAM googlemail.com at 6/25/2007 4:36:04 AM
I have an unmanaged DLL which calls my managed C++ app using a callback (standard C++ function pointer). I can receive the callbacks OK using a static function with global scope, but I can't find a way to get hold of a pointer to my Form to pass it the data. Any ideas? Application seems to ...more >>

Managed lib into unmanaged project
Posted by dp_mpi at 6/25/2007 3:38:08 AM
Hello Everybody, I am developing a managed lib (using Microsoft Web Services) and I am including it into a c++ project. The project doesn't use /clr optionk, so when I include my linbrary's header file vs 2005 show me an error saying I have to use /clr option. Doing this I have a incompatibility...more >>

How can I load an icon from an exe?
Posted by kelvin.koogan NO[at]SPAM googlemail.com at 6/25/2007 1:03:25 AM
How can I load an icon from an exe in C++ .NET? Is there .NET equivalent of ::LoadIcon? If ::LoadIcon is still the right way to do it, how do I get a handle to pass to it and how do I convert the handle returned to an Icon? TIA, KK ...more >>

Compiling Unmanaged C++ Code
Posted by Rob Jehan at 6/24/2007 10:15:36 PM
Hi I'm trying to construct a Global Hook and need to create an unmanaged C++ DLL. I'm really new to this and Ive created a C++ Win32 project in VS 2005. Firstly, can you create an unmanaged DLL in VS 2005? Is this the correct classification of project to create an unmanaged DLL (should i...more >>

VC Self-contained static libraries
Posted by sealo at 6/24/2007 7:45:17 PM
Hello, dear all, I have a static library project A.lib. And this library also use the other library B.lib. The IDE is VS2005. I want to know, when A.lib was build out, will it also contain the B.lib code automatically? Or, I have to deliver both A.lib and B.lib? Is there any configuration ...more >>

Problem with radio buttons in .NET forms application
Posted by Z.K. at 6/24/2007 2:17:25 PM
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") MessageBox("Hello 3") The first radio button works fine and displays "Hello 1". The other ...more >>

Unmanaged to managed return value
Posted by Sharon at 6/24/2007 1:52:01 AM
I have the following managed C++ function (VC++ 2005 (C++/CLI) System::Array^ ManagedCppClass::GetData() { BYTE* pData; int len; m_pureNativeCPPObj->GetData(pData, len); // Get the data buffer from unmanaged class. array<byte>^ Arr = gcnew array<byte>(len); System::R...more >>

Multi-byte characters?
Posted by Bob Altman at 6/23/2007 4:05:18 PM
If I create a new Win32 Console project (unmanaged C++, Visual Studio 2005), and add the following to the main program: // Add this above the main routine #include <windows.h> // Add this at the top of the file // Add this to the main routine MessageBox(NULL, "A", "B", MB_OK); ...more >>

Typecasting between ref class and interface class
Posted by ewpatton NO[at]SPAM gmail.com at 6/23/2007 1:30:05 PM
I'm working on a modular application that handles working with different file types. Each file type is defined in a separate DLL so that new types can be defined and then imported. Here's the code I've been using: namespace Workspace { public interface class IFileType { public: ...more >>

Performance of pure native C++ class in a managed C++/CLI DLL comp
Posted by Sharon at 6/23/2007 5:11:00 AM
I have a class that is writen in unmanaged pure native C++. This class files (h and cpp) are inserted to a managed C++ (VC++ 2005, C++/CLI) DLL compoenet. This DLL compoenet is used in a C# application. My question is: Does the performance of the unmanaged pure native C++ class described abo...more >>

How to get an unmanaged pointer within VC++ .Net?
Posted by Orbian at 6/22/2007 5:36:25 PM
I am using an unmanaged pointer and need to take the address of this and pass it to a function (a pointer to a pointer). If the pointer is defined as a global variable it will work, however if I move it into a class variable I get teh following error: error C2440: 'type cast' : cannot conve...more >>

defining a catch statement with #define
Posted by DaTurk at 6/22/2007 9:16:12 AM
Hi, I want to define a very large catch clause in a pound define. I've done this, and it compiles, but when I try to incorporate it into the code I'm having issues. #define CATCH_THING{ catch(Exception ^ ex) \ { \ <Do Something> \ }\ } try { <Some Code> } CATCH_THING What am I do...more >>

string constants / conversion from const char * to String
Posted by kelvin.koogan NO[at]SPAM googlemail.com at 6/22/2007 5:11:52 AM
I want to declare an array of constant strings. In unmanaged C++ I'd do this static const char *string[] = { "One", "Two, "Three" }; However if I do this in .NET and want to pass these to a function which takes an Object * then I get compilation errors. The only way to avoid these seems to ...more >>

Displaying icon in StatusBarPanel
Posted by kelvin.koogan NO[at]SPAM googlemail.com at 6/22/2007 3:13:20 AM
I want to dynamically change the icon displayed in a status bar panel. I've created the icons in the resource file, app.rc, e.g. IDI_MYICON. How can I load this icon and display it in the StatusBarPanel? The auto-generated code does: this->StatusBarPanel->Icon = (__try_cast<System::Drawing::...more >>

Trying to Retrieve a List of Active Serial/Com Ports in C
Posted by kudruu NO[at]SPAM gmail.com at 6/21/2007 9:44:46 PM
Hi, I tried posting this in comp.lang.C but need more specific help using winAPI. I am trying to find a way to populate a list of active Com ports on a computer. There may be around 30 on one computer and all connected to different Buses but I am looking for one in particular that is emitti...more >>

VC++ security problem using WMI
Posted by Newsgroups at 6/21/2007 5:46:13 PM
Hi, I found some code from codeproject site using WMI in VC++. I have created a method having the following code in it. It works fine when I am running into "Admin" accound in Windows XP Pro while in "Restricted user account", its not able to run. It's giving error messsage "Could not enum...more >>

How to disable disassembly window in VC++ 2005?
Posted by Herhor at 6/21/2007 4:39:00 PM
Hello! I have already started C++ programming with VC++ 2005 Express Edition. Unfortunately during debugging one of my first programs I had to unintentionally enable some debugger configuration feature which turns on Disassembly Window at the end of every my program (basic example below). ...more >>

Checking the type of a up casted class
Posted by DaTurk at 6/21/2007 1:52:58 PM
Hi, I want to check the type of a derived unmanaged class, upcasted to it's base class in CLI. Basically, I have several c++ classes that derive from a single abstract base class. I'm passing the base class in, and I want to check the type, and cast it later. Please advise. ...more >>

How to ? out argument in managed c++
Posted by Sharon at 6/21/2007 1:49:02 PM
Hello gurus, I have the following C# function signature: void TheFunction(Dictionary<string, MyClassObj> dicName, out int nOne, out int nTwo, out int nThree, out int nFour); And it works fine. I'm trying to write a managed C++ function that will save the save signature, but till now I'...more >>

Using an MC++ abstract base class in C#
Posted by Bill Spahn at 6/21/2007 7:54:04 AM
I have an abstract base class defined in an MC++ class library. I then create a descendent class in a C# class library. This seems to work OK with the exception of one of the abstract member functions/pure virtual function that uses a passed in pointer to a long. Just using pointers in ...more >>

atexit problems on statics inside mixed assembly after moving to VS2005
Posted by Aek at 6/21/2007 2:07:37 AM
We recently moved our large codebase over from VS7 to 8 and found that we now get access violations in atexit calls at shutdown when debugging the application in VS2005. This occurs in static members / singletons (especially meyer type singletons) which use locally declared static variables. The...more >>

How can I choose the VC Runtime Library
Posted by Qiang.Meng NO[at]SPAM gmail.com at 6/21/2007 12:00:00 AM
I'm using Visual C++ 2005 to build a lib. I found that there were 4 runtime libraries in the VC2005, /MD, /MT, / MDd, /MTd. Which one should I choose to ensure that my library can be used by all the other /MD or /MT programs? Thanks a lot! ...more >>

Synchronized queue?
Posted by frmdeveloper at 6/20/2007 2:19:38 PM
I'm porting an application from a Unix like system to Windows. I'm looking for a simple queue with FIFO characteristics which will cause the calling thread to suspend if there is no data on the queue, or return after a timeout. Is there any such component available or will I need to build one?...more >>

CLI and calling the parent contructor
Posted by DaTurk at 6/20/2007 11:44:37 AM
What's the syntax for calling a parent constructor in CLI? ...more >>

WIN32 Windows Application Outputting to Command Prompt as if a Console Program - How?
Posted by Peter Nimmo at 6/20/2007 8:34:09 AM
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it doesn't seem to write to the screen in the way I would expect. The output is: C:\>Test.exe ...more >>

Detach My VC++ Source code from ClearCase
Posted by Homer at 6/19/2007 11:55:28 AM
Hi All, In my work place we are still using VS6.00 with C++ and are not allowed to use a newer version (to connect to source control). We also use ClearCase as source control software. What I did was to install VS 2008 Beta 1 on my machine and made a copy of my source directory to use VS200...more >>

The applicationhangs when event is being unhooked
Posted by Amit Dedhia at 6/19/2007 7:27:29 AM
Hi I am developing an application using C++/CLI in Visual Studio 2005. In my application I have following structure. (1) Class A creates instances of Class B and Class C. (2) Class B implements a timer function which repeatedly executes a timer every 250 ms. (3) Class C instance hooks for ...more >>

Getting a Thumbnail In Vista
Posted by Tim Haughton at 6/19/2007 12:00:00 AM
Hi, I'm hoping someone can help me get a scalable thumbnail from Vista. Vista has a new COM API, IThumbnailCache which backs on to Vista's global thumbnail store. Unfortunately, I can't find it I know it's there, it's in MSDN. I've imported shell32.dll into my C# project which generates all ...more >>

VC6 -> VC8 CComModule
Posted by Fabiano Maciel at 6/18/2007 12:45:20 PM
Hi, I'm porting one of the dll from vc6 to vc8 and I have one problema about CComModule. My code use in stdafx.h: extern CComModule _Module and in my main module I use: CComModule _Module; but when i compile my code, i have the erros messages: 3>c:\temp\driverplc\driverplcs7\s7t...more >>

How to speed up C++/CLI build process?
Posted by hesicong at 6/16/2007 12:00:00 AM
I notice that compiling older C++ program with /clr option needs a lot of time. Now I have a program below which use mix code feature in C++/CLI: #include "stdafx.h" #include "ManagedException.h" class MixClass { ....(500 lines MixCode Here) } stdafx.h includes many stable header files. ...more >>

importing a tlb in Visual Studio 2005
Posted by kurt.kurtsmith NO[at]SPAM gmail.com at 6/15/2007 12:00:00 AM
I am trying to import a tlb from a COM server(exe) I wrote with the following statement: #import "C:\\em2\\EM\\src\\core\\UMOSEFax\\Debug\\UMOSEFax.tlb" no_namespace auto_search the tlh and tli are generated in the debug directory but I get the following error: Error 1 error LNK2019: unr...more >>

Supported VC2003 deployment targets
Posted by Charles E Hardwidge at 6/15/2007 12:00:00 AM
Feel a bit dumb for asking this. Could someone confirm whether VC2003 was a supported platform for deploying executables to Win95 or Win98. The last MSDN was Oct 2003. What's the last PSDK for VC2003 and Win95? http://msdn2.microsoft.com/en-us/vstudio/aa700897.aspx I'm hovering over wheth...more >>

framework or not framework
Posted by rodchar at 6/14/2007 1:03:03 PM
hey all, Regarding Visual Studio .Net 2005 can you still build applications that don't require the .Net Framework (I guess this would be called Unmanaged Code?). I'm asking because I'd like to create a very light toolbar that can work on many different computers and respective browsers (wheth...more >>

Calling Legacy C function from Managed C++
Posted by briankirkpatrick NO[at]SPAM cox.net at 6/14/2007 11:40:41 AM
Forgive me if my post seems a little amateurish... I'm requesting assistance from some of you smart folks out there to get the managed calls write that meet the specification in the esa.h for Esa_Init. When I make a call, VS2005 reports "AccessViolationException" and refers to the 4th paramet...more >>

Get Text from ListView Control - Managed C++ NET
Posted by Pantokrator at 6/14/2007 5:06:45 AM
Hi, I've searched the web and MSDN but couldn't find adequate information on retrieving the text of a subitem of a listviewitem. What I want to do is simple. I have a listview control with 2 columns and a large number of listviewitems. Every time I click on a row (one of the listviewitems), I...more >>


DevelopmentNow Blog