c++ in visual express 2010
-
Are you familiar with the
_findfirst()
/_findnext()
pair?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
i'm not familiar with findfirst stuff. Can you please elaborate? I was trying to use boost libs.
-
i'm not familiar with findfirst stuff. Can you please elaborate? I was trying to use boost libs.
See here. Examples on the Net and here at CP are almost limitless. If you are looking specifically for "installed" programs (rather than just any and all exe files), you could use WMI with the
Win32_Product
class. It's a tad more code, however, with all of theCOM
involved."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
See here. Examples on the Net and here at CP are almost limitless. If you are looking specifically for "installed" programs (rather than just any and all exe files), you could use WMI with the
Win32_Product
class. It's a tad more code, however, with all of theCOM
involved."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
no, I'm don't want to use pre-developed apps. btw, I'm trying to dev the following, but till now no success. small utility - no GUI. cfgdump.exe 1) needs to search drive and find where an exe has been installed (customer can install it in multiple places). 2) goes to directory and confirms existence of some files. 3) runs some commands through a spawned process 4) the commands from item 3 will produce a file. 5) you will need to zip up the contents of the file using https://code.google.com/p/miniz/ library 6) Ask the user for a password 7) encrypt the file using http://www.cryptopp.com/ library File needs to be statically linked and highly portable.
-
no, I'm don't want to use pre-developed apps. btw, I'm trying to dev the following, but till now no success. small utility - no GUI. cfgdump.exe 1) needs to search drive and find where an exe has been installed (customer can install it in multiple places). 2) goes to directory and confirms existence of some files. 3) runs some commands through a spawned process 4) the commands from item 3 will produce a file. 5) you will need to zip up the contents of the file using https://code.google.com/p/miniz/ library 6) Ask the user for a password 7) encrypt the file using http://www.cryptopp.com/ library File needs to be statically linked and highly portable.
Member 11735037 wrote:
- needs to search drive and find where an exe has been installed (customer can install it in multiple places).
So you are looking specifically for "installed" programs, yes? Of the eight steps you mention, what do you have done? You've at least started, haven't you? I shared an example for iterating files and folders here. It does not do anything useful, so you'll need to fill in the blanks with your specifics.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Are you familiar with the
_findfirst()
/_findnext()
pair?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
I'm getting more and more confused. From the morning, I'm reading about boost libraries and then something else. I haven't started coding yet. But, I do want to start as soon as possible.
-
I'm getting more and more confused. From the morning, I'm reading about boost libraries and then something else. I haven't started coding yet. But, I do want to start as soon as possible.
Member 11735037 wrote:
From the morning, I'm reading about boost libraries...
So I assume you saw this? It's not an isolated example.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Are you familiar with the
_findfirst()
/_findnext()
pair?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
when I compiled that, there are hell lot more errors than one can expect. 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(7): error C2059: syntax error : '(' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2065: 'WIN32_FIND_DATA' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2146: syntax error : missing ';' before identifier 'data' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'HANDLE' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2146: syntax error : missing ';' before identifier 'h' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'h' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C3861: 'FindFirstFile': identifier not found 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(13): error C2065: 'h' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(13): error C2065: 'INVALID_HANDLE_VALUE' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(17): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(17): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(18): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(18): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(19): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(19): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\vi
-
Member 11735037 wrote:
From the morning, I'm reading about boost libraries...
So I assume you saw this? It's not an isolated example.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
now there is only one error....
1>------ Build started: Project: cfgdump, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_58.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== -
now there is only one error....
1>------ Build started: Project: cfgdump, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_58.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========Does
libboost_filesystem-vc100-mt-gd-1_58.lib
exist on your machine?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
when I compiled that, there are hell lot more errors than one can expect. 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(7): error C2059: syntax error : '(' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2065: 'WIN32_FIND_DATA' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2146: syntax error : missing ';' before identifier 'data' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(10): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'HANDLE' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2146: syntax error : missing ';' before identifier 'h' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'h' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(11): error C3861: 'FindFirstFile': identifier not found 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(13): error C2065: 'h' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(13): error C2065: 'INVALID_HANDLE_VALUE' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(17): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(17): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(18): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(18): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(19): error C2065: 'data' : undeclared identifier 1>c:\users\shrey\documents\visual studio 2010\projects\cfgdump\cfgdump\test2.cpp(19): error C2228: left of '.cFileName' must have class/struct/union 1> type is ''unknown-type'' 1>c:\users\shrey\documents\vi
Did you include the
windows.h
andiostream
header files? Did you remember to use thestd
namespace?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles