|
Was that a question ??
If you want to develop MFC apps, you'll need to buy the Enterprise edition.
|
|
|
|
|
Cedric Moonen wrote: If you want to develop MFC apps, you'll need to buy the Enterprise edition.
You share the same opinion as this guy.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry David, I don't get you...
|
|
|
|
|
It was a link back to your comment to the same guy telling him that VS Express does not include MFC.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
So what you're saying is the Express edition doesn't include MFC?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's the rumor that Cedric is attempting to spread. I wish he'd stop that. Edifying others is just so wrong.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is not a rumor. VC 2005 express edition does not include MFC. It is a fact, not an opinion.
|
|
|
|
|
Actually, you'll need to buy any edition....Express doesn't come with MFC.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i want to realize a ruler in a picture controls, the ruler can move by the mouse or direction key.
In a dialog box, the picture control has sevelar curves, i want to get the point of intersection with the ruler and the curve. Help!
|
|
|
|
|
You should have the coordinates/equation that defines de curve, you also have mx+n that define the line of your rule.
Using the mouse messages (OnMouseClick, OnMouseMove...) resolve the mathematic system of both equations, if you get a solution in the limits of the project, you have an intersection, if not solution is possible or gives a solution outside the limits there is no intersection in you screen.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
But how can i realize the ruler, like the Slider control?
Thanks.
|
|
|
|
|
why a ruler? Is not enough with a line?
If you make something with "big dimensions" where is going to be the interception point? At the top? at the middle? at the bottom?
Anyways, If you want it to be similar to the Slider Control, why don't derive a class from it and modify it in your own way?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
You are right. It's enough with a line.
|
|
|
|
|
Is it possible to either lock an executable file that is running so that it cannot be copied or, better still, to delete the disk copy of the executable file whilst it is running? The executable would not need to self delete, rather it would be deleted by a parent program that ran it using, say, CreateProcess(). This would need to work on W2K, XP and Vista.
Thanks
|
|
|
|
|
You would be better off using a licensing or dongle mechanism to keep people from pirating your software.
|
|
|
|
|
led mike wrote: You would be better off using a licensing or dongle mechanism to keep people from pirating your software.
Thanks. Of course you are right but I am not free to use that approach in this instance.
|
|
|
|
|
I want to add Fancy Looking, Buttons to my existing Windows form. The new Buttons should be Re-incarnation of original Windows Style buttons except they should have completely new look. There functionality should be the same as original buttons.
Please tell me the full procedure to accomplish the goal.
Thanks
Kunal Bajpai
|
|
|
|
|
hi...
how can i convert CString to TCHAR & CHAR to CString
paulraj
|
|
|
|
|
For Converting CString to TCHAR Use Following:
CString str;<br />
str = "Manish";<br />
TCHAR *tch = new TCHAR[10];<br />
tch = str.GetBuffer();
Now tch will contain Manish.
And for CHAR to CString Use Following:
char *ch;<br />
<br />
ch = new char[10];<br />
<br />
ch = "Manish";<br />
CString str(ch);
It will Work for you.
Manish Patel.
|
|
|
|
|
thank you. it is working now.
paulraj
|
|
|
|
|
Manish_mnp wrote: tch = str.GetBuffer();
NO !!!!!
GetBuffer() is not designed to cast a CString to a C-Style String but to access its internal buffer directly. very badly used then.
Moreover, when you use it, you have to call ReleaseBuffer() then, which you don't do here.
if you only need to cast the Cstring, use the cast operators it provides : (LPCTSTR) for instance...
there are other design issues in your code:
Manish_mnp wrote: CString str;
str = "Manish";
you should prefer declare with using the _T() macro, because if the UNICODE macro is defined, you force the CString to be initialized with an ANSI string, not multi byte.
Manish_mnp wrote: new TCHAR[10];
never new something without releasing its memory with delete !! you're leading to memory lacks, which is simply not acceptable.
Manish_mnp wrote: char ch = "Manish";
CString str(ch);
here too, you have a problem because you're assuming the state of the UNICODE macro.
you'd better have to write :
TCHAR ch = _T("Manish");
CString str(ch);
|
|
|
|
|
If I dont use new then how can i initialize char array of any size at run time.
I want to do something like this:
char *str = new char[n];
Here n can be vary at runtime.
So tell me how can i do this without new
Manish Patel
|
|
|
|
|
you seem to be a bit confused. Let me explain you some things then.
When you need a string which size may vary, of course, you have no other way than dynamically allocate the buffer (through malloc() in C, or new /new[] in C++). if your need is purely for a string, then i'd suggest you to use std::string at first by the way.
anyway, let's assume here that we must use new explicitely.
here is how to allocate the buffer, and then how we set a string in it :
TCHAR* str = new TCHAR[n];
::_tcsncpy_s(str, n, _T("Hello World"), n);
as you can see, i allocate the memory before using it.
Here is what you did. check the codes below :
Your Code :
CString str;
str = "Manish";
TCHAR *tch = new TCHAR[10];
tch = str.GetBuffer();
How you should have done it:
CString str = _T("Manish");
TCHAR* tch = new TCHAR[10];
::_tcsncpy_s(tch, 10, (LPCTSTR)str, 10);
See the differences step by step:
1- you first allocate a 10 TCHAR buffer on the stack (with the new TCHAR[10] statement).
2- the address of that memory freshly allocated is stored into the tch variable
3- you then get the address of the internal buffer of the CString object (str ) with GetBuffer()
4- you store the address of that internal buffer into the tch variable. by doing this, you overwrite the address allocate in the step 1- .
this leads into 2 falls. not only you loose the memory allocate with new, but you will never be able to release the memory that allocated.
and worst, if you make a delete[] tch , you're not going to free the memory allocated in step 1-, but you're going to delete the CString's internal buffer !!!
so, to fix this, you have to know and remember that we never assign a C-Style string using the = operator. you must use the strcpy() derived functions.
But of course, if you can use std::string class instead of char* strings, it's even better...
do you understand better now ?
|
|
|
|
|
|
Altough I had nothing to do with this question... nice explanation, thanks
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|