|
misugi wrote: Anyone has any idea on how I can capture this CPoint with coordinates with respect to my viewport?
Have you seen ScreenToClient() and ClientToScreen() ?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Yepz seen ScreenToClient() but from the documentation on MSDN i'm under the impression it doesn;t do the job. I'm pretty weak when it comes to playing around with device context, but maybe a scenario can paint my question clearer.
Assuming I have a static control frame for which i do my painting in. So i configured the viewport origin to be the centre of this frame. So when i captured a left button click when the user click within this frame, assuming the centre of the frame, I am wondering if there is any way to return 0,0 as the point.
I am under the impression that OnLButtonDown already return me the CPoint with respect to the client area of my dialog after running a few trys. So ClientToScreen shouldn't be what I'm looking for, as I'm interested in coordinates with respect to the centre of my frame.
I hope this lengthy post doesn't complicate things. And sorry to anyone who got confused by me. =)
|
|
|
|
|
Are you simply wanting to know where, inside of the static control, the left mouse button was clicked?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Have a look at DPtoLP(). This will translate from device points to logical points (logical points are points relative to your mapping mode, origin, etc.).
onwards and upwards...
|
|
|
|
|
Hi,
Try to set centre of ur frame as viewport origin.
SetViewportOrg() might help you.
Thanks and Regards,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Hmm...DPtoLP...i nv knew it exists. I'll go try it out. And thanks to everyone for their suggestions! Really appreciate it! ^^
|
|
|
|
|
Dear ALL!,
and Happy New Year 2006!
I am writing you from Switzerland and despite the fact that I have been looking in literature about C++ and on line forums, it remains a problem that I would submit to you. I would be grateful of your help. I am far away from being an expert but indeed today ( I mean since days I am blocked by this ! )
I have to manage a project in C++ which is pretty well working and dealing with stocks of the company I work with ( import/export of mineral water and dispatching stocks).
My project is within a folder: folder00 [ let's call it so]
all *.cpp, *.h files...etc...
I have to modify only one *.h file
and one *.cpp file.
hd01.h
blo1.cp
==> for hd01.h, I have to modify line 5 to 22
and replace the block of numbers by a new block of numbers in a worpad file wpd01.rtf
==> same for blo1.cp [line 58 to 72] with wpd02.rtf
The path of each file is stable
How can I proceed from an external C++ executable file [ let's call it external.cpp]?
And how can I automatically rebuilt the project? From external.cpp too?
Thanks a lot,
Greetings,
TPP
|
|
|
|
|
so basically you just want to build the project from the command line rite?
if yes check nmake.exe and how u can use it, you will need to export a makefile from ur project.
-Prakash
|
|
|
|
|
Hello,
No, in fact there is a project that I can compile, rebuild, link...in Visual C++ 6.0
The name of this project is Proj001 and located in folder \projtpp
But it uses a *.h file that I want to update several times a day because it contains new data inside.
the problem is: how can I build up a new project ( only based on one *.cpp file) that compile , rebuild and execute automatically Proj001?
Thanks a lot,
P
|
|
|
|
|
thierrypp wrote: I want to update several times a day because it contains new data inside.
Why store data directly inside of your application? Your app should be getting that data from a data source, a simple flat text file or database would suffice. Doing so would eliminate the need to recompile so often.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hi,
No, in fact it contains secure keys to update frequently.
That is why the less I display the best is the security.
But let's say, ok I can manually change data within the *h and *cpp file.
Then if I have previously built up a makefile called "filesecure"
how can I rebuild all until have a new executable file?
I am working with Visual C++ 6.0
Best Regards
|
|
|
|
|
Still makes no difference, hiding that data inside of the binary is still no different than hiding it in plain sight. Remember if its human readable even when its in the binary its still human readable. It would much more secure to look at a different approach to your security.
Building at the command line is done via nmake, this is the easiest way to do an auto build. MSDN Link Building on the Command Line[^]
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
There is an option in VS6 to create make files for you. I dont remember off the top of my head where the option is. But use it to create your first make file. Other wise here is an example from the MSDN.
Sample Makefile[^]
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Yes I made one called
FileSecure.MAK
but now from a complete directory, how to manage this from windows XP?
On MSDN, it is well explained, thank you,
but to be practical.....
How to launch this Filesecure.Mak from C:\sptp folder?
and my project FileSecure is located in an other path#
|
|
|
|
|
I'm just guessing here as I have never had to use NMAKE (I just know it’s a tool available and part of VS, there are better Automated building applications out on the internet). You probably have to supply the full qualified path to all of the files within the NMAKE file. Or it looks like there is an option to supply file paths as part of the NMAKE command.
Running NMAKE[^]
NMAKE Options[^]
Running NMAKE is done via the command line; you could even create a batch file with the necessary options / commands to simplify it even further.
Lastly I still urge you to consider an alterative to your current security set up, remember that your “key” is still visible in the binary and in the header and is plainly visible to everyone (sorry I just to had to say it)
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
I have some code that is written in C# that I'd like to somehow integrate into one of our Win32 API C/C++ applications. Is it possible to call the C# code in any way...through a DLL, or something?
We'd rather not have the API code app spawn a process that has the C# app, which is the only solution we can think up.
Thanks,
|
|
|
|
|
|
Perfect! Just what I was looking for, and of course the answer was on The Code Project website.
Thanks
|
|
|
|
|
I have been asked to investigate the possibility of writing a "virtual printer driver", so that we can distribute to our customers to enable them to print-to from any third-party software and allow us to generate an XML file output with text and some "information" about some graphics!
If anyone can direct me towards either some URL's or books etc, that can assist in the development of printer drivers I would be very appeciative of them Any advise on the matter would also be appreciated, especially if you have written printer drivers before.
|
|
|
|
|
Do you know FreePDF? It is a virtual printer driver for PDF. Probably the author of this driver can help you.
http://freepdfxp.de/fpx732.htm
Good luck.
Philipp Grohs
|
|
|
|
|
Using the MS DataGrid in two different dialogs but in the same parent dialog
I get the following error
:\library\librarian\datagrid.h(13) : error C2011: 'CDataGrid' : 'class' type redefinition
What should i do to solve this problem ?
Check the following :
In the main parent dialog with the name Properties.h i include the
#include "BookNewDonator.h"
#include "BookNewSupplier.h"
which each of them has a DataGrid member in their classes and of course they include the
"datagrid.h"
What sould i do ?
sdancer75
|
|
|
|
|
Add
#pragma once
to the top of datagrid.h
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Use preprossor if condition to check datagrid.h file included already or not.
mean you have to write the datagrid.h codes inside the #define directive.
Example..
#if !defined(DATAGRID_H__INCLUDED_)
#define DATAGRID_H__INCLUDED_
......
#endif // DATAGRID_H__INCLUDED_
regards
Vallikumar A
|
|
|
|
|
The #pragma once solved the error !
Thank you !
sdancer75
|
|
|
|
|
My application writes the avi-files using the VFW Windows API-calls.
But the problem I encounter now is the size limit of the avifile using VFW. I understand that using DirectShow instead of VFW solves this problem. But DirectShow is quite new to me.
Could anybody give me some hints how to use DirectShow for writing avifiles? (Using interfaces like IGraphBuilder?)
I am looking for a DirectShow-function that is a equivalent for AVIStreamWrite. At this function it is possible to present a data pointer. I have been looking in the DirectShow-documentation but I cannot find a function to which I can present a data pointer from a bitmap/frame.
|
|
|
|