|
It isn't a static member function, so it isn't being called statically.
Instead, it is being called explicitly. If it were a virtual function, then you would be guaranteeing to call the given class implementation (or the one it inherits, but there isn't any inheritance in this case.
There's no real advantage/disadvantage in this case, except that the compiler is being explicity told to use MyClass::fn2() rather than this->fn2().
Steve S
Developer for hire
|
|
|
|
|
Thanks for the explanation.
Matt
|
|
|
|
|
How can i set more then 25 rows in -> dwNewRowsetSize = 25;
---- fetching records in bulk------
pMyDatabase->SetRowsetSize(25);
Bravoone
|
|
|
|
|
|
maybe... who knows
|
|
|
|
|
Its a secret
|
|
|
|
|
Flaviu_2006 wrote: How can i set more then 25 rows in -> dwNewRowsetSize = 25;
is this is of any help :
dwNewRowsetSize = 30;
|
|
|
|
|
CDatabase db;
db.Open("MyDataSource", FALSE, FALSE, "ODBC;", FALSE);
CRecordset rs( &db );
rs.Open(...);
then call rs.SetRowSetSize(30);
if the recordset is not opened, then you are unable to set the more than 25 rows.
|
|
|
|
|
Hello,
I am working with CDataGrid and I can not found how to change size of each colunm ! From resource I can change the size but it will be aplicated on all colunm but I need that each colunm have a other size!
Thank you to give me some tip !
AutreChien
|
|
|
|
|
Datagrid control, Subclass the datagrid header control. In that subclass, the header structure having column width properties. Here you can change for each and every column width.
|
|
|
|
|
I have check the header and the only fonction that I have founded is :
void put_DefColWidth(float newValue)
{
static BYTE parms[] = VTS_R4 ;
InvokeHelper(0x10, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
but there no other fonction to change each colunm !
header files name is DataGrid1.h !
AutreChien
|
|
|
|
|
Hi, this is a low priority bug of my application, i have an Edit control (READ-ONLY property is TRUE, TABSTOP property is FALSE) which is used to display some Message. The problem is that the "Message" of the edit control is getting selected when i am pressing the UP arrow key from the OK and CANCEL buttons of the dialog box, the "Message" should not get selected, how??
one thing i have written this code in OnInitDialog() to show the message in BOLD/BIGGER font
CFont myFont;
myFont.CreatePointFont(120, _T("Arial"), NULL);
CEdit* pBoxOne;
pBoxOne = (CEdit*)GetDlgItem(IDC_STATUS_EDIT);
pBoxOne->SetFont(&myFont, TRUE);
i have tried checking and unchecking all the styles, extented styles in edit properties, but of no use, may be this problem is arising because of the code i have written for the FONT, do i need to add anything extra in the code?? Pls Help!!!
thanx in advance
kumar
|
|
|
|
|
kumar_windows wrote: may be this problem is arising because of the code i have written for the FONT
Why didn't you try to comment out this code and try?
Actually what you got is the basic behaviour.
I would like to handle this problem in PreTranslateMessage of the dialog...
- NS -
|
|
|
|
|
Pls make the "Disabled" property of Edit control TRUE. Then it will not get selected.
Praveen
Akkott
|
|
|
|
|
thank you very much
thanx in advance
kumar_windows
|
|
|
|
|
Hi,
I have the below code in my app for showing a menu on right click on a systray icon.
CMenu SystrayMenu;
CPoint pt;
GetCursorPos(&pt);
SystrayMenu.CreatePopupMenu();
SystrayMenu.LoadMenuW(IDR_MENUSYSTRAY);
SystrayMenu.TrackPopupMenu(TPM_BOTTOMALIGN|TPM_LEFTBUTTON,pt.x,pt.y,this,0);
The menu appears on right click, but I only get a narrow bar.
In the menu resource I have one item "Exit", but nothing is shown.
What could be the problem ?
- KK
|
|
|
|
|
there is small problem in ur code. Modify it as below
CMenu SystrayMenu;
CPoint pt;
GetCursorPos(&pt);
SystrayMenu.CreatePopupMenu();
SystrayMenu.LoadMenuW(IDR_MENUSYSTRAY);
SystrayMenu.GetSubMenu(0)->TrackPopupMenu(TPM_BOTTOMALIGN|TPM_LEFTBUTTON,pt.x,pt.y,this,0);
nave
|
|
|
|
|
I get an access violation error when I do that.
- KK
|
|
|
|
|
plz ensure that the menu have submenus.
make a menuu of below structure( similar to a file menu in notepad ) and try
File
Open
Close
nave
|
|
|
|
|
I got it working. Thank you.
What I wanted is just one "EXIT" to be present in the right click menu.
So I just had EXIT in top most menu.
Then I added another item Exit in it's submenu and it works, shows only the submenu.
thanks again.
- KK
|
|
|
|
|
Hello comunity,
when i create an new file(CStdioFile) and write something in them i close it with CStdioFile::Close();,
but how to set the attribute FILE_ATTRIBUTE_READONLY to avoid that someone make changes at random,
my program need this file after create to work with them, and when is inside the file something
wrong my program want crash!
regards
break;
|
|
|
|
|
If I understood u right, you dont want another process to access the file when ur program is using it, to do this use CFile::shareExclusive with the Open operation.
if u open a file while in read-only, u cant write in it unless u clear this attribute, so that ur program crashes.
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Im not sure I understand all you're saying but :-
assuming : - LPCTSTR lpFileName
DWORD dwFileAttributes = GetFileAttributes( lpFileName);
long mask = dwFileAttributes;
if( ! ( dwFileAttributes & FILE_ATTRIBUTE_READONLY))
{
mask = dwFileAttributes | FILE_ATTRIBUTE_READONLY;
if( ! SetFileAttributes( lpFileName, mask))
{
// Flag the error here
return;
}
}
is probably what you're looking for - your program would of course have to remove the readonly flag before it used the file - the suggestion above this is also valid (ie exclusive flag)
'g'
|
|
|
|
|
Hello Garth,
yes, this is that what im looking for!
but need some help again!
Please check this code:
<br />
DWORD dwFileAttributes;<br />
DWORD mask;<br />
<br />
dwFileAttributes = GetFileAttributes(csFileName);
mask = dwFileAttributes;<br />
<br />
if((dwFileAttributes & FILE_ATTRIBUTE_READONLY))<br />
{<br />
mask = dwFileAttributes & FILE_ATTRIBUTE_NORMAL;
if(!SetFileAttribute(csFileName, mask))<br />
{<br />
AfxMessage(csErrorMessage);<br />
}<br />
}<br />
<br />
cMyFile.Open(...);<br />
dwFileAttributes = GetFileAttributes(csFileName);
mask = dwFileAttributes;<br />
if(!(dwFileAttributes & FILE_ATTRIBUTE_READONLY))<br />
{<br />
mask = dwFileAttributes | FILE_ATTRIBUTE_READONLY;
if(!SetFileAttributes(csFileName, mask))<br />
{<br />
}<br />
}<br />
This is what im doing with your response!
Is this right, take a look to my sample please!
Maybe is not the best way, but they do wat i want!
with best regards
break;
|
|
|
|
|
I would have done :-
DWORD dwFileAttributes = GetFileAttributes( lpFileName);
long mask = dwFileAttributes;
if( dwFileAttributes & FILE_ATTRIBUTE_READONLY)
{
long mask = dwFileAttributes & (~FILE_ATTRIBUTE_READONLY);
if( ! SetFileAttributes( lpFileName, mask))
{
// Output Some sort of error here
// Could not make (file) READ WRITE
return;
}
// Good - Output Some Soft of Message here ?
// (file) Is Read/Write
}
not sure if that answers your question
'g'
|
|
|
|