|
Hi,
Can I override COleControl' default interface functions? for example, COleControl::XOleInPlaceActiveObject::ResizeBorder
(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL) does nothing, I want to override it. What should I do?
Thank you very much
|
|
|
|
|
I have to create a dialog box where i need to display textboxes dynamically.
I also have to create a scrollable pane so that i can keep the display area of the textboxes constant.Anybody has an idea as to how this could be done.Need suggestion from your side
|
|
|
|
|
Ok, you want to create controls at runtime?
Sure create them and make sure to use ON_COMMAND_RANGE
and the set of ON_XXXX_RANGE message macros
and specify the max id you will deal with.
In the handler you can retrieve the control id and
perform operations on it.
|
|
|
|
|
is the MSVC++ 6.0 STL implementation threadsafe?
The earth is not dying. It is being killed.
|
|
|
|
|
It is threadsafe insomuch as it does not use thread-local-storage and does not have any thread-affinity.
Howvever, it does not provide synchronization for any of its templates. It is up to the programmer to synchronize access to the classes as needed.
|
|
|
|
|
*yuck* but thank you
The earth is not dying. It is being killed.
|
|
|
|
|
Howvever, it does not provide synchronization for any of its templates.
Depedning on version that's either true or false.
A stock MSVC5/6 (the same old crap from 1994-'95) indeed provide thread locking for e.g. _Tree (which is the R/B-tree implementation class used for e.g. set and map).
There are however fixes for this on the Dinukumware site that removes that thread-locking code.
For the VC7 C++ library it seems the thread locking is thankfully absent (at least in _Tree).
|
|
|
|
|
thanks for the info. I was not aware of this. Everything I've read from MS and others said otherwise.
I'm glad, however, that VC7 removes this. Synchronization is an issue best left to the module/app developer.
|
|
|
|
|
Whats wrong whit this code?:
PSID pSid = NULL;
SID_NAME_USE sNameUse = SidTypeUser ;
TCHAR RefDomain = NULL;
DWORD RefDomCtn = 256;
DWORD SidCtn = 256;
LookupAccountName(NULL,lpszSystemInfo , pSid ,&SidCtn , (LPSTR)RefDomain ,&RefDomCtn , &sNameUse );
I've got unhandled error:
0xC0000005: Access violation writing location 0x00000000.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
TCHAR RefDomain = NULL ;
Hah what's wrong with the above stmt ??
its a single char variable initialized to NULL(0).
When this is accessed in the function, where it is happily casted
to a LPSTR, the function tries to access the memory location at '0'.
So now what do think is wrong with the code ??
|
|
|
|
|
Thanks for your reply.Sorry,Can you tell me what should I write now?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Just specify the acct name and the buffer sizes that should be enough.
It will automatically test the local machine and the Domain and
trusted Domains.
|
|
|
|
|
Hi all!
I have 2 dimensional array but whenever i make a loop to travers it and output the result, it display some weird number such as -858933448 ans so on
Here is my function call:
pDoc->A.getLadder(ladder);
for(row = 0; row <4; row++)
{
CString team = pDoc->A.getTeam(ladder[row][TEAM]);
int played = ladder[row][PLAYED];
int won = ladder[row][WON];
int draw= ladder[row][DRAW];
int lost = ladder[row][LOST];
int f0r = ladder[row][FOR];
int against = ladder[row][AGN];
int points= ladder[row][POINTS];
CString tempString;
tempString.Format("%s = %d = %d = %d = %d == %d == %d == %d",
team, played, won, draw, lost, f0r, against, points);
lineArray.push_back(tempString);
tempString = " ";
}
thanks!
|
|
|
|
|
Show the code for A.getLadder
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
here is the code for getLadder
void Group::getLadder(int ladder[4][8])
{
Sort();
for(int i = 0; i < 4; i++)
for (int j = 0; j < 8; j++)
ladder[i][j] = aILadder[i][j];
}
and here is the sort function that is placed within the class but is declared as private.
void Group::Sort()
{
const int TEAM = 0;
const int PLAYED = 1;
const int WON = 2;
const int DRAW = 3;
const int LOST = 4;
const int FOR = 5;
const int AGN = 6;
const int POINTS = 7;
int row, col;
for( row = 0; row < 4; row++)
{
for (col = 0; col < 4 ; col++)
{
if( row != col)
{
aILadder[row][TEAM] = row;
if(result[row][col] > result[col][row] && result[row][col] != -1)
{
aILadder[row][PLAYED] +=1;
aILadder[row][WON] += 1;
aILadder[row][FOR] += result[row][col];
aILadder[row][AGN] += result[col][row];
aILadder[row][POINTS] += 3;
}
else
if(result[row][col] == result[col][row] && result[row][col] != -1)
{
aILadder[row][PLAYED]+=1;
aILadder[row][DRAW]+=1;
aILadder[row][FOR] += result[row][col];
aILadder[row][AGN] += result[col][row];
aILadder[row][POINTS]+=1;
}
else
if(result[row][col] < result[col][row] && result[row][col] != -1)
{
aILadder[row][PLAYED]+=1;
aILadder[row][LOST]+=1;
aILadder[row][FOR] += result[row][col];
aILadder[row][AGN] += result[col][row];
}
}
}
}
int tempArr[1][8];
int j, target;
for(row = 1; row < 4; row++)
{
j = row;
target = aILadder[row][POINTS];
while(j > 0 && target > aILadder[j-1][POINTS])
{
for(int i = 0; i < 8; i++)
{
tempArr[0][i] = aILadder[j-1][i];
aILadder[j-1][i] = aILadder[j][i];
aILadder[j][i] = tempArr[0][i];
}
j--;
}
}
}
Thanks
|
|
|
|
|
Obviously there is a problem with the stmt
pDoc->A.getLadder(ladder);
I think that the pointer being returned is not correct.
What is the decl of getLadder ?? Is it accepting a
pointer to a pointer (**p??).
Also if a pointer is being returned I think that you
should use the pointer notion for retrieving the
elements
So if you want to have [i][j]
*(p + i*nSize + j)
where nSize is the size of the array's first index.
PS: Its been long since I have worked with this kind of
pointers to arrays (So just off the top of my head i remembered that
arrays are contigious locations and formulated the above code).
Please correct me if it is wrong
|
|
|
|
|
Hi,
I want to show all the directory (directory structure)
in the Tree View
How can i do that
Sameer
|
|
|
|
|
CTreeCtrl::Expand
Use the root node as the HTREEITEM and TVE_EXPAND as the 2nd arg
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi,
I'am sory, but i guess u misunderstood my problem.
Actually i want to display a tree view in which all
the directories of the Drive are listed
Sameer
|
|
|
|
|
Sameer Maggon wrote:
Actually i want to display a tree view in which all
the directories of the Drive are listed
Sorry
What you need is SHBrowseForFolder
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
look at the foll,. article at Codeguru
http://www.codeguru.com/treeview/CDirTreeCtrl.shtml
|
|
|
|
|
Hi,
I saw that Control, but that control is too heavy.
I just want to Display the Directories and not the
Files etc.
Actually i just want to give a user, selection of a
Directory.
Please help
Sameer
|
|
|
|
|
You can limit the tree to one level.
Best regards,
Alexandru Savescu
|
|
|
|
|
Sameer Maggon wrote:
Actually i just want to give a user, selection of a
Directory.
Already told you. Use SHBrowseForFolder
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Use the foll. code
CString GetUserDirectory()
{
CString strPath ;
char szDisplayName[_MAX_PATH] ;
char *szPath = NULL ;
char *szTitle = _T(" Please Locate Directory : ") ;
BROWSEINFO bi = {0} ;
bi.pszDisplayName = &szDisplayName[0] ;
bi.lpszTitle = szTitle ;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_RETURNFSANCESTORS ;
bi.hwndOwner = NULL ;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi) ;
if( pidl == NULL )
return strPath ;
if( !SHGetPathFromIDList(pidl,szPath) )
{
AfxMessageBox(" The Path is Invalid ! ") ;
return strPath ;
}
IMalloc *pMalloc = NULL ;
HRESULT hr = SHGetMalloc(&pMalloc) ;
if( !SUCCEEDED(hr) )
return strPath ;
pMalloc->Free( (void*)pidl ) ;
pMalloc->Release() ;
strPath = szPath ;
return strPath ;
}
<pre>
|
|
|
|