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 > december 2006

Filter by week: 1 2 3 4 5

Access Violation error while using pointers
Posted by thejasviv at 12/31/2006 12:38:00 PM
Dear All, Here is my code: void main() { char *p="Hello"; *p='M'; //This is where the error occurs cout<<p<<endl; } This code compiles and executes perfectly in Boreland C++. When I run the same code in VC++ 6.0, however, I get the below error in debugging mode: Unhandled exc...more >>

Attempted to read or write protected memory. Exception in release build, instantiating unmanaged class.
Posted by Bruce at 12/30/2006 11:36:06 PM
I am getting the following exception in the release build of my assembly. {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} System.Exception {System.AccessViolationException} I do not have any problems in debug. The problem occurs...more >>

Forms deletes itself
Posted by RFOG at 12/30/2006 10:03:33 PM
Hello all! I've a bunch of forms that I create on app startup. But sometimes they are auto disposed. I don't understand why, because I instantiate them by gcnew and does not delete until app ends. -- Visita mi blog principal: http://rfog.blogsome.com Y este sobre programación: http:/...more >>

Referencing an managed class from an unmanaged class?
Posted by Bruce at 12/29/2006 10:47:01 PM
I need to fire an event from an unmanaged class. If I declare a pointer to the managed class within the unmanaged class I get a compile error " "cannot declare a managed 'm_pGps' in an unmanaged 'MyProgressNotifier'" Any idea how I can do this? -- Bruce E. Stemplewski GarXfac...more >>

Device Context Problem in XP
Posted by Mullai at 12/29/2006 9:59:56 PM
Hi Frendz, I am working in an application in VC++ 6.0 in Windows 98 platform for drawing images.It works well in win 98 . I am trying to import the same application for Windows XP. While doing this the DEVICE CONTEXT creates problem. ///////////////////MY CODE////////////// int ...more >>

Inline funtions (STL) not inlining
Posted by Mick O''Neill at 12/29/2006 9:40:00 PM
I asked about this a few days ago, and not found an aswer yet, but I have tracked down further info. I am getting the problems occrrung with the stl, under thses sorts of circumstances: #include "LibraryHeader.h" #include <list> namespace MyNamespace { public ref MyClass { public: ...more >>

Can I reset the build number?
Posted by Bruce at 12/29/2006 7:31:05 PM
I have the following line in my assembly.cpp. [assembly:AssemblyVersionAttribute("1.0.*")]; The * allows the build number to be automatically included. Is there any way to reset this build number? If so, how? -- Bruce E. Stemplewski GarXface OCX and C++ Class Library for the Garmin G...more >>

Managed Overloaded Assignment Operator needed
Posted by raylopez99 at 12/29/2006 4:02:40 PM
I need an example of a managed overloaded assignment operator for a reference class, so I can equate two classes A1 and A2, say called ARefClass, in this manner: A1=A2;. For some strange reason my C++.NET 2.0 textbook does not have one. I tried to build one using the format as taught in my re...more >>



ASP.NET 2.0 Menu Control
Posted by Simon Amrein at 12/29/2006 11:21:25 AM
Hello NG Does anyone knows, how I can design the submenu-style different from the mainmenu? <asp:Menu ID="menu1" runat="server" BorderColor="#000040" BorderStyle="Solid" CssClass="frameworkWide" Orientation="Horizontal" DynamicEnableDefaultPopOutImage="False" StaticEnableDefaultPopO...more >>

Program can't run: "The application has failed to start because its side-by-side configuration is incorrect"
Posted by Lloyd Dupont at 12/29/2006 10:27:11 AM
Hi All! I have this application of mine which works well. It even used to work on Vista. (I work on XP most of the time). There are some ManagedC++ assemblies in the project. Now when I try to start the project under vista, when I try to access classes in the ManagedC++ assemblies I get...more >>

Using dotNet obejct in COM componant
Posted by themadmax at 12/29/2006 2:51:37 AM
I'm writting a COM componant in C++/IDL. This componant is using in C# project, and I want to use System.Drawing.Bitmap In my IDl file I writed importlib("System.Drawing.tlb"); On function declaration is [id(5)] HRESULT image([out, retval] _Bitmap **ppImage); But how I can create initiaze it c...more >>

Problem passing structs to dll's
Posted by olidem at 12/29/2006 2:18:00 AM
Hi! I am confused about the abnormal behaviour of my project. Please consider the following situation: I have written an application in C++.NET 2003 (managed) which loads and executes an unmanaged function from an unmanaged dll. On the dll-side i export this function: typedef struct...more >>

Need to make a folder that will show in everyones MyDocuments
Posted by Franky at 12/28/2006 10:23:38 PM
In a prior post I asked about referencing the folder "My Documents" and someone was good enough to tell me about: SHGetFolderPath(NULL, CSIDL_PERSONAL|CSIDL_FLAG_CREATE, NULL, 0, szMyDocPath); But now I think I asked the wrong question. What I want is a folder into which I can put a folde...more >>

getting amount of memory my process is taking
Posted by Abubakar at 12/28/2006 6:31:32 PM
Hi, is there any win32 api or standard library function that would tell me how much memory my application/process is taking? What I want is to see how much memory some of my important functions are allocating and proper;y deallocating. regards, -ab. .. ...more >>

problem with calling C++/CLI wrapper to C++ code from C# applicati
Posted by phys at 12/28/2006 4:46:01 PM
I need to write a C# application that uses unmanaged C++ code. I created a C++/CLI wrapper to C++ code and encountered the following problem. Any time I try to instantiate a wrapper in C# application the program crashes with an error "An unhandled exception of type 'System.IO.FileNotFoundExc...more >>

VS2005 Pro SP1 and C4244
Posted by A Wieser at 12/28/2006 4:13:17 PM
I've just upgraded to SP1, and am seeing C4244 warnings on code like the following: void fn() { short a = 1; short b = 2; a += b; // warning C4244: '+=' : conversion from 'int' to 'short', possible loss of data i:\2005\CPP\NDS\testmsl\Calsetng.cpp 168 // but ...more >>

/D "_UNICODE" /D "UNICODE" showing in command line but not in preprocessor definitions??
Posted by Bruce at 12/27/2006 8:11:27 PM
I am trying to compile my project but it is compiling for Unicode. I checked the preprocessor definitions and there is no UNICODE reference but I see /D "_UNICODE" /D "UNICODE" in the command line. I even tried clearing all of the preprocessor definitions and the /D "_UNICODE" /D "UNICODE...more >>

Having problems initializing a managed array
Posted by raylopez99 at 12/27/2006 4:54:12 PM
Hi all, I'm getting a runtime error for the below program, though it compiles fine. The culprit seems to be the managed array--it doesn't exist. What am I doing wrong? RL // OverL2_simple.cpp : main project file. #include "stdafx.h" #include "AClass.h" using namespace System; i...more >>

Should I be using int or Int16 for the paramaters for my assembly methods?
Posted by Bruce at 12/27/2006 4:38:11 PM
I have a public method in a managed class similar to void foo(int i); I noticed something a bit curious when I complied the help file with Sandcastle. Sandcastle is seeing the int parameters as Int32. Should I not be using int but use Int16 so that the parameter is compatible across all o...more >>

How to deploy private Assemblies with VC2005 SP1
Posted by Joerg Toellner at 12/27/2006 11:53:35 AM
Dear Group, i develop an app with MSVC++ 2005 pro. My app should not use any installation. It's only a "packing out the zip and run it"-installation. So i use private assemblies with manifests and DLLs in the app directory itself. All works fine with MSVC2005 Pro PRE SP1. I packed into ...more >>

Can't access public member from C# (works in VB, C++/CLI)
Posted by wpcmame at 12/27/2006 12:42:01 AM
I got the following code public ref class A { value struct PrivateType sealed { Int32 id; }; public: ref struct B abstract sealed { static const PrivateType x = {1}; static const PrivateType y = {2}; }; A() { } property PrivateType P { void set(PrivateType p) { mt = p; }...more >>

Lots of link errors in Debug but not realease build
Posted by Bruce at 12/26/2006 8:40:27 PM
I am getting a lot of link errors when compiling in the debug build but not release. I am compiling a CLR managed code class library. I believe the link errors are actually being caused by a static library of unmanagaed code. I think the problem comes from the fact that the unmanaged stat...more >>

Generate XML Documentation Files option causes obj files not to be created
Posted by Bruce at 12/26/2006 7:05:53 PM
I am using the Express version of VS2005 If I set Generate XML Documentation Files to yes then the xml file is generated but my OBJ files do not get generated. Any idea why? I am using the following versions: Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft...more >>

XML Help file is not being built.
Posted by Bruce at 12/26/2006 5:32:59 PM
I am using VC8 with VS 2005. I understand that the XML file for use by products like Sandcastle is now generated for C++? My XML file is not being generated. I can see the properties setting for the file. I have suppress banner set to No, so I would think I should see something in the ...more >>

Need a call to get the folder "My Documents"
Posted by Franky at 12/26/2006 4:30:06 PM
I know about GetModuleFileName but what I need is a similar call to get the folder "My Documents" Is there such a thing? Thanks ...more >>

how to protect code
Posted by --== Alain ==-- at 12/26/2006 4:16:56 PM
Hi, Using the .NET reflector tool, i know that a DLL or EXE developed in ..NET platform can be decompiled and therefore code is available for all. I would like to know if exist a way how to avoid tools like .NET reflector to decompile your code or at least to avoid people to see clearly ...more >>

better component than ListVIew
Posted by --== Alain ==-- at 12/26/2006 3:21:19 PM
Hi, Several months ago i've asked some information about the best way how to have some particular columns (progress bar, checkbox, images, color picker,...) in a ListView component. It seems that ListView is a complex component and a lot of people advise to build a custom component but n...more >>

inline expansion
Posted by Mick O'Neill at 12/26/2006 2:18:00 PM
I am currently trying to wrap an old library (ImageMagick) in .NET, and am having problems with inline expansions. I have recompiled the library in vc++ 2005 OK. However, when I try to access any inline methods of the library classes from my managed classes, the inlining does not seem to occur...more >>

making code native in a C++/CLI program
Posted by Ben Voigt at 12/26/2006 11:36:12 AM
Under certain circumstances I get: First-chance exception at 0x7c812a5b (kernel32.dll) in LTMGUI.exe: 0xC0020001: The string binding is invalid. First-chance exception at 0x7c812a5b (kernel32.dll) in LTMGUI.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. Unhandled exce...more >>

deletion of System::String
Posted by fade at 12/25/2006 10:54:04 PM
Good night I'm trying to convert a CString into a System::String on a MFC project, this way: CString t1("Hello, World!"); #pragma push_macro("new") #undef new System::String *s1 = new System::String(t1); #pragma pop_macro("new") Everything works ok, but if I try to free s1 delete ...more >>

Why id pin_ptr is causing cannot instantiate abstract class error?
Posted by Bruce at 12/25/2006 9:31:23 PM
public ref class GpsDevice abstract { /* Please note GarXface4::GpsDevice* is in a different namespace from this one and GarXface4::GpsDevice is an unmanaged class */ virtual GarXface4::GpsDevice* GetDevice() = 0; }; I have a couple of classes inherited from that class. pu...more >>

How to find the library name give a system include file
Posted by Franky at 12/24/2006 11:25:18 AM
I have a cpp program that use to compile in C++6 but gives a bunch of errors in VS2005 Error 12 error LNK2019: unresolved external symbol _strstr referenced in function "char * __cdecl strstr(char *,char const *)" (?strstr@@YAPADPADPBD@Z) AnnGame.obj I'm wondering if I'm missing a library...more >>

What should I target? Can VS 2005 CLI DLLs be used by 2003?
Posted by Bruce at 12/24/2006 9:32:27 AM
I have started my first major DotNet project. It is a DLL that I would to sell and distribute. I need to know if I should write it in VS2005 C++ CLI or VS2003. Can VS2005 CLI compiled DLLs be used in VS2003? If not: Have most people moved to 2003? Would be be better to target 2005? ...more >>

C++/CLI : How do I hold a reference to Native pointer in a Ref Class
Posted by Russell Mangel at 12/24/2006 9:04:17 AM
/* Hi, I am trying to hold a reference to un-managed pointer IStorage. The client/callers will make many accesses to IStorage, but only in-directly. For performance reasons IStorage needs to be opened once, and a reference held by MyClass for duration of session. 1. Should I use a native...more >>

MC++ to CLI converison program?
Posted by Bruce at 12/23/2006 9:04:09 PM
I have some code in MC++. I would like to convert it to CLI. Is there a conversion program that exists anywhere? If so where? Bruce...more >>

access a disk/partition without a drive letter
Posted by unknown; at 12/23/2006 8:15:06 AM
hi, i want to write an application who can acces a disk/partition in windows xp. I know how to do that if the disk/partition has a drive letter. But in this case the disk has no driveletter and is in that case for normal users invisible in windows xp. i've searched the internet but i don't ...more >>

Should my code implementation go in my .CPP or the .H header file?
Posted by Bruce at 12/23/2006 12:12:54 AM
I have seen sample code that is implemented in the .h header file ("java style") and I have seen samples where the code was implemented in the ..CPP file. Which is correct? What is the best place to put my code implementation in VC++ DotNet? P.S. The code is for a control where I am o...more >>

Events Sample that I can then use in VB with With Evnets keyword
Posted by Bruce at 12/22/2006 11:28:27 PM
I have a DotNet C++ class that I would like to fire an event to then be used by VB.Net using the With Events keyword. I have experience creating connection point events for ActiveX controls, it is actually very easy with the ATL wizard but I am lost when it comes to C++ .Net's events. ...more >>

Window caption from hmodule.
Posted by Abhishek at 12/22/2006 12:08:36 AM
Hi, How do i find the window caption by using the hmodule of that window? Regards Abhishek ...more >>

V++6 compiles OK but VS2005 gives errors
Posted by Franky at 12/21/2006 6:31:32 PM
I have a cpp program that use to compile in C++6 but give a bunch of errors in VS2005 I'm wondering if I need to reference to some library. I'd appreciate any helpful suggestion Even if it's just a suggestion of where to look or something that might work. --------------------------de...more >>

Managed C++ to C# Conversion
Posted by Shailen Sukul at 12/19/2006 8:21:01 PM
I have some code that was written in managed C++ using VS 2005. I want to convert that code into C#. Is there a tool available to do this? Thanks in advance. -- Shailen Sukul Architect (BSc MCTS, MCSD.Net MCSD MCAD) Ashlen Consulting Service P/L (http://www.ashlen.net.au)...more >>

Populating an array<System::UInt32>^ from an unmanaged array in the new C++/CLI syntax
Posted by Bern McCarty at 12/19/2006 5:39:33 PM
In the old MEC++ syntax I can do this: // compile in VS 2005 shell with cl -clr:oldsyntax -LD ArrayCopyOldSyntax.cpp #using <mscorlib.dll> public __gc class CopyTest { private: System::UInt32 m_indeces __gc[]; public: CopyTest(unsigned int indeces __nogc[], unsigned int arr...more >>

What's with the new C++/CLI pointers (handles ^)? Managed C++.NET
Posted by raylopez99 at 12/19/2006 3:10:27 AM
microsoft.public.dotnet.languages.vc Please comment on the following code fragment. Note the comments "Why"? Particularly, (1) why does referencing and dereferencing a pointer give the same thing (at least in WriteLine(), which might be some sort of cast going on behind the scenes), (2) ...more >>

changing Application version in VC .Net framework
Posted by Bipin Mistry at 12/18/2006 11:15:20 PM
hi all, Please reply as I am new to VC .Net GUI Can any one please tell me from where I can set Application version in VC .Net environment. Please note that I am creating Exe & DLL where there is no resource file which contains this info as compared to VC++ 6. Thanks Bipin Mist...more >>

Logging as windows system account
Posted by ranadhir_nag at 12/18/2006 11:09:39 PM
We have written a windows ATL server application which runs as a windows service(system account). Since the system account does not have file-write prmissions,we are searching for a way how to introduce logging mechanism into this application(either to file or event log). Any help on this wil...more >>

1 solution, 2 projects: how to use function form project B into project A
Posted by unknown; at 12/18/2006 6:55:25 AM
hello, i've got a question about using a function from project B in project A. The projects are both in the same solution (using Microsolft Visual Studio 2005) the projects ara both native C++. i've already added a reffrence from projectB into projectA. i've got a function in projectA: ...more >>

Linking VS6.0 DLL to .Net 2003 - CString Error
Posted by sreenubkaimal NO[at]SPAM gmail.com at 12/18/2006 12:08:15 AM
Please help me with this.. I have a DLL created in Visual C++ 6.0 ( VS 6.0 ). I am trying to use this DLL in a new wrapper application written using Visual Studio .net 2003 (C++ - MFC). My DLL has many methods which uses CString as arguements and return values. At first, I got a Link ...more >>

DrawDibDraw displays nothing
Posted by ulillillia at 12/17/2006 2:24:00 PM
My code compiles without any errors and the only warnings are irrelevant to the function used to load and display the image with. The file loads properly, but DrawDibDraw isn't displaying anything at all. What's wrong with it? The BMP image itself should be very easily detected - it's black...more >>

More on exception handling (Arnaud?)
Posted by Vincent Fatica at 12/17/2006 2:15:32 PM
It seems Arnaud was on target regarding the RTL inserting exception handling routines. Here's another oddball occurrence on which I hope someone can shed some light. My EVENT struct is declared in a header file. If without making any source changes, I move the definition of it constructor (s...more >>

Block (or Hide) Control Panel
Posted by Jay at 12/15/2006 11:05:31 AM
Hey There, I've been trying to see if there is a way to programmatically block, or hide, the Control Panel. Since it is a "Virtual Folder", just blocking an .exe from running doesn't work. Even some of the applet items in the Control Panel are problematic. The "Fonts" link or the "Network Co...more >>


DevelopmentNow Blog