Click here to Skip to main content
15,912,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionI started the thread and want to wait until the thread completes [modified] Pin
ptr_Electron18-Aug-08 20:28
ptr_Electron18-Aug-08 20:28 
AnswerRe: I started the thread and want to wait until the thread completes [modified] Pin
SandipG 18-Aug-08 20:40
SandipG 18-Aug-08 20:40 
GeneralRe: I started the thread and want to wait until the thread completes Pin
ptr_Electron18-Aug-08 20:42
ptr_Electron18-Aug-08 20:42 
GeneralRe: I started the thread and want to wait until the thread completes [modified] Pin
SandipG 18-Aug-08 20:45
SandipG 18-Aug-08 20:45 
AnswerRe: I started the thread and want to wait until the thread completes Pin
Stephen Hewitt18-Aug-08 21:07
Stephen Hewitt18-Aug-08 21:07 
AnswerRe: I started the thread and want to wait until the thread completes Pin
Roger Stoltz18-Aug-08 22:33
Roger Stoltz18-Aug-08 22:33 
QuestionRe: I started the thread and want to wait until the thread completes Pin
Mark Salsbery19-Aug-08 8:01
Mark Salsbery19-Aug-08 8:01 
QuestionUsing DotNET API in MFC application Pin
ComplexLifeForm18-Aug-08 20:04
ComplexLifeForm18-Aug-08 20:04 
Hi All,

I wanted to use NET API in my MFC application, since this was new to me I started out with a simple application listed below

#include "stdafx.h"
#include "myapp.h"

#using <mscorlib.dll>
#using <system.dll>

using namespace System;

// The one and only application object
CWinApp theApp;
using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{

int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
Console::WriteLine("This is a MFC app using NET API");
}
return nRetCode;
}

Till few days back I was able to successfully compile and run this simple application using VC++ 2005 with SP1, however now when I am trying to compile the application I am getting the following error

1>.\myapp.cpp(45) : error C3666: 'System::Security::IEvidenceFactory::IEvidenceFactory' : override specifier 'new' not allowed on a constructor
1> This diagnostic occurred while importing type 'System::Security::IEvidenceFactory ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1> This diagnostic occurred while importing type 'System::Console ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : error C3611: 'System::Security::IEvidenceFactory::GetLifetimeService': a sealed function cannot have a pure-specifier
1> This diagnostic occurred while importing type 'System::Security::IEvidenceFactory ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1> This diagnostic occurred while importing type 'System::Console ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>.\myapp.cpp(45) : error C4687: 'System::Console': a sealed abstract class cannot implement an interface 'System::Security::IEvidenceFactory'
1> This diagnostic occurred while importing type 'System::Console ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>.\myapp.cpp(45) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1> This diagnostic occurred while importing type 'System::Console ' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

The MSDN documentation is not very helpful on the error message and also the fact that I am new to NET arena so I really do not understand what went wrong.

In the last few days I have installed DotNET framework 2.0 SP1 on my machine and many other applications required by my project so it is difficult for me to go back to pre 2.0 SP1 configuration.

Does someone no what is this error? And how do I get rid of this.

Thanks and Regards
AnswerRe: Using DotNET API in MFC application Pin
Rajesh R Subramanian18-Aug-08 20:09
professionalRajesh R Subramanian18-Aug-08 20:09 
AnswerRe: Using DotNET API in MFC application Pin
Hamid_RT18-Aug-08 20:19
Hamid_RT18-Aug-08 20:19 
QuestionRemote Procedure Call. Pin
T.RATHA KRISHNAN18-Aug-08 19:48
T.RATHA KRISHNAN18-Aug-08 19:48 
AnswerRe: Remote Procedure Call. Pin
User 21559718-Aug-08 19:55
User 21559718-Aug-08 19:55 
QuestionRe: Remote Procedure Call. Pin
T.RATHA KRISHNAN18-Aug-08 20:01
T.RATHA KRISHNAN18-Aug-08 20:01 
AnswerRe: Remote Procedure Call. Pin
Rajesh R Subramanian18-Aug-08 20:05
professionalRajesh R Subramanian18-Aug-08 20:05 
AnswerRe: Remote Procedure Call. Pin
toxcct19-Aug-08 23:46
toxcct19-Aug-08 23:46 
AnswerRe: Remote Procedure Call. Pin
_AnsHUMAN_ 18-Aug-08 20:04
_AnsHUMAN_ 18-Aug-08 20:04 
AnswerRe: Remote Procedure Call. Pin
Rajesh R Subramanian18-Aug-08 20:04
professionalRajesh R Subramanian18-Aug-08 20:04 
AnswerRe: Remote Procedure Call. Pin
David Crow19-Aug-08 3:36
David Crow19-Aug-08 3:36 
Questionerror C2011 Pin
vcprog18-Aug-08 19:08
vcprog18-Aug-08 19:08 
AnswerRe: error C2011 Pin
Jijo.Raj18-Aug-08 19:44
Jijo.Raj18-Aug-08 19:44 
GeneralRe: error C2011 Pin
vcprog18-Aug-08 20:06
vcprog18-Aug-08 20:06 
GeneralRe: error C2011 Pin
Jijo.Raj18-Aug-08 21:42
Jijo.Raj18-Aug-08 21:42 
GeneralRe: error C2011 Pin
vcprog18-Aug-08 22:23
vcprog18-Aug-08 22:23 
GeneralRe: error C2011 [modified] Pin
Jijo.Raj18-Aug-08 22:31
Jijo.Raj18-Aug-08 22:31 
QuestionHow to pass variables of type RecordSet from VB ocx to VC++ program??? Pin
savitri18-Aug-08 18:56
savitri18-Aug-08 18:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.