473,466 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MS VC++ .NET (2002): Executable file for Debugging Session

Hi all,
I loaded the following program 'HelloMCPP' to my MS
VC++ .NET (2002) that is installed on my Windows XP
Professional PC:
-------------------------------------
AssemblyInfo.cpp
---------------------
#include "stdafx.h"
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
//
// General Information about an assembly is controlled
through the following
// set of attributes. Change these attribute values to
modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("")];
[assembly:AssemblyProductAttribute("")];
[assembly:AssemblyCopyrightAttribute("")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
//
// Version information for an assembly consists of the
following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the
Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
//
// In order to sign your assembly you must specify a key
to use. Refer to the
// Microsoft .NET Framework documentation for more
information on assembly signing.
//
// Use the attributes below to control which key is used
for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not
signed.
// (*) KeyName refers to a key that has been installed
in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers
to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both
specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that
key is used.
// (2) If the KeyName does not exist and the
KeyFile does exist, the key
// in the KeyFile is installed into the CSP and
used.
// (*) In order to create a KeyFile, you can use the
sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of
the KeyFile should be
// relative to the project directory.
// (*) Delay Signing is an advanced option - see the
Microsoft .NET Framework
// documentation for more information on this.
//
[assembly:AssemblyDelaySignAttribute(false)];
[assembly:AssemblyKeyFileAttribute("")];
[assembly:AssemblyKeyNameAttribute("")];
--------------------------------
HelloMCPP.cpp
--------------------
// This is the main DLL file.
#include "stdafx.h"
#include "HelloMCPP.h"
----------------------
Stdafx.cpp
-------------------
// stdafx.cpp : source file that includes just the
standard includes
// HelloMCPP.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type
information
#include "stdafx.h"
----------------------
HelloMCPP.h
-----------------
// HelloMCPP.h

#pragma once

using namespace System;

namespace HelloMCPP
{
public __gc class HelloMCPP
{
public:
virtual void Hello()
{
Console::WriteLine(S"Hello from Managed C++!");
}
};
}
--------------------------------------
stdafx.h
-------------------------------
// stdafx.h : include file for standard system include
files,
// or project specific include files that are used
frequently,
// but are changed infrequently

#pragma once

#using <mscorlib.dll>
----------------------------------------------
I did 'Build' and ran this program - I got the following
dialog box:
HelloMCPP-Executable for Debugging Session
Please specify the name of the executable file to be
used for the debug session:
Executable file name:
------------------------------
| | \/ |
------------------------------
(There are three choices in this drop-down:
Internet Explorer
ActiveX Control Test Container
regsvr32)
URL where the project can be assessed
(ATL Server only):
--------------------------------
| |
--------------------------------
(1) I do not know what to pick in the "three choices"
and/or to fill the "URL" box. Please help and tell me
what I should do to get the "Hellow from Managed C++!"
printed out on my computer via the console or Internet.

(2) How does this program use a DLL to pass on
the "Hellow from Managed C++!" to somewhere for printing?
I do not understand this DLL at all!!!??? I do not know
much about DLL. Please explain it to me or point out
where I made a mistake for not specifying a right thing
during the conpiling of this program.

Thanks in advance,
Scott Chang
Nov 16 '05 #1
1 4827
You built a DLL (which doesn't run by itself). You need to build an exe.
What project type did you select when you created this project? You need to
select one that has application"in the name and not "library".

Ronald Laeremans
Visual C++ team

"Scott Chang" <an*******@discussions.microsoft.com> wrote in message
news:52****************************@phx.gbl...
Hi all,
I loaded the following program 'HelloMCPP' to my MS
VC++ .NET (2002) that is installed on my Windows XP
Professional PC:
-------------------------------------
AssemblyInfo.cpp
---------------------
#include "stdafx.h"
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
//
// General Information about an assembly is controlled
through the following
// set of attributes. Change these attribute values to
modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("")];
[assembly:AssemblyProductAttribute("")];
[assembly:AssemblyCopyrightAttribute("")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
//
// Version information for an assembly consists of the
following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the
Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
//
// In order to sign your assembly you must specify a key
to use. Refer to the
// Microsoft .NET Framework documentation for more
information on assembly signing.
//
// Use the attributes below to control which key is used
for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not
signed.
// (*) KeyName refers to a key that has been installed
in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers
to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both
specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that
key is used.
// (2) If the KeyName does not exist and the
KeyFile does exist, the key
// in the KeyFile is installed into the CSP and
used.
// (*) In order to create a KeyFile, you can use the
sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of
the KeyFile should be
// relative to the project directory.
// (*) Delay Signing is an advanced option - see the
Microsoft .NET Framework
// documentation for more information on this.
//
[assembly:AssemblyDelaySignAttribute(false)];
[assembly:AssemblyKeyFileAttribute("")];
[assembly:AssemblyKeyNameAttribute("")];
--------------------------------
HelloMCPP.cpp
--------------------
// This is the main DLL file.
#include "stdafx.h"
#include "HelloMCPP.h"
----------------------
Stdafx.cpp
-------------------
// stdafx.cpp : source file that includes just the
standard includes
// HelloMCPP.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type
information
#include "stdafx.h"
----------------------
HelloMCPP.h
-----------------
// HelloMCPP.h

#pragma once

using namespace System;

namespace HelloMCPP
{
public __gc class HelloMCPP
{
public:
virtual void Hello()
{
Console::WriteLine(S"Hello from Managed C++!");
}
};
}
--------------------------------------
stdafx.h
-------------------------------
// stdafx.h : include file for standard system include
files,
// or project specific include files that are used
frequently,
// but are changed infrequently

#pragma once

#using <mscorlib.dll>
----------------------------------------------
I did 'Build' and ran this program - I got the following
dialog box:
HelloMCPP-Executable for Debugging Session
Please specify the name of the executable file to be
used for the debug session:
Executable file name:
------------------------------
| | \/ |
------------------------------
(There are three choices in this drop-down:
Internet Explorer
ActiveX Control Test Container
regsvr32)
URL where the project can be assessed
(ATL Server only):
--------------------------------
| |
--------------------------------
(1) I do not know what to pick in the "three choices"
and/or to fill the "URL" box. Please help and tell me
what I should do to get the "Hellow from Managed C++!"
printed out on my computer via the console or Internet.

(2) How does this program use a DLL to pass on
the "Hellow from Managed C++!" to somewhere for printing?
I do not understand this DLL at all!!!??? I do not know
much about DLL. Please explain it to me or point out
where I made a mistake for not specifying a right thing
during the conpiling of this program.

Thanks in advance,
Scott Chang

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Venky | last post by:
We have a strange error here. We have an application that is built in VC++ 6.0 and uses a C library built using the same. Now, we have migrated to .Net and have used the same source code to be...
1
by: Drew Tennenbaum | last post by:
There is an old thread I found on google where the OP was exhibiting the same problems I am seeing. Reference "Debugger hell" posted 7-18-2002 by Sean Gies I am running Visual Studio 2003 RTM....
5
by: Scott Chang | last post by:
Hi all, I copied a set of VC++ version 6 source code of the 'cppdll'(2 projects) from a website and put the cppdll.cpp, cppdll.def, cpp.h, (as the 1st project) and test.cpp (as the 2nd project)...
3
by: KRK | last post by:
I am having one batch file and using this I can start my Server. It will execute all exes while starting. Now my question is how to debug my exe using this batch file?? Is it possible to execute this...
3
by: Old Codger | last post by:
Thanks for this Oleg, nice try! Unfortunately the solution you gave refers to .NET 2002 and I am using .NET 2003. In the article it says: "This bug was corrected in Microsoft Visual C++ .NET...
3
by: SHC | last post by:
Hi all, 1) I have used VC++.NET 2002 (v7.0) for a while. Recently I just installed VC++.NET 2003 (v7.1) - I saw the message "Settings were not migrated from Visual Studio.NET 2002 to Visual...
2
by: Alfonso Morra | last post by:
Hi, I have written a simple test harness (exe) for a C++ (native) DLL that exports some C++ objects. The objects throw exceptions when they an error occurs in the Ctor, and the test harness is...
6
by: Scubadude | last post by:
Hi, I'm new to perl and have run into some roadblocks while trying to run tutorials. I have installed Apache v2.2.3 I have installed ActivePerl v6.6.1.638 I have installed php v5.2.0 I am...
4
by: Roger | last post by:
Hi, I am just learning to use Visual C ++ 2005 Express Edition. I wrote a simple "Hello World" program which compiles OK, and gives 0 errors, after a little tweaking, it gives: ==========...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.