|
adara wrote:
in OnInitDialog, SetClipboardViewer() crash my app only in release mode
any ideas ?
How did you find out that it was SetClipboardViewer() ? The function returns NULL when it fails, but usually does not crash the app, unless you are doing something related to it just after. So I´m wondering ... Could you post a code sample about how you use it ?
~RaGE();
|
|
|
|
|
It seems that when I add to a TreeControl (Win32 SDK not MFC) the pszString item I add is not the same was what I put in (eg. Put in text and get back a large string of hi-ascii).
I insert into the tree thusly:
<br />
TVINSERTSTRUCT tvs;<br />
TVITEM tvi;<br />
HTREEITEM last;<br />
<br />
tvs.hInsertAfter = TVI_LAST;<br />
tvi.mask = TVIF_TEXT;<br />
<br />
tvi.pszText = "Test Item #1";<br />
tvs.hParent = TVI_ROOT;<br />
tvs.item = tvi;<br />
last = TreeView_InsertItem(GetDlgItem(MainWindow,IDC_TREE),&tvs);<br />
To retrieve I handle the WM_NOTIFY message when the event is TVN_SELCHANGED.
<br />
case WM_NOTIFY: <br />
node = (LPNMTREEVIEW)lParam;<br />
if(node->hdr.code == TVN_SELCHANGED) {<br />
MessageBox(MainWindow,(char *)node->itemNew.pszText,"Selection CHANGED!",0);<br />
}<br />
break;<br />
In the debugger node->itemNew.pszText is high ascii garbage and no where near the "Test #1" item I put in. The book I have and the docs I've found so far all use the TreeControl by comparing the selected item to a list of the items added which is no good for me because I'm trying to build up the entire path from each selected tree item (like a file path). This occurs with multiple items in the tree control as well.
Any suggestions or ideas on where I have gone wrong would be greatly appricated.
Sean
|
|
|
|
|
Rule #1 of the list/tree control structs is: always init them to zero. You'd be surprised how much havoc is wrought if you don't do that.
TVINSERTSTRUCT tvs = {0};
TVITEM tvi = {0};
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Unfortunately, even with that problem still occurs. :L
Sean
|
|
|
|
|
NullStream wrote:
In the debugger node->itemNew.pszText is high ascii garbage and no where near the "Test #1" item I put in
That must be because you are simply not looking at the good item. I do not know enough about non MFC app to be of a great help, but try to see if the lines
node = (LPNMTREEVIEW)lParam;
if(node->hdr.code == TVN_SELCHANGED) {
MessageBox(MainWindow,(char *)node->itemNew.pszText,"Selection CHANGED!",0);
}
really refers to the correct item.
~RaGE();
|
|
|
|
|
I would suggest that where you have gone wrong is to assume the pszText member of itemNew is valid, it isnt. See the MSDN Library topic for TVN_SELCHANGED.
Try it like this:
if(node->hdr.code == TVN_SELCHANGED) {
node->itemNew.mask |= TVIF_TEXT;
TreeView_GetItem(GetDlgItem(MainWindow,IDC_TREE),&node->itemNew);
MessageBox(MainWindow,(char *)node->itemNew.pszText,"Selection CHANGED!",0);
}
|
|
|
|
|
Ok. That seem to do it and according to the help file I ended up with:
<br />
HWND ctrl = GetDlgItem(MainWindow,IDC_TREE);<br />
char buffer[1024];<br />
memset(buffer,0,1024);<br />
if(ctrl == NULL)<br />
MessageBox(MainWindow,"GET TREE","Selection CHANGED!",0);<br />
node->itemNew.mask |= TVIF_TEXT;<br />
node->itemNew.pszText = buffer;<br />
node->itemNew.cchTextMax = 1024;<br />
if(TreeView_GetItem(ctrl,&node->itemNew))<br />
MessageBox(MainWindow,(char *)node->itemNew.pszText,"Selection CHANGED!",0);<br />
This works fine but it seems from the Help files regarding TVITEM suggest than I can only "tell" if an item has a child. Is there a way to use the control itself to follow the lineage of the selected item? For arguments sake let's just say i'm trying to implement a file browser (not the case but the same idea). If I choose a file I need to build up the entire path based on the selection back to through the parents to the root. Do I have to "already know" the structure of the tree already? Having two copies (one in the tree control itself and the other in my program) of the same tree in memory seems to be a waste and terribly inefficient which is why I'm trying to just use the data in the treecontrol instead of building a tree data structure in memory which is replicated to the treecontrol.
Man that's wierdly stated hopefully I'm making some sort of sense here.
Sean
|
|
|
|
|
Sean,
Either way is messy, keeping a copy of the structure in memory or using the control.
Look to continuously call TreeView_GetParent() until it returns NULL. If you use a loop you will need to insert the parent item's text at the beginning of the buffer each time. If you use a recursive function call then you can build the string by appending each item's text on the way back out of the recursive function.
|
|
|
|
|
That's exactly what I'm looking for and using GetParent doesn't sound as messy as a tree comparisson unless of course the control itself doesn't handle it well.
I'd have to do a recursive match either way so I'll let the control do most of the work.
Thanks a million none the less.
Sean
|
|
|
|
|
When I build my bank.cpp file, I get these linking errors. I don't understand these coding errors, I would appreciate any help you could give me.
Linking...
Bank.obj : error LNK2001: unresolved external symbol "public: class Account & __thiscall Customer::getchecking(void)" (?getchecking@Customer@@QAEAAVAccount@@XZ)
Bank.obj : error LNK2001: unresolved external symbol "public: void __thiscall Account::setbalance(float)" (?setbalance@Account@@QAEXM@Z)
Bank.obj : error LNK2001: unresolved external symbol "public: void __thiscall Account::setnum(int)" (?setnum@Account@@QAEXH@Z)
Bank.obj : error LNK2001: unresolved external symbol "public: class Account & __thiscall Customer::getsavings(void)" (?getsavings@Customer@@QAEAAVAccount@@XZ)
Bank.obj : error LNK2001: unresolved external symbol "public: void __thiscall Customer::setpin(int)" (?setpin@Customer@@QAEXH@Z)
Bank.obj : error LNK2001: unresolved external symbol "public: __thiscall Customer::Customer(void)" (??0Customer@@QAE@XZ)
Bank.obj : error LNK2001: unresolved external symbol "public: float __thiscall Account::getbalance(void)" (?getbalance@Account@@QAEMXZ)
Bank.obj : error LNK2001: unresolved external symbol "public: int __thiscall Account::getnum(void)" (?getnum@Account@@QAEHXZ)
Bank.obj : error LNK2001: unresolved external symbol "public: int __thiscall Customer::getpin(void)" (?getpin@Customer@@QAEHXZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Bank.exe : fatal error LNK1120: 10 unresolved externals
Error executing link.exe.
Bank.exe - 11 error(s), 0 warning(s)
This is my bank.cpp file.............................
#include "Bank.h"
#include <fstream.h>
Bank::Bank()
{
numcustomers=0;
companyname="";
}
int Bank::getNumcustomers()
{return numcustomers;}
char * Bank::getCompanyname()
{return companyname;}
Customer& Bank::getCustomer(int index)
{ return customers[index];}
void Bank::setNumcustomers(int n)
{ numcustomers=n; }
void Bank::setCompanyname(char * c)
{ companyname =c;}
void Bank::setCustomer(Customer &c,int index)
{customers[index]= c;}
bool Bank::readCustomers()
{
ifstream infile;
infile.open("customers.dat");
if(!infile)
{
return false;
}
else
{ infile>>numcustomers;
int numberpin=0;
int cksavnumber=0;
float savckbalance=0.00f;
customers = new Customer[numcustomers];
for(int x1=0;x1<=numcustomers;x1++)
{
infile>>numberpin;
infile>>cksavnumber;
infile>>savckbalance;
customers [x1].setpin(numberpin);
customers[x1].getsavings().setnum(cksavnumber);
customers[x1].getsavings().setbalance(savckbalance);
infile>>cksavnumber;
infile>>savckbalance;
customers[x1].getchecking().setnum(cksavnumber);
customers[x1].getchecking().setbalance(savckbalance);
}
infile.close();
}
return true;
}
bool Bank::writeCustomers()
{
ofstream outfile;
outfile.open("newcustomers.dat");
if(!outfile)
{
return false;
}
else
{ outfile<<numcustomers;
for(int="" x1="0;x1<=numcustomers;x1++)
" {
="" outfile="" <<="" customers="" [x1].getpin()="" "\t";
="" outfile<<customers="" [x1].getsavings().getnum()<<="" [x1].getsavings().getbalance()<<="" [x1].getchecking().getnum()<<="" [x1].getchecking().getbalance()<<="" endl;
="" }
="" outfile.close();
="" return="" true;
="" }
int="" bank::checkpin(int="" pin)
{="" for="" (int="" x1<="numcustomers;" x1++)
="" {="" if="" (customers[x1].getpin()="=pin)
" x1;
="" -1;
}
int="" bank::menu()
{="" int="" choice="1;
" cout<<"withdraw";
="" cout<<"deposit";
="" cout<<"transfer";
="" cout<<"display="" balances";
="" cout<<"exit";
="" choice;
}
bool="" bank::withdraw(float="" amount,account="" a)=""
{
if(amount="">a.getbalance())
{
return false;
}
else
{ a.setbalance(a.getbalance()- amount);
return true;
}
}
void Bank::deposit(float amount,Account a)
{a.setbalance(a.getbalance()+ amount);}
bool Bank::transfer(float amount,Account s,Account c)
{
int targetaccount=0;
do
{
cout<<"From which account"<<endl;
cout<<"1-checking"<<endl;
cout<<"2-saving"<<endl;
cin>>targetaccount;
if ((targetaccount!=1)&&(targetaccount !=2))
cout<<"INVALID Choice"<<endl<<endl;
} while="" ((targetaccount!="1)&&(targetaccount" !="2));
if(targetaccount==1)
{"
if="" (amount="">c.getbalance())
return false;
}
else
{
c.setbalance(c.getbalance()-amount);
s.setbalance(s.getbalance()+amount);
}
if(targetaccount==2)
{
if (amount>s.getbalance())
return false;
}
else
{
c.setbalance(c.getbalance()+amount);
s.setbalance(s.getbalance()-amount);
}
return true;
}
void Bank::displayBalance(int index)
{
cout<<"This is your savings account balance: $ "<<customers[index].getsavings().getbalance()<<endl;
cout<<"this="" is="" your="" checking="" account="" balance:="" $="" "<<customers[index].getchecking().getbalance()<<endl;
=""
}
account.cpp="" .........................................
#include="" "account.h"
account::account()
{
="" num="0;
" type="0;
" balance="0.00f;
}
Account::Account(int" n,int="" t,float="" b)
{
="" account::setnum="" (int="" n)
{
="" account::settype="" t)
{
="" account::setbalance(float="" account::getnum()
{
="" return="" num;
}
int="" account::gettype()
{
="" type;
}
float="" account::getbalance()
{
="" balance;
}
my="" void="" main...........................................
#="" include="" <iostream.h="">
# include "account.cpp"
# include "customer.cpp"
# include "bank.cpp"
# include <stdlib.h>
int getaccount();
float getamount();
Bank Chase;
Customer clientme;
void main()
{
int index=-1, pin =0, numtries=1;
Chase.setCompanyname("Chase");
if(!Chase.readCustomers())
{ cout<<"Account not in database!"<<endl;
exit(0);
="" }
="" do
="" {="" cout<<"enter="" your="" password:";
="" cin="">>pin;
index=Chase.checkPin(pin);
if((index==-1) && (numtries<=3))
{numtries++;
cout<<"Password incorrect,try again."<<endl;
="" }
="" }="" while="" ((index="=-1)&&(numtries<=3));
"
="" if="" (numtries="">3)
{ cout<<"Transaction denied!, Number of tries exceeded"<<endl;
exit="" (0);
="" }
=""
="" switch="" (chase.menu())
="" {="" case="" 1:
="" if(getaccount()="=1)
" if(chase.withdraw(getamount(),clientme.getchecking()))
="" cout<<"transaction="" successful!"="" <<endl;
="" else
="" cout<<"insufficient="" funds!"<<endl;
="" cout<<"your="" checking="" balance="" is!"<<clientme.getchecking().getbalance()<<endl;
="" if="" (chase.withdraw(getamount(),clientme.getsavings()))
="" successful!"<<endl;
="" savings="" is!"<<clientme.getsavings().getbalance()<<endl;
="" break;
="" 2:
="" {
="" (getaccount()="=1)
" chase.deposit(getamount(),="" clientme.getchecking());
="" is!"<<clientme.getsavings().getbalance()<<endl;="" clientme.getsavings());
="" is"<<clientme.getsavings().getbalance()<<endl;
="" 3:
="" (chase.transfer(getamount(),="" clientme.getchecking(),="" clientme.getsavings()))
="" is="" !"<<clientme.getchecking().getbalance()<<endl;
="" is!"<<clientme.getsavings().getbalance()<<endl;
="" 4:
="" chase.setcustomer(clientme,="" index);
="" chase.displaybalance(index);
="" 5:
="" chase.writecustomers();
="" cout<<"thank="" you="" for="" banking="" with="" chase!!"<<endl;
="" float="" getamount()
="" amount="0.00f;
" cout<<"enter="" of="" transaction:";
="" cin="">>amount;
return amount;
}
int getaccount()
{
int account;
do
{
cout<<"Which account would you like to withdraw from (1-Checking 2-Savings)?:";
cin>>account;
if ((account<1)|| (account>2))
cout<<"account is invalid, Try Again!" <<endl<<endl;
}="" while="" ((account<1)="" ||="" (account="">2));
return account;
}
|
|
|
|
|
The error means that the compiler can see that you've declared your intention to define a function, but cannot see the function definition. Your second include got lost, but if it's stdafx.h, anything before stdafx.h is lost, you need to include it first. Otherwise I'm not sure off the top of my head, but that is what the error means.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
How do i change the size of the split view?
I tried this.
m_splitWnd.GetPane(0,0)->SetWindowPos(NULL,0,0,10,10,SWP_NOMOVE);
m_splitWnd.RecalcLayout();
does'nt seems to work.
Anyone?
|
|
|
|
|
dumb me.
Can be done with SetColumnInfo and SetRowInfo.
Leave this thread here, just in case someone needs it
|
|
|
|
|
How could we have an object (not dynamicall created) of CFormView (and derivatives)? I've tried:
CSomeView someview;
someview.Create(...);
but they give me "An unsupported operation was attempted". Any way for me to create CSomeView manually (explicit call to Create() ) ? Or any suggestion/hack on allowing me to do this?
|
|
|
|
|
Why not just use a dialog box instead?
|
|
|
|
|
To be exact, I want it to be a child (control?) in a (well-known)CSizableControlBar derivative.
|
|
|
|
|
It should not be a problem to create a CFormView
can be seen from this example
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0998/c++0998.htm&nav=/msj/0998/newnav.htm
|
|
|
|
|
hmm... the example doesn't show me how to create a CFormView DIRECTLY... nice article though. thanx
What I want is, the CFormView is not created dynamically under a CSplitterWnd, but I want it to be under a CControlBar... and created (maybe) in OnCreate() of CControlBar by calling CFormView::Create().
|
|
|
|
|
I don't know if this of any help but I use this for create CFormView's on the fly.
<br />
<br />
#define VIEWS_RECALLING_VIEW AFX_IDW_PANE_FIRST + 5<br />
<br />
<br />
m_pRecallingView = new CRecallingView;<br />
AddView(m_pRecallingView, VIEWS_RECALLING_VIEW);<br />
}<br />
<br />
void CCTIReceptionApp::AddView(CView* pView, UINT nID)<br />
{<br />
CDocument* pCurrentDoc = ((CFrameWnd*) m_pMainWnd)->GetActiveDocument();<br />
<br />
CCreateContext newContext;<br />
newContext.m_pNewViewClass = NULL;<br />
newContext.m_pNewDocTemplate = NULL;<br />
newContext.m_pLastView = NULL;<br />
newContext.m_pCurrentFrame = NULL;<br />
newContext.m_pCurrentDoc = pCurrentDoc;<br />
<br />
CRect rect(0,0,0,0);<br />
<br />
char szTemp[64];<br />
<br />
sprintf(szTemp, "ViewList%x", nID);<br />
<br />
pView->Create(NULL, NULL,<br />
(AFX_WS_DEFAULT_VIEW & ~WS_VISIBLE),<br />
rect, m_pMainWnd,<br />
nID, &newContext);<br />
<br />
pView->SendMessage(WM_INITIALUPDATE, 0, 0);<br />
}<br />
<br />
<br />
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
I have this problem. A class I am using has using namespace std within a included header. My problem is that this class has parameters named "list" (of type string) and "vector" (float[3]) which will cause a class template error.
Rather than rename the parameters or remove 'using namespace', is there something else that I can do?
Thanks
---
|
|
|
|
|
Rather than rename the parameters or remove 'using namespace', is there something else that I can do?
No, but removing using namespace should cause no problems: simply delete this line (which is a big no-no in header files) and prefix every name belonging in the standard library with std:: . It's as simple as this.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anyone know of commercially available library that could parse incoming multi-mime HTTP posts?
Thanks,
John
|
|
|
|
|
here is a code snippet that may help you (or not...)
static char cpBoundaryTag[] = "boundary=";
static char cpContentDispTag[] = "Content-Disposition: ";
static char cpContentTypeTag[] = "Content-Type: ";
static char cpNameTag[] = "name=";
static char cpFileNameTag[] = "filename=";
BOOL WorkerThreadObj::ReadMultiPartMessage()
{
m_bIsMultiPartRequest = TRUE;
char caBoundary[256];
char *cpBoundary = strstr(m_pECB->lpszContentType,cpBoundaryTag);
if (cpBoundary)
{
cpBoundary += strlen(cpBoundaryTag);
while (*cpBoundary == ' ')
cpBoundary++;
strncpy(caBoundary,cpBoundary,255);
caBoundary[255] = 0;
cpBoundary = strchr(caBoundary,' ');
if (cpBoundary)
*cpBoundary = 0;
}
else
{
EraseContent();
StartContent();
WriteTitle();
WriteContent("Multipart Boundary String Not Found! ");
EndContent();
return FALSE;
}
BOOL bDeleteReadBuffer = FALSE;
char *cpReadBuffer = m_cpInputBuffer;
int iReqLength = m_pECB->cbTotalBytes;
if (iReqLength >= m_pLightningServer->m_iInputBufferSize)
{
bDeleteReadBuffer = TRUE;
cpReadBuffer = new char[iReqLength+1];
if (!cpReadBuffer)
{
EraseContent();
StartContent();
WriteTitle();
char caBuf[128];
sprintf(caBuf,"Unable To Allocate Memory To Read All %d Bytes of Request!",iReqLength);
WriteContent(caBuf);
EndContent();
return FALSE;
}
}
memcpy(cpReadBuffer,(LPCTSTR)m_pECB->lpbData,m_pECB->cbAvailable);
*(cpReadBuffer + m_pECB->cbAvailable) = 0;
if (m_pECB->cbAvailable < m_pECB->cbTotalBytes)
{
LPSTR cpTarget = cpReadBuffer + m_pECB->cbAvailable;
DWORD cbRemaining = m_pECB->cbTotalBytes - m_pECB->cbAvailable;
DWORD cbRead;
while (cbRemaining > 0)
{
cbRead = cbRemaining;
if (!m_pECB->ReadClient(m_pECB->ConnID,(LPVOID)cpTarget,&cbRead))
{
EraseContent();
StartContent();
WriteTitle();
char caBuf[128];
sprintf(caBuf,"Unable To Read All %d Bytes of Request!Only %d Bytes Were Able To Be Read!",
m_pECB->cbTotalBytes, m_pECB->cbTotalBytes - cbRemaining);
WriteContent(caBuf);
EndContent();
if (bDeleteReadBuffer)
delete [] cpReadBuffer;
return FALSE;
}
if (cbRead == 0)
break;
cpTarget += cbRead;
cbRemaining -= cbRead;
}
}
*(cpReadBuffer + m_pECB->cbTotalBytes) = 0;
// now, find all boundaries and split up contents
MultiPartParam *pParam = NULL;
char *cpDataStartMarker = NULL;
int iBoundaryLen = strlen(caBoundary);
cpBoundary = cpReadBuffer;
char *cpEnd = cpReadBuffer + m_pECB->cbTotalBytes;
do
{
while (*cpBoundary != caBoundary[0] && cpBoundary < (cpEnd-iBoundaryLen))
cpBoundary++;
if (!memcmp(cpBoundary,caBoundary,iBoundaryLen))
{
// found one!
if (cpDataStartMarker && pParam)
{
pParam->m_lContentLength = cpBoundary-cpDataStartMarker-4;
pParam->m_pData = (BYTE *)(new char[pParam->m_lContentLength+1]);
if (!pParam->m_pData)
{
EraseContent();
StartContent();
WriteTitle();
WriteContent(" Unable To Allocate Memory For MultiPart Parameter!");
EndContent();
if (bDeleteReadBuffer)
delete [] cpReadBuffer;
return FALSE;
}
memcpy(pParam->m_pData,cpDataStartMarker,pParam->m_lContentLength);
*(pParam->m_pData+pParam->m_lContentLength) = 0;
cpDataStartMarker = NULL;
}
cpBoundary += iBoundaryLen;
// check for terminating boundary
if (!memcmp(cpBoundary,"--",2))
break;
pParam = new MultiPartParam;
m_oMultiPartParams.AddTail((CObject *)pParam);
cpBoundary += 2; // skip past CR/LF
while (*cpBoundary != '\x0D' && *(cpBoundary+1) != '\x0A')
{
if (!memicmp(cpBoundary,cpContentDispTag,strlen(cpContentDispTag)))
{
cpBoundary += strlen(cpContentDispTag);
char *p = cpBoundary+1;
while (*p != ';' && *p != '\x0D')
p++;
p++;
while (*p == ' ' || *p == '\x0A')
p++;
cpBoundary = p;
}
else if (!memicmp(cpBoundary,cpNameTag,strlen(cpNameTag)))
{
cpBoundary += strlen(cpNameTag);
cpBoundary++; // skip past the qoute
char *p = cpBoundary;
while (*p != '\"')
p++;
*p = 0;
strcpy(pParam->m_caParamName,cpBoundary);
p++;
while (*p != ';' && *p != '\x0D')
p++;
p++;
while (*p == ' ' || *p == '\x0A')
p++;
cpBoundary = p;
}
else if (!memicmp(cpBoundary,cpFileNameTag,strlen(cpFileNameTag)))
{
cpBoundary += strlen(cpFileNameTag);
cpBoundary++; // skip past the qoute
char *p = cpBoundary;
while (*p != '\"')
p++;
*p = 0;
strcpy(pParam->m_caFileName,cpBoundary);
p++;
while (*p != ';' && *p != '\x0D')
p++;
p++;
while (*p == ' ' || *p == '\x0A')
p++;
cpBoundary = p;
}
else if (!memicmp(cpBoundary,cpContentTypeTag,strlen(cpContentTypeTag)))
{
cpBoundary += strlen(cpContentTypeTag);
char *p = cpBoundary+1;
while (*p != ';' && *p != '\x0D')
p++;
*p = 0;
strcpy(pParam->m_caContentType,cpBoundary);
p++;
while (*p == ' ' || *p == '\x0A')
p++;
cpBoundary = p;
}
else
{
char *p = cpBoundary+1;
while (*p != ';' && *p != '\x0D' && *p != ' ')
p++;
p++;
while (*p == ' ' || *p == '\x0A')
p++;
cpBoundary = p;
}
}
cpBoundary += 2;
// mark start for later extract of the data...
cpDataStartMarker = cpBoundary;
}
else
cpBoundary++;
}
while (cpBoundary < (cpEnd-iBoundaryLen));
if (bDeleteReadBuffer)
delete [] cpReadBuffer;
return TRUE;
}
|
|
|
|
|
I'm getting the following errors when I try to compile my code. I think it derives from the line #DEFINE INITGUID...
error C2065: 'GUID_NULL' : undeclared identifier
error C2440: 'default argument' : cannot convert from 'int' to 'const struct _GUID &'
Reason: cannot convert from 'int' to 'const struct _GUID'
No constructor could take the source type, or constructor overload resolution was ambiguous
error C2548: 'AtlAxCreateControlEx' : missing default parameter for parameter 6
error C2440: 'default argument' : cannot convert from 'int' to 'const struct _GUID &'
Reason: cannot convert from 'int' to 'const struct _GUID'
No constructor could take the source type, or constructor overload resolution was ambiguous
DOES ANYONE HAVE ANY SUGGESTIONS ON HOW I COULD HANDLE THIS??? SUGGESTIONS VERY MUCH APPRECIATED.
THANKS
|
|
|
|
|
Hello,
I'm using the following code fragment:
void CGoalsListView::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo=(NMLVDISPINFO*)pNMHDR;
CDC* pDC = GetDC();
...
long npixIndent = pDC->GetTextExtent(...).cx;
...
...and the pDC->GetTextExtent(...).cx seems to arbitrarily give different results after using the program for a while. At first, the program runs fine, and after clicking around the UI for a while, it this suddenly switches to another set of values and gives consistently larger (wrong) values.
Does anyone see something obvious here? Is the DC changing on me? I've debugged down to the GetTextExtent arguments and results, but not in to the GetTextExtent function.
thanks!
Jon Paul
|
|
|
|
|