|
Thanks CPallini,
I think it means adding information to each cpp file. It is not a good solution since it means I need to modify all source files which need to include the header file.
Any better ideas or comments?
regards,
George
|
|
|
|
|
The guess is right: you should put it into the header file.
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]
|
|
|
|
|
Put what information? Could you clarify please? There is some context missing here.
regards,
George
|
|
|
|
|
Well, I was wrong (I took literally the documentation [^]
__FILE__
The name of the current source file.
but a little test clearified my misunderstanding ).
Hence, I suppose __FILE__ is of little help. As workaround, you may compile the source file with the /E switch and look at the generated output.
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]
|
|
|
|
|
Thanks CPallini,
My confusion is put __FILE__ into header file will output the value of .h file other than .cpp file. This is not I want.
I want to know which cpp file (that includes the .h file) is compiling currect. Any comments or ideas?
regards,
George
|
|
|
|
|
Can be in .h as well as in .cpp. It depends your need.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks Jijo,
I am confused about the discussion context. You mean put what information in .h file which could monitor which cpp file (that includes the .h file) is compiling?
regards,
George
|
|
|
|
|
Possibly
#pragma message("Compiling " __FILE__ )
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]
|
|
|
|
|
Indeed. Seems I need a coffee.
And 5 points to gryffindor.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
No, Jijo!
It will display the .h file name other than the .cpp file name if you put the statement into header file. Have you tried?
regards,
George
|
|
|
|
|
No, CPallini!
It will display the .h file name other than the .cpp file name if you put the statement into header file.
regards,
George
|
|
|
|
|
You're right, see my reply above [^].
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]
|
|
|
|
|
|
George_George wrote: ...when compiling foo.cpp, I want to output "foo.cpp is compiling" and when compiling goo.cpp, I want to output "goo.cpp is compiling".
Doesn't this information get displayed by the compiler by default?
"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
|
|
|
|
|
Thanks DavidCrow,
Yes. My question is, when a line like "foo.cpp is compiling" is displayed, does it mean the information above this line belongs to foo.cpp compiling process or the information after this line belongs to foo.cpp compiling process?
My compiler log output is long.
regards,
George
|
|
|
|
|
George_George wrote: Yes. My question is, when a line like "foo.cpp is compiling" is displayed, does it mean the information above this line belongs to foo.cpp compiling process or the information after this line belongs to foo.cpp compiling process?
Starting with the line below "foo.cpp is compiling" all the lines (until "goo.cpp is compiling" ) belongs to foo.cpp compilation process.
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]
|
|
|
|
|
Thanks for your advice, CPallini!
Smart guy!
regards,
George
|
|
|
|
|
Hi
I am working on Pocket PC 5.0 Win 32 C++ application and i want to load data (images) from web service. how i use the web service using win 32 C++. and how i create the HTTP request. please suggest.
Thanks
Khatri Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
Learn about sockets and the HTTP protocol? There are tonns of docs around.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi everybody,
I am writing a dialog-based CMS in which I want the user to be able to edit part of the HTML pages with a WYSIWYG editor. I do so using CHtmlEditCtrl. It works, meaning that I can show the edit control, I can load HTML content into it and I can send commands to it (using stuff like m_ctrlHtml->ExecHelperNN(IDM_BOLD) However, I would also very much like the buttons in my toolbar to respond when the user changes the cursor location, (like the bold button getting the pressed state when appropriate, showing the correct font etc) rather then just being able to send commands from these buttons. However, I cannot seem to find the notification messages sent by CHtmlEditCtrl. Does anyone know how to find these??
Thanks in advance
William
|
|
|
|
|
Hi All,
We have one dll which can be used in many Exes and different Operating systems.
At present i am having one requirement to support to get the LocalLow path in vista.
So I have implemented separate function for it.
I have used SHGetKnownFolderPath funciton to get the LocalLow path.
To compile the workspace , I have to use WINVER value as 0x0600.
IF we defined the WinVersion as 6 , DLL is not running in XP.
Developement Environment :VS 2005 & Vista Business.
//In Vista Expected output : C:\Users\bob\AppData\LocalLow\eGrabber\
//In XP Expceted output: C:\Documents and Settings\Smith\Application Data\eGrabber\
<br />
int GetCurrentUserLocalLowAppPath(LPTSTR szProfileDir,int dirlen )<br />
{<br />
<br />
memset(szProfileDir,0,dirlen);<br />
<br />
if(IsWinXP() == TRUE)<br />
{ <br />
GetCurrentUserAppPath( szProfileDir, dirlen );<br />
}<br />
else if(IsVista() == TRUE)<br />
{<br />
PWSTR pszPath[1];<br />
SHGetKnownFolderPath(NULL,FOLDERID_LocalAppDataLow,0,NULL,pszPath); <br />
}<br />
return 1;<br />
<br />
}
Any idea how to achieve this.
Your suggestion welcomed ...
Thanks.
|
|
|
|
|
The only problem for not working the dll in windows XP is that, it is using a function(SHGetKnownFolderPath ), that is not available in windows XP.
To solve this problem, instead of statically linking to the SHGetKnownFolderPath() function, dynamically call it. That is, using the LoadLibrary() and GetProcAddress() functions.
|
|
|
|
|
Thanks Naveen.
Here is the code for it.
typedef HRESULT (WINAPI * SHGetKnownFolderPathFn)(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken,PWSTR *ppszPath);
PWSTR pszPath[1];
SHGetKnownFolderPathFn shGetKnownFolrPth = NULL ;
HINSTANCE hins = LoadLibrary("Shell32.dll");
if(hins != NULL)
{
shGetKnownFolrPth = (SHGetKnownFolderPathFn)::GetProcAddress(hins,"SHGetKnownFolderPath");
if( shGetKnownFolrPth != NULL)
{
shGetKnownFolrPth(FOLDERID_LocalAppDataLow,0,NULL,pszPath);
CString csData=pszPath[0];
}
}
|
|
|
|
|
Hi,
I was wondering if it is possible to set an struct parameter to NULL.
Something like this:
typedef struct _myStruct
{
int a;
}myStruct;
...
void func(myStruct *ms=NULL);
...
main()
{
myStruct mS;
...
func();
...
func(&mS);
...
}
Is something like this possible...
Thanks in advance...
|
|
|
|
|
default parameter?? search for "default parameter"
|
|
|
|