|
Harggg!!!
I don't think so!
You need to re-program the UI ( no builder ), and if your current MFC app is very UI intensive, it can take some times.
Max.
|
|
|
|
|
Thanks Max,
Do you agree its probably better to move it now rather than the whole project later? As i get the feeling we'll all be going the C# way.
Cheers
Matt G
|
|
|
|
|
There are 2 possibilities :
1- move now :
pros : less code to port; chance to learn a new technology.
cons : learning curve and false expectations from management.
2- move later :
pros : not much pros here, except maybe a better knowledge of the application domain.
cons : lot's of re-programming; maybe hard to convince your boos to pay to redo something that's already working.
Whatever the choice you take, I'd suggest trying to separate the UI from the core as much as possible.
If I was in your position, I'd move now to .net.
Max.
|
|
|
|
|
From a personnel point of view (and maybe project), i think i'm heading out to buy my first C# book.
Thanks for your advice Max
Matt G
|
|
|
|
|
I'm trying to interoperate with an external library (the C interface for K -- mentioned in the lounge a short while ago -- www.kx.com[^])
I've added the include statements, and added the .lib to the list of files to link with, however, I still get:
KdbTest1 error LNK2001: unresolved external symbol "int __cdecl cd(struct k0 *)" (?cd@@$$FYAHPAUk0@@@Z)
KdbTest1 error LNK2001: unresolved external symbol "struct k0 * __cdecl gi(int)" (?gi@@$$FYAPAUk0@@H@Z)
KdbTest1 error LNK2001: unresolved external symbol "struct k0 * __cdecl gnk(int,...)" (?gnk@@$$FYAPAUk0@@HZZ)
KdbTest1 error LNK2001: unresolved external symbol "struct k0 * __cdecl ksk(char *,struct k0 *)" (?ksk@@$$FYAPAUk0@@PADPAU1@@Z)
KdbTest1 fatal error LNK1120: 4 unresolved externals
I'm trying to build a small Managed C++ console application to try interoperability with Managed C++. All the files can be obtained from http://www.kx.com/a/k/connect/c/[^]
Any suggestions would be very much welcomed.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Paul Ingles wrote:
Any suggestions would be very much welcomed.
Ok, after a little looking I came across this[^] knowledge base article, however you may look into this[^] KB article as well, hope this points you in the right direction.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Q1-if a system is in loggoff state and i call
GetUserName(..).
is the function fails,and return value is zero?
and how did i know that the system is in loggoff state?
//////////////////////////////////////////////////////////
Q2-how i will trap the WlxDialogbox and where msgina asks for the userid,password
and fill in the fields by my self?
can any body help me in this regard?
//////////////////////////////////////////////////////////
Q3-how did i find the system32 path programatically?
//////////////////////////////////////////////////////////
Q4-if i call BlockInput(true)
and then i want to use postmessage or sendmessages for keyboard and mouse
will these messages works?
/////////////////////////////////////////////////////
r00d0034@yahoo.com
r00d0034@yahoo.com
|
|
|
|
|
I know I risk getting a huge flame but, what the heck its winter and I could use some heat to spice up my life...
I admit I have been out of it for a while, but I am struggling with the differences (benefits and analysis) between the different technologies out there. I understand and use Visual C++ (presumably unmanaged since my company doesn't want to spring for Visual Studio .Net or training... bahh). However I am seeing a lot of traffic on the managed C++ front. I am currently trying to catch up and learn the new technology (I had to buy Visual Studio.net for myself for Christmas...) and I was wondering, can anyone explain some things?
First what are the benefits for Manage C++ versus the regular C++? Things like speed, code usage, MFC usage vs. Win 32 usage, syntax? Also what is the difference between these and C#? Let's say I am writing a high performance application like a game, which of the three new language technologies are worth it: Unmanaged C++, Managed C++, or C#?
Second, how hard is it to convert over from my old unmanaged habits to the managed version? I am trying to decide whether it is worth making the change, even though I cannot do it where I work presumably...
I guess I could ask what other technologies are out there that I should concentrate on learning... I already want to learn XML (and yes I do not know it yet... ), but I figure I am going to get flamed enough.
I thank anyone for their help, and I am attempting to research it myself, but between working on finishing up the project that will keep 20 some people employed going in to the new year, deciding that I have had enough of training for international level Kung Fu competitions (my hips, knees, and shoulders really could use a warm winter not to mention they are they only keeping me awake while I work late into the night ), and dealing with these Christmas things such as buying presents.... I am sure everyone knows how it goes, but I could use the help focusing my learning and growing, not to mention actually understanding...
Thanks,
Brian
Now assembling the pyre... waiting for the first spark...
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
I do not flame others, so you'll have to get your heat elsewhere
Managed C++ is essentially an extension to the .Net framework stuff (the Common Language Runtime, etc.), in C++ syntax. It is possible to put regular C++ and MC++ in the same project (even the same file). MC++ exposes the same runtime library as all other CLR-based languages, such as C#. Thus, much of the difference between MC++ and C#, is that MC++ exposes the existence of pointers, and C# calls them "reference objects" and bypasses the pointer syntax.
Picking up C# with a C++ background is really easy, and even easier if you have experience with Java. Several new keywords, but most of the stuff is the same. I cannot call using MC++ really changing, as it's more adapting to using some CLR library objects in a familiar syntax. Any class you define as a __gc class, you can use CLR objects in. There is no MFC, ATL, or Win32 API directly in the CLR itself, though you can write wrapper declarations around external DLL functions, and call them from within any .Net code. The CLR is comprehensive, so you won't often have to anyway.
Performance wise, there is little difference between the CLR-base languages, though MC++ allows integration with regular C++, which Microsoft freely admits will remain the speed demon for many things. Well, COM objects still suffer weight problems and circular references, and traditional heap allocation is not as fast as .Net's garbage collected (GC) heap. .Net objects are lightweight and 'new' allocation is really fast, although low-level manipulation is harder with .Net. However, it is possible in C# (research the unsafe and fixed keywords), and MC++ has the best access, although pinning GC memory (keeping it from moving) has a slight penalty. Thus, MC++ has some advantages, but C# is the cleanest syntax.
Some main benefits to CLR-based stuff is rapid development, greater platform independence, a good GUI designer, a good security model, web integration, and the like. Considering such a wide scope, the performance is pretty good, but not higher performance overall than C++. The CLR languages do not replace C++, they are simply better suited to certain tasks and projects.
Naturally, I expect to be flamed as well. Anyone can find an excuse to argue. If every man who's been put on fire stays warm for the rest of his life, then call me Mr. Toasty...
Cheers
|
|
|
|
|
Jeff J wrote:
If every man who's been put on fire stays warm for the rest of his life, then call me Mr. Toasty...
lol!
But seriously, I am exploring the same origional question. Nicely put.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Thank you,
That was very imformative and very helpful. It gives me a good basis on what the differences are and where to start learning. I am very interested in picking up additional knowledge so I am glad people are willing to share, especially since nobody at work is available to discuss things with. The benefits of the very small company work place may be appealing but there are disadvantages to knowledge growth.
Anyway thanks again, I really appreciate it.
Brian
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
First off I would like to point out that Jeff did an excellent job covering the main jist of the languages, as you asked a very important question. Here are a few links to review that may help:
Here is a nice analysis between I whole slew of Microsoft languages, both managed and not:
A statistical analysis of the performance variations of assorted managed and unmanaged languages[^]
SanShou wrote:
which of the three new language technologies are worth it: Unmanaged C++, Managed C++, or C#?
SanShou wrote:
I already want to learn XML
The best way for me to answer this is to say that you don't have to particularly learn only one of the languages, they work together almost flawlessly. Take a look at my most recent article to point this out:
Cross Language Web Service Implementation[^]
Hope this helps.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Thanks.
Yes it did help. Those articles were very interesting and provided a good look in to the architecture and the speeds, not that most of my code is tightly looped for optimization myself, but it was defitinely enlightening. Of course I also need to read them more thorougly when I get a chance.
They also pointed to a few new buzz words and technologies I am going to have to reasearch such as ngen'd. However that is the fun in trying to catch up and learn new things...
Thanks,
Brian
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
SanShou wrote:
I am going to have to reasearch such as ngen'd
In short, when you load a application that was developed under .NET it has to take the MSIL and run it through the JIT compiler to produce native code in memory. This is typically very fast and you really don't notice it. However there are times when you can use the n'gen utility to run the .NET application through the JIT compiler and have it produce the native code which you can persist to disk. Once the application has been n'gened you will no longer have the JIT compiling taking place, that is essentially all you gain/lose. Hope this helps.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Im trying to create a Managed C++ object that will be accessible both from Managed Code, as well as through a standard COM interface. I have written the component and have no problems using it from JScript, so I moved on to attempting use through standard COM from Win32 App. When I export the type library from the assembly, it contains the definitions for the classes but not the interfaces?? For example if I built the following overly simplified managed code into an assembly
<br />
#include "stdafx.h"<br />
<br />
#using <mscorlib.dll><br />
<br />
using namespace System;<br />
using namespace System::Reflection;<br />
using namespace System::Runtime::InteropServices;<br />
<br />
[assembly:AssemblyKeyFileAttribute("ComponentTest.snk")];<br />
<br />
namespace TestNM<br />
{<br />
__gc __interface ITestComp<br />
{<br />
int GetNumber();<br />
void SetNumber(int num);<br />
};<br />
<br />
__gc public class MyTestComp : public ITestComp<br />
{<br />
public:<br />
MyTestComp() { m_iNumber = 0; }<br />
~MyTestComp() {};<br />
<br />
int GetNumber() {return m_iNumber; }<br />
void SetNumber(int num) { m_iNumber = num; }<br />
private:<br />
int m_iNumber;<br />
};<br />
}<br />
Then export the type library, and open with oleview, the definition of "ITestComp" interface is no where to be found, in fact it says MyTestComp is an interface??? Anyone have any ideas?
Thanks!
|
|
|
|
|
Hi tlemoine,
You are right because MyTestComp IS an interface too!, what you need to do is tell the type library exporter that it shouldn't create a type library section for MyTestComp .
You need to add the following attribute...
<ClassInterface(ClassInterfaceType.None)>
can't remember the exact syntax for MC++ though.
Regards,
Dark Angel
|
|
|
|
|
Here is the attribute again.... but visible this time
<ClassInterface(ClassInterfaceType.None)>
|
|
|
|
|
I have a class having overloaded friend operators
<br />
class FpDate<br />
{<br />
friend bool operator < (const FpDate & fpDate1,const FpDate & fpDate2 );<br />
friend bool operator <= (const FpDate & fpDate1,const FpDate & fpDate2 );<br />
friend bool operator == (const FpDate & fpDate1,const FpDate & fpDate2 );<br />
};<br />
<br />
bool operator <= (const FpDate & fpDate1,const FpDate & fpDate2 )<br />
{<br />
return ( (fpDate1 < fpDate2) || <br />
(fpDate1 == fpDate2)<br />
);<br />
}<br />
It is ginving compilation error for both < and == operator call in <= body(above)
What can be the problem?
Thank You
|
|
|
|
|
Could you please show us a sample of where you are calling those operators?
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
One call is there in the <= operator.
Other is
<br />
const FpDate& rFpDateOperand1<br />
= (GetDateEvaluationValue(uliRecordNumber,<br />
ComparisonExpression::OPERAND_LEFT_SIDE,0));<br />
<br />
const FpDate& rFpDateOperand2<br />
= (GetDateEvaluationValue(uliRecordNumber,<br />
ComparisonExpression::OPERAND_RIGHT_SIDE,0));<br />
return (rFpDateOperand1 > rFpDateOperand2);<br />
Thank You
|
|
|
|
|
I am trying to determine if there is any way other than calling Show(), to force the creation of a handle for a form (or any control, for that matter). I have tried calling CreateControl(), which the docs claim will force handle creation (I presume it wraps to CreateWindowEx()), but no dice.
I need to alter some things before the form becomes visible, which are not just initialisation parameters like text and styles. That is, call control methods which require a handle to exist.
No matter how many CPU cycles pass, CreateWindow() simply returns and no handle ever gets created. Anyone have suggestions?
RSVP
|
|
|
|
|
Have you tried NativeWindow.CreateHandle
Cheers
Kannan
|
|
|
|
|
Thanks Kannan, that was a great idea. I was able to use my form's CreateParams to create a handle with the method you posted. Unfortunately, there does not seem to be a viable way to get a CLR form to attach to the created handle as in MFC/ATL, so I'm left with a raw window without child controls, which knows nothing of CLR stuff.
However, while subclassing I realised I could access the protected CreateHandle(), so I created a public method to call it externally. That worked, however it does not force handle creation for any of the child controls (as CreateControl() is supposed to), so I would have to subclass every one to create them too!
This is an aggravating bug, since non-visible form creation is simple in C/C++, and CreateControl() is supposed to do this too. I remain open to further ideas, and will report this bug to Microsoft (though I'm sure they've heard this one before).
Cheers
|
|
|
|
|
Hi all. I'm a new C++ programmer. Wonder if anyone know how to draw a tree graph with C++? without calling packaged libraries.
|
|
|
|
|
Hello,
I can't change the small icon from the Main Form with the following code in my project:
this->Icon = new System::Drawing::Icon("SAVE.BMP");
With this pice of code i get the following exception error
Unhandled Exception: System.ArgumentException: The argument 'picture' must be a picture that can be used as a Icon.
The same picture is working perfect if i use it for a menubar icon.
Many thanks for a good anwser
Peter.
|
|
|
|
|