Click to See Complete Forum and Search --> : mscorelib.dll
diligent
November 13th, 2005, 05:11 AM
Hello;
I get a C1190 error when i put this line in the StadAfx.h ot my app.
The purpose is to use a registry keys access example i found on the net.
Thaks for help
Dan
PadexArt
November 13th, 2005, 05:21 AM
What line and what function? :) Have you read MSDN - C1190 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcerrFatalErrorC1190.asp) ?
The following stdafx.h entry should solve your problem:
#using <mscorlib.dll>
diligent
November 13th, 2005, 05:37 AM
Hi;
Here's my StdAfx.h, i've inclde the #using <mscorelib.dll> entry but it's a mess.
#if !defined(AFX_STDAFX_H__2A40B27E_29B3_4FBA_A652_EB422A096B08__INCLUDED_)
#define AFX_STDAFX_H__2A40B27E_29B3_4FBA_A652_EB422A096B08__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include "CKAll.h"
#using <mscorlib.dll>
//using namespace System;
//using namespace Microsoft::Win32;
using namespace std;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__2A40B27E_29B3_4FBA_A652_EB422A096B08__INCLUDED_)
diligent
November 13th, 2005, 05:40 AM
I get this error message :
fatal error C1190: le code cible managé requiert '#using <mscorlib.dll>' et l'option '/clr'
Wich means in english :
fatal error C1190: managed target code requires '#using <mscorlib.dll>' and the option '/clr'
Dan
PadexArt
November 13th, 2005, 05:47 AM
What is your project's type? What options have you selected from the "new project" wizard?
diligent
November 13th, 2005, 05:51 AM
It's an old created Win32 project (not console project), first created under VC 6 then converted.
It work fine till i try to include the registry access exanmple i found that require the mscorelib.dll entry.
I search everywhere in the project options where's the /clr entry but can't find.
PadexArt
November 13th, 2005, 05:54 AM
You need to enable the language extensions:
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
Click the Configuration Properties folder.
Click the General property page.
Modify the Use Managed Extensions property to yes.
Hope it helps.
EDIT: For futher details see /clr (Common Language Runtime Compilation) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefEECOMCompilation.asp)
cilu
November 13th, 2005, 05:56 AM
You're mixing managed and unmanaged code. Do you really need that?
In VC++ 6.0 that can't work. In VC++ 7.x you must use the /clr compile option. To set this compiler option in the Visual Studio development environment :
Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
Click the Configuration Properties folder.
Click the General property page.
Modify the Use Managed Extensions property.
cilu
November 13th, 2005, 05:58 AM
[ redirected thread ]
diligent
November 13th, 2005, 06:01 AM
Many thanks for your help it works. I have big problem with the "help" files of msdn, it's always very clear for non-professionals.
The compilation options are very tricky and not always so easy to manage.
I'm quite sure i'll have to return on this forum when i'll try to implement my registry access system.
Thanks again
cilu
November 13th, 2005, 06:20 AM
Let me ask this: why are you mixing managed and unmanaged code? It's not recommanded.
diligent
November 13th, 2005, 06:34 AM
Simply because i'm a novice, learning C++ by my own ( and with the help of some fantastic forums like this one) :) :) :)
PadexArt
November 13th, 2005, 06:39 AM
Simply because i'm a novice, learning C++ by my own
That would be one extra reason to separate the 2, as Cilu said. Learning C++ can be very confusing on its own; adding Managed Extensions to the mix can only complicate the process. :)
On the other hand I know the temptation of seeing something graphical in your application. ;) Just make sure you are super-extra carefull and t6ry to undesrtand where C++ stops and Managed C++ starts.
Best of luck to you.
diligent
November 13th, 2005, 06:58 AM
OK i'll take care of your recommendations (what i thank you for).
So what do you recommend for accessing registry key (read, create, modify) knowing that i try this without MFCs and ATLs.
Dan
PadexArt
November 13th, 2005, 07:06 AM
You could use the Win32 Registry Functions (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_functions.asp)
diligent
November 13th, 2005, 07:16 AM
OK i'll check that tomorrow.
Your web site is now part of my favorites, you can check mine that as nothing to do with C++ : www.dandil.net.
C U
Dan
cilu
November 13th, 2005, 11:03 AM
I have some examples here (http://www.cilu.as.ro/calculatoare/sc_registry.php).
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.