|
Now I'm quite confident you are right.
Veni, vidi, vici.
|
|
|
|
|
I hope your confidence is not misplaced.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
The Text parameter you pass to fprintf() is a CString object, and and the %s format specifier expects a (const char*) or (char*) there. Instead of this you are pushing the whole CString object to the stack and the first 4 bytes of that CString instance are used as a (const char*). You have to convert the CString to either (const char*) or (char*) before using it with fprintf() . A more strict compiler like g++ would warn you about passing a non-pod object to a vararg function.
|
|
|
|
|
Are you building your project with "Use Unicode Character Set" or "Use Multi-Byte Character Set" character set. Change it to "Not Set"
Other alternative would be to use string instead of CString.
or like this with the above options set:
FILE *fptr;
CString Text;
Text = "asdasdasdasd";
fptr = _wfopen (_T("D:\\Test.txt"),_T("w+"));
if(fptr== NULL)
exit(1);
fwprintf(fptr,_T("%s"),Text);
fclose(fptr);
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
I'm experimenting with creating my first COM class. I named the class ComClass when I used the wizard to add a simple ATL object to my MFC DLL that has ATL support.
The problem is that the generated header file for my class has this line in it:
#include "ComClass_i.h"
The named file does not exist in my project directory. I assume it was supposed to be generated when I created the class.
What did I do wrong?
SOLUTION:
It turns out that the missing file gets automatically generated when you build the project! So all I had to do was build it, and the file was created.
The difficult we do right away...
...the impossible takes slightly longer.
modified 23-Aug-12 14:07pm.
|
|
|
|
|
Hi,
I just got an error converting a VS 2008 project to 2010
"Can not view XML input using XSL style sheet Please correct the error and click the
refresh button or try again Later
Can anyone help
Thanks
|
|
|
|
|
And how is this a C++ question? Please make an effort to use the correct forum for your questions.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I looked around and couldn't find an appropriate forum
|
|
|
|
|
You couldn't find this one[^]?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Sorry u right I was looking in the wrong place
Thanks
|
|
|
|
|
Why are all posts expanded now by default?
It is so ugly and I can see nothing except “HOW TO ANSWER A QUESTION”.
Could you change it to previous style? Or I have to leave.
.
|
|
|
|
|
The forum is the same as it's always been. Did you try clearing your cache?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Kidding!
Veni, vidi, vici.
|
|
|
|
|
Check the "Layout" drop down above the messages.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
HI,
I have a application similar to auto cad, in which we can draw line, circle, etc in client area using mouse or command.
Now i need to add a feature, so that the users of this application should be able to pan their drawings in client area using mouse left button. (like one in auto cad or pdf reader). I can use win32 API or MFC to achieve this.
It well be great of some one can help me in this regard, with some sample code.
Thanks in Advance
|
|
|
|
|
You just need to add code to your mouse handler to capture the amount of movement and use that information to adjust a variable which tells your program how far to the left or right the window should be moved. Then call InvalidateRect() [^] to tell the system that your window needs repainting. In your OnPaint() handler you use the stored variable to repaint that part of your data that falls within the physical window.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
ok, after getting x and y coordinates which API should I use to reset the x and y coordinates?
Thank you.
|
|
|
|
|
Member 9353776 wrote: after getting x and y coordinates which API should I use to reset the x and y coordinates? What do you mean by this? As I said in my reply, your program needs to capture the mouse movement and adjust the x and y values by the number of pixels moved. In your OnPaint() function you will be copying some part of your image onto the application's window. I assume the image (drawing) is larger than the window on which it is being drawn, so you just select the top left point from which to start based on the x and y values previously captured.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
You may also like to read this section of the GDI reference[^], which helps to visualise how this sort of problem can be addressed.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
We can achieve this. Please understand the below simple concept with respect to CAD or any drafting utility. We have 2 view perspective always.
1. the world window
2. the view port window. (this is what you need to add in your program)
The above can be best understood with the this example: Assume you are taking photograph of a flower in a park. Now, we focus only the flower in the view finder of your camera, and the park in this case forms the world around the flower. So in this case the park becomes the world window and the flower becomes the view window.
Similarly the whole drawing in your application is the world window whereas the part of the drawing that is shown to the end user is the view window. You have to make use of the SetViewportOrg method in your application. Please read this http://msdn.microsoft.com/en-us/library/46t66w7t.aspx[^]. Let me know if you need more help, I have done this before but unfortunately cannot find the source for it...
Sunil
|
|
|
|
|
sunilkpv wrote: the park becomes the world window and the flower becomes the view window. Nice analogy,
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Hi Sunil,
Thank you very much for your information.
It will be a great help if you can help me with sample code.
-Maha
|
|
|
|
|
On the lookout for the code I had developed. Will send it ASAP
Sunil
|
|
|
|