|
Hope this[^] will help you.
Regards,
Paresh.
|
|
|
|
|
I understand that this question may be overheard here and there are huge amount of articles explaining it but for someone that has not used registry like me and want a very simple task it is only more confusing. I only want to save the directory of program installation in registry during installation and read it at the begining of my MFC program. I searched articles on this site and amount of articles was overwhelming and really confusing, I absolutely do not want to use a prewritten class something that I don't know how it works internally. Are there a simple API or similar function to reterive a key. I also interested in CRegKey from ATL. Can this class solve my problem?
Thanks.
|
|
|
|
|
Electronic75 wrote: Are there a simple API or similar function to reterive a key.
Try RegOpenKeyEx() and RegQueryValueEx() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Bingo!
Thanks alot.
|
|
|
|
|
|
How can i get all Interfaces, MACs and IPs on my machine ?
How can i list open TC/UDP ports and services connected to these ?
Thank you very much
|
|
|
|
|
Does this help?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is possible to avoid that a program executes from our own application?
An example:
I'm running my app and I don't want to let notepad.exe to execute.
Is this possible?
Thanks in advance.
Dr.Pi
|
|
|
|
|
doctorpi wrote: I'm running my app and I don't want to let notepad.exe to execute.
Just out of curiosity, why?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i'm not sure to understand well :
doctorpi wrote: It is possible to avoid that a program executes from our own application?
just don't call it !
why would it open otherwise ?
|
|
|
|
|
Can you explain why you dont want?
|
|
|
|
|
The question is that 2 programs are really time consuming exigents.
The point is don't let the user execute both at the same time.
Then , if one is running don't let run the other and viceversa.
Dr.Pi
|
|
|
|
|
hi all,
i m using spamassassin to filter my mails as spam or not, but i m unable to execute spamassassin.exe,it works fine when i call that exe from DOS(command prompt)with same commandline argument, here is the code i m using,
C++
HINSTANCE hins =::ShellExecute(NULL,"open","F:/sa/spamassassin.exe","<F:/spam.txt> F:/spamT.txt",NULL,SW_HIDE); in this situation exe invoke and then disappear without executing as i seen tha through task manager, when i call above line of code behind a button then process increases in task manager and then it decreases, without full execution.
here is the command which i paste on DOS and works fine,
any idea.
C:\Documents and Settings\tasleemarif>F:/sa/spamassassin.exe <F:/spam.txt> F:/spamT.txt"
i have also tried that using C++ spawn functions as well but did not work too. any idea r any person can guide me how had worked on spamassisn.
Regards.
Tasleem Arif
|
|
|
|
|
The code you've shown seems fine. Temporarily change SW_HIDE to SW_SHOW . Does that produce any windows?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i tried that as well but did no show any window,it did worked with this code,but cannot hide console this time,it pops up
char* cmd = const_cast<char*>("F:/sa/spamassassin.exe <F:/spam.txt> F:/spamT.txt");<br />
system(cmd);<br />
Regards.
Tasleem Arif
|
|
|
|
|
What does this do:
ShellExecute(NULL, _T("open"), _T("c:\\windows\\system32\\notepad.exe"), _T("c:\\boot.ini"), NULL, SW_SHOW);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it shows notepad.
Regards.
Tasleem Arif
|
|
|
|
|
Ok, so what happens if you change the third and fourth arguments?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I'm facing an annoying problem while using a list control.
In my project,I have a list control which I need to update every 250msec(the list of items is
a dynamic list).
In order to update the list control, I delete all of the items in the list control and insert the new items to the list.
As a result,the list control is blinking.
I'm using the following peace of code
m_list.SetRedraw(FALSE);
m_list.deleteAllItems();
for(int nIndex = 0 ; nIndex < ItemsList.GetSize() ; nIndex++)
{
m_list.InsertItem(nIndex , _T(""));
m_list.SetItem(nIndex , 0 , ItemsList.RemoveHead().GetName());
m_list.SetItem(nIndex , 0 , ItemsList.RemoveHead().GetIP());
}
m_list.SetRedraw(TRUE);
I tried to pdause LockWindowUpdate() and UnlockWindowUpdate() instead of SetRedraw()
but the items continue to blink.
Is there a better way to update the list without blinking???
HELP!!!!!
With bes regards,
Eli
|
|
|
|
|
Hello,
Maybe you need to create a method that compares and changes only what needs to change.
This soluction will gibe you problems if the number of items incrise.
populating ListCtrls and ListBoxes are expensive, and will be very slow if the number of item incrise.
|
|
|
|
|
As Max mentioned, populating list view controls is expensive.
Even more so the way you are adding items - 3 updates for each item.
If you use a "virtual list-view" (one that has the LVS_OWNERDATA style) then you can store each
item's info in a collection of some kind and do all your processing in the background.
The only time the list view has to change is when items are added or removed (so the total number
of items in the control is always the same as the number of items in the collection).
After each update of the contents, just a repaint of the control would be necessary.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
Mark Salsbery wrote: If you use a "virtual list-view" (one that has the LVS_OWNERDATA style) then you can store each
item's info in a collection of some kind and do all your processing in the background.
In order to do so,I need to search if the current items in the collection exists in the list ctrl,and this is not something that we want to do(we don't
want that the list control will have to know what kind of items it "holds"...).
Anyway,Thanks for your reply,
With best regards,
Eli
|
|
|
|
|
eli15021979 wrote: (we don't
want that the list control will have to know what kind of items it "holds"...).
I'm not sure you understood what I meant.
In a virtual list control, you store everything about the items somewhere else. The control
keeps index and state information only. When the control needs to draw it sends a notification
requesting the text for each item and subitem. From the looks of your sample code, you already
have that information in a list container, so there's no reason to store it in the control as well
(like you are doing now).
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi all,
I'm using the "CIniFile Class for C++ - A robust cross platform INI file class" wrote by Todd Davis and it's working and all but for some or other reason I keep getting garbage in the ini file. For example:
ç[TEST]
ÿMyKey=MyValue
Can anyone help ??
Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Can anyone help ??
Doubtful, since you've not provided anything useful.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|