|
Tcpip2005 wrote: I used GetButtonText,but the strText is always NULL.
Use
CToolBarCtrl::GetButtonInfo::GetButtonInfo( int nID, TBBUTTONINFO* bbi );
it's bbi pointer contain the Button text Information!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Take a look at the CToolBarCtrl Class Members[^] topic in the MSDN. The GetButton member returns information about buttons. It doesn't look like any of the members return the text assigned to a button directly. I have a feeling it's simpler to just remember the text you assign when you create the control.
Software Zen: delete this;
|
|
|
|
|
Hi to All,
How can I make my Exe as a service using VC++. that service should appear in Services of Administrator tools and that should start when the system is boot up and should appear in system tray icon to tell that it is started. Can anybody help in this regard.
Thanks in advance.
|
|
|
|
|
|
I have used DialogBar in my application on which i have few Dropdown listbox,
i dynamically create and destroy the DlgBar depending the option selected
by the user.
The problem is that the DlgBar is not visible when i creat it ,
i tried
AfxGetMainWnd()->RedrawWindow();
AfxGetMainWnd()->Invalidate (TRUE);
But it donot work .............
When i minimise and maximise the application then i can see the DlgBar
by using this code.
AfxGetMainWnd()->ShowWindow(SW_MINIMIZE);
AfxGetMainWnd()->ShowWindow(SW_MAXIMIZE);
Can anyone point out what i am missing .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I'll assume you mean a control bar.
You could try: CFrameWnd::ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay);
INTP
Every thing is relative...
|
|
|
|
|
Whoops!
A Dialog bar is derived from a control bar, so ShowControlBar is probably the corrent function to use.
INTP
Every thing is relative...
|
|
|
|
|
error C2039: 'ShowControlBar' : is not a member of 'CDialogBar'
its not the member of the DlgBar class
Can u tell me the way that will Repaint the
Main window in any conditon .
I think i will have to try that because when i
minmise and maxime the mainwindow the dlgbar
show its presence .
AfxGetMainWnd()->RedrawWindow();
AfxGetMainWnd()->Invalidate (TRUE);
AfxGetMainWnd()->UpdateWindow ();
this->PostMessage (WM_ERASEBKGND ); this dont work
I have already tried this things;
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
ShowControlBar() is a member of CFrameWnd from which your main frame window is derived. Therefore you would probably call it like this:
AfxGetMainWnd()->ShowControlBar((CControlBar*)pMyDlgBar,TRUE,0);
Why? Because CDialogBar is derived from CControlBar .
vikas amin wrote: Can u tell me the way that will Repaint the
Main window in any conditon
First should call Invalidate() before you call RedrawWindow() .
AfxGetMainWnd()->Invalidate();
AfxGetMainWnd()->RedrawWindow();
When dealing with control bars and dialog bars this might help:
AfxGetMainWnd()->RecalcLayout();
INTP
Every thing is relative...
|
|
|
|
|
Thank you
AfxGetMainWnd()->ShowControlBar((CControlBar*)pMyDlgBar,TRUE,0);
it solved my problem by setting the second parameter TRUE/FALSE
we can change the visibility of the Dlgbar
ok
On this link you will find the new free courses
offered by microsoft for VS2005.
http://www.financialexpress.com/latest_full_story.php?content_id=107645
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
-----> hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{AfxMessageBox("Failed To Connect Datasource"); }
My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.
|| ART OF LIVING ||
|
|
|
|
|
please answer my above question
|| ART OF LIVING ||
|
|
|
|
|
42
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Will you join conversation to solve problem
|| ART OF LIVING ||
|
|
|
|
|
You're question doesn't have enough information to make sense, or expect a usefull answer.
You posted about 50 lines of code but the error is on the 3rd line - why do we need to see the rest at this point.
There are many things that could be wrong that have nothing to do with the code.
You should check that the database is setup right and explain what you have checked.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Send the details pls
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
void OleList::ExecuteQuery(CString str,bool refreshcol,bool fillcheckbox)
{
ptr=new CObArray;
USES_CONVERSION;
CDataSource db;
-----> HRESULT hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{
AfxMessageBox("Failed To Connect Datasource");
return;
}
CSession session;
session.Open(db);
int i=0;
CCommand product;
CString temp=GenerateSQL();
LONG row;
char tt[50];
hr=product.Open(session,temp, NULL, &row, DBGUID_DEFAULT, true);
if (FAILED(hr))
{
AfxMessageBox("Failed To Create Table");
return;
}
if(refreshcol)
{
// coltype.RemoveAll();
DBTYPE pType;//=NULL;
for(ULONG j=0;j< product.GetColumnCount() && j < colsize;j++)
if(product.GetColumnType(j+1,&pType))
coltype->SetAt(j,pType);
}
i=0;
if(product.MoveFirst()==S_OK)
do{
CStringArray* sarr=new CStringArray;
sarr->SetSize(colsize);
for(int k=1;k<=colsize;k++)
{
CString st;
switch(coltype->GetAt(k-1))
{
case DBTYPE_STR :
{
char* tm=(char*)product.GetValue(k);
st=A2T(tm);break;
}
case DBTYPE_DBTIMESTAMP : st=GetTime(product.GetValue(k)); break;
case DBTYPE_BOOL : GetBool(product.GetValue(k),&st); break;
case DBTYPE_R4 : GetFloat(product.GetValue(k),&st); break;
case DBTYPE_R8 : GetDouble(product.GetValue(k),&st); break;
case DBTYPE_I4 : GetLong(product.GetValue(k),&st); break;
case DBTYPE_I2 : GetSort(product.GetValue(k),&st); break;
case DBTYPE_UI1 : GetUInt(product.GetValue(k),&st); break;
}
/*if(k==1)
InsertItem(i,st);
else
SetItemText(i,k-1,st);*/
st.TrimRight();
sarr->SetAt(k-1,st);
}
ptr->Add(sarr);
i++;
product.FreeRecordMemory();
}while(product.MoveNext()==S_OK);
if(checkarr!=NULL)
checkarr->RemoveAll();
checkarr=new CWordArray;
checkarr->SetSize(i);
for(int m=0;m checkarr->SetAt(m,fillcheckbox+1);
SetItemCountEx(i);
//char tt[50];
//AfxMessageBox(itoa(i,tt,10));
// SetItemCount(i);
Invalidate();
m_HeaderCtrl.listsize=i;
m_HeaderCtrl.checkarr=checkarr;
product.Close();
session.Close();
db.Close();
m_HeaderCtrl.ptr=ptr;
SetCursor(hcurSave);
}
My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.
|| ART OF LIVING ||
-- modified at 1:25 Saturday 5th November, 2005
|
|
|
|
|
I Have Send You the details
|| ART OF LIVING ||
|
|
|
|
|
Probably there is some error with
the OLE DB you are using.
Did u find out that the connection
is working proper .
Ther is one more method CEnumerator which
prompts the user with a locator dialog box.
from wich u can select ur connection and
try opening the database.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Actually He has used this code in three more places.
And I am mimicing his code.I have gone through his code
in and out.Only what I have sent you that much is inly related to database connectivity. And in same project at other three locations it is working perfectly
|| ART OF LIVING ||
|
|
|
|
|
Does it? I can't get it to work...
I'm running the Feb 2003 SDK. It there maybe an update that fixes this?
Thanks!
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Not that familiar with OpenGL - but had fun(!) with this type of thing before.
First thing to check is your graphics card. Does it support alpha? If so then check the configuration setup in the control panel. You may also want to check that you have the latest drivers from your manufacturer.
I once spent hours trying to get anti-aliasing working on my laptop's card
Graham
|
|
|
|
|
using alpha is a combination effort. In otherwords you cannot simply use alpha transparency, you first have to enable it, and also provide a function for method of processing alpha. The whole process is called blending since you are using a source color value, an alpha transparency, a function for combining the two into a new blended color.
Try looking here for an example, it is my personal favorite OpenGL site: NeHe[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Is it possible to use alpha with OpenGL??
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Thanks a lot, that really helps!
He says "You should SORT THE TRANSPARENT POLYGONS BY DEPTH and draw them AFTER THE ENTIRE SCENE HAS BEEN DRAWN, with the DEPTH BUFFER ENABLED, or you will get incorrect results."
How do I determine the depth of the object? What is the proper function to use to get the distance between the viewpoint and the object?
Thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|