|
I'll give the suggestions a try. Thank you.
When I use the classwizard to create the onclick event, it put it in MainFrame:
void CMainFrame::OnToolsShpproperties()
{
CDLGShpFileBreakdown dlgSHPBreakdown;
dlgSHPBreakdown.DoModal();
}
Your code will still work?
|
|
|
|
|
no, it won´t work for sure. All is about getting the current view when creating the dialog. If you have the view, you have the doc with GetDocument(). From the dialog, you can get a pointer to the main frame with the method: GetParentFrame( ). Once you have the pointer to the frame, you can call its GetActiveView() method to get the current view. Thats all, i hope i have been usefull to you.
|
|
|
|
|
It's fine. I figured it out. In the past when I have added a command handler for a menu item, I have always just used the default in the drop down which is mainfrm. I removed that one, and selected my dialog in the list this time. It put the menu command handler in my document class this time, and all the data I want to display is in that class, so easy solution.
Thanks for all the help.
|
|
|
|
|
If the menu's handler function is in the view, try:
CDXtoXDView::OnMenuItem()
{
CDXtoXDDoc *pDoc = GetDocument();
CMyDialog dlg(pDoc->somedata);
dlg.DoModal();
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi there.
Yesterday i've got a problem with CButton and icons,
so i looked here in codeproject for a better Button class.
i found many great buttons here but the overview is really bad.
is there any button collection - or an ultimative button ?
i think many people got that - so , how you've solved that problem ?
greetings from austria - Tom
|
|
|
|
|
take the ones with the highest rating.
depending one what are your requirements for your buttons, it might be hard for me/us to tell you which one is the best.
Have you tried some of them ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yes i tried a few.
i hoped that peopled made a "All Buttons you need"-set.
at the moment i am planning to improve a nice button with the features of other buttons - make it easy to use and so on - if the authors let me.
what do you think about it ?
just RAM-wasting or a good tool if good implemented ?
greets
|
|
|
|
|
Here is one.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thx for the tipp.
look here (better Bitmap Button) its a improved Button as the one you have shown me ( i think) originaly by Joseph M. Newcomer, modificated by Jeff Mallett.
i saw your CRegionButton too, and a few others too.
any suggestions what buttons i should use ?
i am looking for a nice button suite or a all in one button, so i dont waste time for learning the wrong buttons.
greetz
|
|
|
|
|
Hi,
How to write some data from listcontrol to ".html" file using MFC.
Please answer this question.
|
|
|
|
|
|
Hi
Sorry for the confusing title, but i didn't have a clue how to summarize my question.
This is the situation:
I'm making a program which creates an exe (in memory), writing this exe to disk, and executing it from within the program (on another thread). The user then uses that program which was written to disk, and when he exists it he returns to the main program, and the exe gets deleted.
This is the problem:
I need to somehow protect the written exe from being read by another app. As i implemented it atm, you can just alt-tab out of the program (which was written to the disk, and executed from the main program) and copy the generated exe somewhere else. When alt-tabbing back to the program, and exiting it, the user has this exe which shouldn't be possible.
Solution?
Is there a way to protect the written exe so the user can't copy it to another location (or read it with some hex editor), but the OS can execute that same exe? I've tried different stuff already, but all without succes. The best would be i could execute the program from in-memory, but i don't think thats possible, right?
Thx in advance for any help.
|
|
|
|
|
Donny Tytgat wrote:
I'm making a program which creates an exe (in memory), writing this exe to disk...
Be sure to use a non-descriptive filename (e.g., GetTempFileName() ) instead of something obvious like mysupersecretprog.exe.
Donny Tytgat wrote:
The best would be i could execute the program from in-memory, but i don't think thats possible, right?
Yes, it's possible. There are a few examples available via Google. In summary, it involves knowledge of the PE file format.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The name of the exe isn't really important, the user can just use a taskmanager to retrieve what file is being executed (and its always in the same dir).
I searched a bit for the PE file format, and executing a file from memory but it all seems a bit "overkill" (work-wise) for what i'm trying to do (which is basically something to prevent cheating in a game). Dont wanna spend ages on something which can be cracked using some memory monitoring tool, just wanted to make it a bit harder on potential cheaters.
Anyways, thx for your answer David Crow. At least i know what the PE file format is now .
|
|
|
|
|
Hello
I want to develop a software in vc++ which takes character size more than 2 bytes.
It means I cannot use UNICODE .
What settings should I use in Visual Studio or how can I use character size more than 2 bytes ?
|
|
|
|
|
Is there any special case where u need more than 2 bytes to store character?
|
|
|
|
|
What language are you trying to store?
Unicode handles every language available on the planet (including Klingon, Vulcan and Welsh) with a lot of room left for new languages. So unless you have invented some new language, UNICODE will work.
What are you actually trying to do?
Neil
|
|
|
|
|
ok thanks
I thought that there might be a case where I have to handle more than 2 bytes size and the software should not fail.
anyways Is this possible or impossible ?
|
|
|
|
|
Answer is simply no. you cant do it in VC++ atleast, but you can always design your application to store more than 2 byte per char, but none of the windows api will be of any use coz they accept either ascii or unicode character set.
-prakash
|
|
|
|
|
The 32 bit versions of unicode handle everything. The 16 bit versions miss a lo. (mostly Asain languages where there are a different symbol for each word) Windows is mostly 16 bit unicode.
UCS-8 (which is common on unix) is variable size, IIRC it can use up to 6 bytes, or as little as 1.
|
|
|
|
|
are there any special reasons for that you could explain fully here ?
UNICODE provides 2 bytes per character, that allow you to have 65535 different characters in the same "set", which is large enough to represent all the characters of the world...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
hmmm - does it support those elven-characters from Lord of the Rings ?
|
|
|
|
|
Yes you can use unicode. However you cannot use the uncode functions built into windows, because they use UCS-2 which is only 16 bit.
I would typedef unsigned long to something like my_unicode_type, so that if you come up with something better latter you only need to change your type in one place. This depends though, if you are writting a class to wrap everything it might not be required.
|
|
|
|
|
I use Teradata database.
Teradata has a SQL Statement :show table mytable;
This statement can return the definition of mytable.
But CRecordset class cann't run this SQL.
CDatabase can do it,but CDatabase.ExecuteSQL function has no return .
strSQL = "Show table mytable;";
set.Open(CRecordset::forwardOnly,(LPCTSTR)strSQL,CRecordset::none);//Error !
database.ExecuteSQL(strSQL);//OK,but how can I get the result?
How can I run this SQL and get the result?
Thanks.
|
|
|
|
|
willyfu wrote:
How can I run this SQL and get the result?
Getting the results from a stored procedure is not that difficult. One way of doing it is shown in MSDN article Q183001.
Here is another.
Here is a helpful discussion.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|