|
Atulmahajan wrote: So how can I identify which tab is clicked by user.
Check out the PSN_SETACTIVE notification.
"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
|
|
|
|
|
Does anyone knows if
in file.h
namespace MyNamespace{
...
enum MyEnum{
...
EnumItem,
....
};
...
};
then in file.cpp
using namespace MyNamespace;
...
foo(MyNamespace::MyEnum::EnumItem, ..);
or
foo(MyEnum::EnumItem, ..);
...
gives error C2825 and error C2275 in the first case
and
gives error C2039 in the second case
It doesn't work also if I remove the line using (of course then using extended variable usage)
can it be related to a bug of the compiler in VS2003? I'm quite sure that I'm not wronging the code sintax.
Russell
|
|
|
|
|
Hmm. This
namespace MyNamespace{
enum MyEnum{ EnumItem,SecondItem };
};
int _tmain(int argc, _TCHAR* argv[])
{
MyNamespace::MyEnum firstItem = MyNamespace::MyEnum::EnumItem;
MyNamespace::MyEnum secondItem = MyNamespace::MyEnum::SecondItem;
return system("pause");
} gives a warning C4482: nonstandard extension used: enum 'MyNamespace::MyEnum' used in qualified name with VC 2005.
That is meaning that enums are second class citizens and the correct way of refering them would be:
MyNamespace::MyEnum firstItem = MyNamespace::EnumItem;
MyNamespace::MyEnum secondItem = MyNamespace::SecondItem;
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
yes!
you are right.
I found only now your same conclusion.
thank you
Russell
|
|
|
|
|
Sorry,
looks solved:
this is a wrong usage
MyNamespace::MyEnum var=MyNamespace::MyEnum::EnumItem
this is correct
MyNamespace::MyEnum var=MyNamespace::EnumItem
Russell
|
|
|
|
|
i am using list control in report view and want to color the header of that list control, how this is done
malik
|
|
|
|
|
AFAIK either you need to owner draw it or Custom draw( LVN_CUSTOMDRAW ) it.
|
|
|
|
|
custom draw is only way to do so.. for that you have to subclass CListCtrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi
I need to call the following function somewhere in a program:
void __fastcall TFormMain::btnUpdateClick(TObject *Sender)
{.....}
This is the event of mouse-click on a button.
How can i call this function in the program itself (which otherwise gets called on 'mouse-click'??
|
|
|
|
|
Try sending a WM_COMMAND message to the button
ex:SendMessage(WM_COMMAND,/*ID_OF_BUTTON*/);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
By calling it directly. I do not know how the function is implemented, so I do not know if it can handle a NULL Sender parameter or not - e.g.:
btnUpdateClick( NULL ); If you have to call it outside of the TFormMain class, you need a way to expose it from that class.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi
can anyone help me finding a book about developing "com add-in" for office applications using mfc ?
thanks alot
Tarek
|
|
|
|
|
See Here ....[^]
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,I have a path (like "c:\path\programname.exe")
How can I determine if program 'programname.exe' exist in 'c:\path' directory?
I tried with 'FindFirstFile' and checking 'WIN32_FIND_DATA' structure, but for what 'dwFileAttributes'?
Thanks!
|
|
|
|
|
there's a quicker way - something like :-
bool bFExists(LPCTSTR szText) {
struct _stat buf;
return (_stat(szText, &buf) == 0);
}
should be quicker if you dont need to iterate through the files .. you'll need an include for <sys/stat.h>
hth, 'g'
|
|
|
|
|
<br />
WIN32_FIND_DATA wfd;<br />
HANDLE hf = FindFirstFile("c:\path\programname.exe",&wfd);<br />
if (hf != INVALID_HANDLE_VALUE) {<br />
FindClose(hf);<br />
return TRUE;<br />
}<br />
else<br />
return FALSE;<br />
but personally I just use
<br />
return (GetFileAttributes("c:\path\programname.exe") != -1);<br />
NB: in reference to the answer above the MSVC runtime function _stat() does a GetFileAttributes and a bunch of other stuff
|
|
|
|
|
use PathFileExists() API.
|
|
|
|
|
The simplest way to check if a file is exists is to open it with a call to CreateFile()
Waldermort
|
|
|
|
|
|
There's also _access() , which is just a wrapper around GetFileAttributes() .
"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
|
|
|
|
|
Hello,
When I am debugging the source code,I got "Debug Assertion Failed" as a heading and the text which shown in big letters.
When I see the output i got the following messages.
=========================================================================================
Warning: data source is readonly.
DBMS: EXCEL
Version: 08.00.0000
ODBC Driver Manager Version: 03.52.0000
'omc.exe': Loaded 'C:\WINDOWS\system32\msjtes40.dll', No symbols loaded.
'omc.exe': Loaded 'C:\WINDOWS\system32\vbajet32.dll', No symbols loaded.
'omc.exe': Loaded 'C:\WINDOWS\system32\expsrv.dll', No symbols loaded.
'omc.exe': Unloaded 'C:\WINDOWS\system32\msexcl40.dll'
The thread 'Win32 Thread' (0x544) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xcd0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x958) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x938) has exited with code 0 (0x0).
'omc.exe': Loaded 'C:\WINDOWS\system32\odexl32.dll', No symbols loaded.
'omc.exe': Unloaded 'C:\WINDOWS\system32\odexl32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\odbcjt32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\odbcji32.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjter40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjint40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\msjet40.dll'
'omc.exe': Unloaded 'C:\WINDOWS\system32\mswstr10.dll'
HEAP[omc.exe]: Invalid Address specified to RtlValidateHeap( 02440000, 02DEBD00 )
Windows has triggered a breakpoint in omc.exe.
This may be due to a corruption of the heap, and indicates a bug in omc.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
========================================================================================
Please if anyone identifies the error let me know.
Thanks in advance
Ratheesh
|
|
|
|
|
Can you show your code that generates this error(dont need to post full code).
|
|
|
|
|
void FileNameCreate(LPTSTR szPathBuffer, LPTSTR sPath, LPTSTR sFile, LPTSTR sExt)
{
char szTmpPathBuffer[MAX];
char *sTmpPath= NULL;
char *sTmpFile = NULL;
char sTmpExt[LEN_MAX];
try
{
sTmpPath = new char[LEN_MAX];
sTmpFile = new char[LEN_MAX];
TrUnicodeToChar(sPath,sTmpPath);
TrUnicodeToChar(sFile,sTmpFile);
TrUnicodeToChar(sExt,sTmpExt);
FileNameCreate(szTmpPathBuffer, sTmpPath, sTmpFile, sTmpExt,sizeof(szTmpPathBuffer));
TrCharToUnicode(szTmpPathBuffer,szPathBuffer);
delete [] sTmpPath;
delete [] sTmpFile;
}
catch(bad_alloc)
{
if(sTmpPath!=NULL)
delete [] sTmpPath;
if(sTmpFile!=NULL)
delete [] sTmpFile;
}
}
Error message has been occurred only in the text is shown in big letters.
|
|
|
|
|
The code listing is incomplete (missing information on sTmpExt ), but my guess is that TrCharToUnicode(...) is overwriting the memory pointed to by szPathBuffer because it is not being told the size of the memory (in TCHAR s) being pointed to by szPathBuffer .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|