|
Actually, I am sure you can display 4000 x 4000 table of characters in a custom CScrollView-derived view faster than CListCtrl with 4000 columns would.
The trick is to only paint what you have to.
-----------------------------
Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
|
|
|
|
|
Use a virtual list control. Rather than loading all the rows when the list is created you just load the columns assoicated with the rows that are displayed. You recieve "scrolling" messages, (both up and down), that tell you when additional row data is required.
Just look up "virtual list control" in your MSDN documentation.
Or check out some of these articles.
Code Guru article[^]
MSDN Article[^]
Other Article[^]
Sam
|
|
|
|
|
hello,
i added a resource to my project (it's a file .exe), i wrote this code:
HMODULE hModule=NULL;
LPCTSTR lpName="IDR_RT_RCDATA1";//the ID of the resource
//LPCTSTR lpName=MAKEINTRESOURCE(IDR_RT_RCDATA1);
LPCTSTR lpType="RT_RCDATA";
HRSRC x=FindResource(hModule,lpName,lpType);
LoadResource(hModule,x);
but the file .exe haven't been executed.
i don"t want to copy the file in the harddisk because i don't want that the user can access directly to it.
thank you
|
|
|
|
|
chedly_ensi wrote:
i don"t want to copy the file in the harddisk because i don't want that the user can access directly to it.
This has been asked many timesd before. I do not know of a way to run a program from any place other than disk. What about saving the file to a temporary folder using a temporary name? That way it will not be as obvious as to what you are doing.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
but if i save the file to a temporary folder using a temporary name, it will be acccessible easily, there is not another way to protect this file execpt using resources?
thank you for your help
|
|
|
|
|
chedly_ensi wrote:
but if i save the file to a temporary folder using a temporary name, it will be acccessible easily...
"Easily" is a very subjective term. If done correctly, a person would have to know ahead of time the folder and file name used in order to know what your program is even doing. Unless you did something obvious like name the file thisismyfile.exe and put it in the root or system32 folder, the majority of people using the program won't have a clue, or even care.
chedly_ensi wrote:
...there is not another way to protect this file execpt using resources?
What/who are you protecting the file from? Having a file embedded within another's resource area does not protect it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hello,
ok, but after executing this file in a temporary folder, i want to destroy it, how can i do this even if its execution was aborted suddenly.
thank you
|
|
|
|
|
Use CreateProcess() or ShellExecuteEx() to start the program. Then use WaitForSingleObject() to wait for its completion. At that point, you can remove the file.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Well a have a new quastian!
is it possible to check if you are aboute to install a new program
on your computer and if how?. I need to do this in a MFC app.
Please help me...
|
|
|
|
|
Do you mean is it possible for one application to tell if another application is going to "install a new program?" In short, no. Copying files, updating/changing registry entries, etc are such common events that it would be impossible to know the difference between an install program doing it and a non-install program doing it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Ok,
But if that is the case, How can it be able to disable a user to install a program if you only are a user? What if the different?. If you only are a user you must still check if you are about to install a new program or?
Is there not a way to check if you are about to install a program or are about to download a program from internet?.
|
|
|
|
|
Larsson wrote:
...disable a user to install a program if you only are a user?
What do you mean by this? Are you trying to run an installation program as a "user" but it is not letting you? Please elaborate.
Larsson wrote:
Is there not a way to check if you are about to install a program...
No, because as far as the OS is concerned, a program is being started, period. What that program does is no different than what any other program does.
Larsson wrote:
Is there not a way to check if you are...about to download a program from internet?.
Possibly, but I am not an expert in networking protocols so I can't say for sure.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No im not trying to install any program as a user but if you only have a basic user account you cant install new sofware.
So there should be a check if you are a basic user if you are about to install any program so if that is the case you should be able to check if you are trying to install a new program.
Well this is what I want to do!...
If you are about to install a new program or trying to download something I want to check it so I can aprove it.
And I don't want to change so the user's become basic users.
It seems like I have a big problem if you not are able to check if you are about to install a new program.
I hope you anderstand what I meen!)
\Larsson
|
|
|
|
|
Larsson wrote:
...if you only have a basic user account you cant install new sofware.
Only because the account on the domain, or a group on the domain to which the account belongs, has been set up that way. But just because you are a "basic user" does not also mean you can't install new software. They are mutually exclusive things.
Larsson wrote:
If you are about to install a new program or trying to download something I want to check it so I can aprove it.
So is your program some sort of background process or a service of some kind that just sits around and monitors stuff?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Ok say theres a tree like this:
US
Virgina
Richmond
Danvile
NC
Raliegh
Durham
How would I write the function so that if I were trying to find if the NC item existed under the US parent?
Heres my attemt, obviously falled, but CTreeCtrls are not my strength:
HTREEITEM IsItemInTree(CString m_strText, HTREEITEM hElement)
{
//Variables
//Date: 8 2 04
HTREEITEM hNextItem=hElement;
while (m_cHistoryTree.GetNextItem(hNextItem,TVGN_NEXT)!=NULL)
{
hNextItem=m_cHistoryTree.GetNextItem(hNextItem, TVGN_NEXT);
MessageBox(m_cHistoryTree.GetItemText(hNextItem));
if (m_cHistoryTree.GetItemText(hNextItem)==m_strText)
{
MessageBox("it exists");
return hNextItem;
}
}
return NULL;
}
returns null everytime
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
TVGN_NEXT is to get the next sibling item. Somewhere in the loop you want to use TVGN_CHILD to get the first child item.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Is that in the first go through of the while loop?
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
This untested code should go through the tree, starting at the supplied HTREEITEM, looking for the first occurance of the text.
HTREEITEM MyTree::FindItem (CString text, HTREEITEM start)
{
HTREEITEM child = NULL;
while (start && GetItemText(start) != text)
{
child = GetChildItem(start);
while (child && GetItemText(child) != text)
{
child = FindItem(text, child);
if (!child)
child = GetNextSiblingItem(child);
}
if (child)
break;
start = GetNextSiblingItem(start);
}
if (GetItemText(start) == text)
return start;
return child;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there,
I would like to know how a derived class from CEdit can receive command notifications directly? By directly I mean without having to be listening to messages in the parent window.
Can someone please drop me a line?
Thanks,
David
|
|
|
|
|
Check out the ON_CONTROL_REFLECT and ON_CONTROL_REFLECT_EX macros.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Ohhh! Thanks for the reply PJ! I was beginning to feel desperate...
So it is true then... the stupid commands are sent to the parent window and cannot be listened anyother way, can they?
Can I also ask: how can I make my CEdit -derived class know when the content (the input text) of the control has changed? Is there a better way of knowing this without having to use message_reflection techniques?
Again, thanks a million!!
David
|
|
|
|
|
If you want the your control class to handle it's own messages then you have to use message reflection.
dNimrod#X wrote:
how can I make my CEdit-derived class know when the content (the input text) of the control has changed? Is there a better way of knowing this without having to use message_reflection techniques?
No, you have to use message reflection. Handle either the reflected EN_UPDATE or EN_CHANGE message to handle text changes in your edit control.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks a lot PJ!!
You have been very helpful indeed!
dNimrod#X
________________________
|
|
|
|
|
Is it possible to check if something is downloding from internet?
I Need to check from my MFC App if somthing is downloding from internet.
Please help me someone.
\Larsson
|
|
|
|