|
Ohhh...Finally got it now...the linker errors have been resolved one shot. I have another question,
what does 'try' block starting on line '34' has no catch handlers means??not so familiar with this statement...
|
|
|
|
|
vanishaa wrote: what does 'try' block starting on line '34' has no catch handlers means
a) Which line 34? I haven't seen a try block anywhere.
b) A try block with no catch handlers means someone's forgotten to put catch handlers in...In fact, g++4.0.1 (the only C++ compiler I've got to hand) won't compile a try block with no handlers (what C++ compiler are you using? VC6?)
|
|
|
|
|
If I double click a file into explorer that has the right extension then my app is lounced, and the command line (see __argc and __targv) is like this:
C:\MyApp.exe /dde
What is "/dde " ?
I was expecting the name of the file.... i.e. something like this
C:\MyApp.exe C:\testfile.txt
Any help?
How can I get the filename I need?
Russell
|
|
|
|
|
Russell' wrote: What is "/dde" ?
Dynamic Data Exchange. Check your app's associated extension (and type) in the registry.
Russell' wrote: Any help?
How can I get the filename I need?
Again in the registry, you'll need %1 added to the end of your app's command line.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Yes!!! you are right.
Solved...but only temporary, because every time that my app is closed it is restored the same old/bad values into the registry.
My application is a MDI MFC program.
Some days ago I edited the String into the resource named MIDMYAPPTYPE .
I'm seeing that that string is passed to the constructor CMultiDocTemplate
(into InitInstance of the application).
That day I was surprised that the files where drawed into explorer with the same icon of the app.
I'm thinking that it is there that the app is automatically linked to the extension that I'm using with the program. And every time the program is lounced the same setting are stored.
Can it be true? Do you know how can I avoid this problem?
Russell
|
|
|
|
|
hi, everyone.
Other posts appear very quickly, it's harder to find my previous one related to
this question, so I decide to post this one:
Is the following code legal, for example:
typedef struct _VECTOR {
long a;
} _VECTOR, *_PVECTOR;
since I know:
typedef int int;
is illegal, but the 'typedef struct' example mentioned above is legal at least in
mingw2.95.
Is it possible to get an error from some other compilers that there's a
'typedef redefinition'?
Thanks in advance.
|
|
|
|
|
It is legal.
BTW: have you tried to compile it (with a compiler other that mingw2.95 )?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I've tried with Dev C++, but I cannot remember its version, and I got
'typedef redefinition' when compiling a C++ unit, so I think it may be
possible in C compilation, although it's passed with VC6.0.
Most of the problems I run accoss owed to VC6.0's language extension,
the project created in that environment successfully got countless errors
and warnings in gcc, there were even some 'syntax errors', so I had to make
the transition to a more stricted one.
|
|
|
|
|
It's legal - a tag name is not a type name. Struct, union and enum tag names share one namespace, while type names all share a different namespace. This means that typenames can be the same as tag names.
That means that your example is legal, but the following isn't, as the three tag names (for the struct, union and enum) are all the same:
typedef struct _VECTOR {} _VECTOR;
union _VECTOR {};
enum _VECTOR {};
|
|
|
|
|
yeah, I got the definition,
owe you one.
|
|
|
|
|
Hi,
Your code is valid C code, whether it is legal I can not say.
Normal C compilers will accept it; the odd one that would not, would be wrong.
|
|
|
|
|
hi experts i installed a s/w called QD developed in vc++ 1.52.it is installed successfully and running properly.i have compete code for QD s/w.when i building exe from code and run it is not executing properly.
but same exe when i copied in installed path it is executing successfully...what is the reason how to resolve it?
kir_MFC
|
|
|
|
|
kir_MFC wrote: urgrntly required
- 'required' is rude.
- 'urgently required' is even ruder.
- 'urgrntly requred' is... a typo.
BTW: The executable has some dependecies. It may find them in the installation path.
What do you want 'to resolve' (i.e. It works at should be, in my opinion...)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: # 'required' is rude.
# 'urgently required' is even ruder.
# 'urgrntly requred' is... a typo.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi guys,
I been working on a antivirus project as my final year project.. i have some problem with getting the list of all the files in a directory..
Lets say i choose C:/ and i want the list of all the files in the directory. Kindly help me with this ya... its a console program and i using DavC++ compiler...
Regards,
Thilek
|
|
|
|
|
Thilek wrote: Need help to get list of files in a directory...
Best answer is FindFirstFile/FindNextFile and other way that its not good using of DlgDirList Function.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Since you are not using VC++ compiler, i'm sticking to pure windows apis. You could use FindFirstFile() and FindNextFile(). Check out this sample[^].
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
JiJO raj,
thanks ya but its still showing 27
C:\Documents and Settings\Thilek\Desktop\2nd_trial\god\main.cpp cannot convert `const WCHAR*' to `const CHAR*' for argument `1' to `void* FindFirstFileA(const CHAR*, _WIN32_FIND_DATAA*)'
i running it on DevC++ since when i run it in VC++ express 2005 many header files missing in its library....
Any suggestions ???
|
|
|
|
|
Thilek wrote: thanks ya but its still showing 27
27 files? 27 compiler errors? Please explain.
Thilek wrote: C:\Documents and Settings\Thilek\Desktop\2nd_trial\god\main.cpp cannot convert `const WCHAR*' to `const CHAR*' for argument `1' to `void* FindFirstFileA(const CHAR*, _WIN32_FIND_DATAA*)'
This is a Unicode issue. You'll need to use wcout .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
NOW I CAN RUN IT USING VC++ PROFF 2005 NO PROBLEM ..
Below is the code i use :
1.#include <windows.h>
2.#include <stdio.h>
3.#include <iostream>
4.#include <string>
5.#include <sstream>
6.
7.
8.
9.std::string convertWCharArrayToString(const WCHAR * const wcharArray) {
10. std::stringstream ss;
11.
12. int i = 0;
13. char c = (char) wcharArray[i];
14. while(c != '\0') {
15. ss <<c;
16. i++;
17. c = (char) wcharArray[i];
18. }
19.
20. std::string convert = ss.str();
21. return convert;
22.}
23.
24.int main()
25.{
26. WIN32_FIND_DATA findFileData;
27. HANDLE hFind = FindFirstFile((LPCWSTR)"*", &findFileData);
28.
29. if(hFind == INVALID_HANDLE_VALUE) {
30. std::cout <<"No files found." <<std::endl;
31. } else {
32. std::cout <<"Files found." <<std::endl;
33. }
34.
35. int fileNumber = 0;
36. std::cout <<fileNumber <<":" <<convertWCharArrayToString(findFileData.cFileName) <<std::endl;
37. while(FindNextFile(hFind, &findFileData)) {
38. fileNumber++;
39. std::cout <<fileNumber <<":" <<convertWCharArrayToString(findFileData.cFileName) <<std::endl;
40. }
41.
42. FindClose(hFind);
43.
44. char a;
45. std::cin>> a;
46. return 0;
47.}
But when i change HANDLE hFind = FindFirstFile((LPCWSTR)"*", &findFileData); to HANDLE hFind = FindFirstFile((LPCWSTR)"C:\*", &findFileData);
its showing no file found and some funny symbols... but i wanted it to show entire list of files in a directory if i choose C:\ or D:\ and so on..
Can u guys help me plz...
|
|
|
|
|
Thilek wrote: But when i change HANDLE hFind = FindFirstFile((LPCWSTR)"*", &findFileData); to HANDLE hFind = FindFirstFile((LPCWSTR)"C:\*", &findFileData);
Use two backslashes within string literals.
Why are you using convertWCharArrayToString() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Still the same i tried using HANDLE hFind = FindFirstFile((LPCWSTR)"C:\\*", &findFileData);
i even tried with "C://*" "C://" "C:\\"
still showing no files found and some funny symbols...
if i ever change it from "*" to anything this was happen..
hmmm... i am blur now...
Help me plz...
Thanks...
|
|
|
|
|
Thilek wrote: i even tried with "C://*" "C://" "C:\\"
What if you used *.* ?
Thilek wrote: still showing...some funny symbols...
How are you verifying this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
well it jus show the folder name where is the c++ files are located if i use "." ... its not moving out of the folder....
|
|
|
|
|
Thilek wrote: well it jus show the folder name where is the c++ files are located if i use "." ... its not moving out of the folder....
This makes little, if any, sense. Perhaps you are not understanding relative vs. absolute paths. For example, if you specified "*.*" , then ".\\*.*" is implied and the files in the current working directory (CWD) will be listed. If you specified "..\\*.*" , then the files in the CWD's parent folder will be listed. If you specified "c:\\*.*" , then the files in the root folder will be listed.
Consider:
void main( void )
{
WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile(_T("*.*"), &findFileData);
if (hFind != INVALID_HANDLE_VALUE)
{
BOOL bFound = true;
int fileNumber = 0;
while (bFound)
{
fileNumber++;
wcout << fileNumber << _T(":") << findFileData.cFileName << endl;
bFound = FindNextFile(hFind, &findFileData);
}
FindClose(hFind);
}
}
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|