|
Hello
I am very new to managed c++, i have to start the codeing which needs many MFC features. I have done the same in VC++ 6.0. Now i must port it onto VC++.net.
Can anyone please confirm me wheather, i can start my project in VC++.net version (Managed C++) and also use the features of MFC.
Kindly give me the method i need to follow.
Thank you
Kind Regards
Sandy
|
|
|
|
|
Yes, you can create an MFC project and add the ( from memory ) /clr compiler switch to allow you to use managed code.
However, MFC doesn't offer anything that .NET doesn't offer, are you sure you want to rely on both ?
Christian Graus - C++ MVP
|
|
|
|
|
Thanks Christain, i think you have really made my work light. I am still in a dilama where i need to communicate with a firmware and also use some of the OCX for graphs and sliders. can my .net VC++ work in the same mannar as that of the MFC.
since MFC is strong on these concepts(like sending and reciving data from any other device) and also very mush usefull in system programming.
Kindly help me, I have to make a decision betwenn VC++.net and VC++.Net MFC.
Is vc++.Net same as MFC?
Sorry if i am bugging you up. I am deseprate for some support.
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Is vc++.Net same as MFC?
No, it's not even close. .NET is newer, less supported, but certainly does more. If you have the choice, I'd take C# over C++/CLI.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hmmmm.....
I am bit confused, i don't mean that way. Can i achieve my things like communicating with Firmware, via VC++.net. Is it functionality wise Same(.net & MFC)?
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Can i achieve my things like communicating with Firmware, via VC++.net.
Yes. There is *nothing* you can do in MFC that you can't do in C++/CLI ( or Win32, for that matter ). But, C++/CLI has a more modern framework, so it offers all sorts of stuff that vanilla C++ and MFC do not.
ksandy45 wrote: Is it functionality wise Same(.net & MFC)?
No. Like I said, the .NET framework offers a lot of stuff that MFC does not.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thank you Christian. I have clear picture now. I can start my project using Managed C++ and still do all the functionalists that i have done using MFC.
I hope what i predict is right?
Kindly help me for my further queries.
Thanks a lot.
Kind Regards
Sandy
|
|
|
|
|
MFC is just a Win32 wrapper. .NET is a whole new framework. C++/CLI will allow you to do any Win32 call you like.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thank you very much. I am really very much satisfied with your help. I shall start implementing the same using C++/CLI.
Kindly keep in touch. I shall be into trouble again...
Thanks a lot
Kind Regards
Sandy
|
|
|
|
|
Does anyone have any good articles on doing these 2 things with c/c++? I see many articles for c# and VB. I would like to do simple everyday tasks but faster without the need of accessing AD Users and computers everytime.
Thanks
|
|
|
|
|
Hi Everyone,
I have created a .Net User control which includes reference to a C++ /CLI component developed with /clr . Since there are some unmanaged resoucrces, i am calling the disposing the C++ /CLI in the dipose method of the user control. If we drag and drop this control in to a Windows form and then try to delete it,it is throwing an exception that the "C++ / CLI " dll could not be located.... however it is working fine while running the application
can anyone help me out.The sample code is
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (unmanagedComponent != null)
{
unmanagedComponent = null;
}
}
|
|
|
|
|
C++/CLI does not allow you directly access or override the Dispose method. You use a destructor (dtor) and a finalize destructor in your C++/CLI code. You explicitly dispose of the object's resources by using "delete". Since the finalize destructor does not get called if you use "delete", you should call the finalize destructor explicitly from the destructor if you have clean up code in the finalize destructor.
ref class Test
{
public:
~Test()
{
// free all managed and unmanaged resources and memory
}
protected:
!Test()
{
// free all unmanaged resources and memory only
}
};
|
|
|
|
|
I don't know how to window form in C++, because i never lernt @ college. I want to make an application where i create some textbox in windo form, it will display an result for e.g text1 = text2 * text3 . just the basic idea to make so that I can understand little bit of it
|
|
|
|
|
Do you want to use managed C++, or did you want to use MFC ? What version of the C++ compiler do you have ?
Christian Graus - C++ MVP
|
|
|
|
|
not to sure what is the diffrence is I thing MFC, I am using visual C++.net platform
|
|
|
|
|
If you have VC++2005 Express Edition, MFC is not an option, and really .NET is the only option you have.
Christian Graus - C++ MVP
|
|
|
|
|
i don't have VC2005 but i have vc2003
|
|
|
|
|
OK - the 'managed C++' syntax in 2003, Microsoft has abandoned. You certainly have MFC tho, which is a dying technology, but there's heaps of resources to support it. I'd still do C++ development in MFC, not in C++/CLI.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi ,
I have given CLR Support to a VC8 MFC Application and am trying to use a .Net Windows in MFC Form. When i try to use
CWinFormsControl m_ctrl1;
i get the following error
error C2143: syntax error : missing ';' before '<'
Can any one help
|
|
|
|
|
CWinFormsControl is a template class and you need to specify the template type parameter.
|
|
|
|
|
hi
any body help me in ANSI C. Basically i want to made classes in C to create/generate pdf file with out third party API If u hava any ref site or books plz send me url.
thanks
|
|
|
|
|
ANSI C does not support the .NET framework, therefore, you're in the wrong forum The Visual C++ forum is the closest we have to a forum for C.
Christian Graus - C++ MVP
|
|
|
|
|
Hi All,
I wrote a C++ program which will create a service in windows. By starting that service I want to run a particular .exe The issue here is that, after starting that service, that .exe is running in the task manager but the application window is not visible.
I am giving the .exe path as a command line argument while executing the C++ exe.
rgds.,
Surendran
|
|
|
|
|
If the service is running under a system account (SYSTEM, LocalService, etc.) then its child processes do too and they aren't visible by default on the interactive desktop. I believe the recommended way to run an app interactive is CreateProcessAsUser() . You shouldn't run the EXE as interactive and running in the service's account because that a) won't work in Vista and b) opens you up to elevation of priv attacks in pre-Vista.
|
|
|
|
|
Mike,
Thanks for the info. In the CreateProcessAsUser(
hToken,
NULL,
"cmd.exe" or cmdline args,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi
)
This I got from one site, I want to know, apart from calling this function, anyotherfunction needs to be called?And for the "htoken" parameter any objects or assignments needs to be done? and FYI is now I am using CreateProcess method in the program
Thanks
N.Surendran
|
|
|
|