|
You can try like this
CImage m_Image;
m_Image.Load(filename);
m_Button.SetBitmap(m_Image.Detach());
|
|
|
|
|
CImage' : undeclared identifier what is a problem
#include <afxcmn.h>
#include <afxstr.h>
#include <atlimage.h>
I have the added these header files but
afxstr.h no such file or directroy
|
|
|
|
|
I dont know you include this file or no AtlImage.h
|
|
|
|
|
|
hi all
this is the code to fetch data from mysql using vc++
but my problem is that data is not shown in info which i declare as cstring as
mysql return data in string
evrything is ok
but data is not shown in info variable please help me
GetDlgItemText(IDC_EDIT1,f);
info = select ID from login where name = \'" + f + "\'";
if ( ! mysql_query( myDB, info) )
{
res = mysql_store_result( myDB );
row = mysql_fetch_row( res );
}
thanks
hi
|
|
|
|
|
Hi to all
i want to make a windows service using the wxwidget but i not getting thru i found the following http://danny.ronyao.com/modules/newbb/rss.php?f=17[^]
but i not getting thru compiling it does anyone know how to do it or does anybody have it compiled that could e-mail it to me?
|
|
|
|
|
seneralex wrote: but i not getting thru compiling it does anyone know how to do it or does anybody have it compiled that could e-mail it to me?
better ask it in wxwidget forums...
"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
Support CRY- Child Relief and You
|
|
|
|
|
|
Hi,
I require a basic reporting tool having capabilites to display charts. Any idea?
-Piyush
|
|
|
|
|
|
Do send a link when you find the cart-wheeling green eyed blond!
re reporting, one can also us Crystal Reports COM objects - the designer is not free, I think the rest is distributable...
|
|
|
|
|
Hi all,
I has been created one MFC extension dll called SRecordset.dll,which has been one .h file and one .cpp file
my dll .h file..
#pragma once<br />
#include afxdb.h<br />
<br />
<br />
class AFX_EXT_CLASS SRecordset : public CObject<br />
{<br />
DECLARE_SERIAL(SRecordset)<br />
<br />
<br />
public:<br />
SRecordset(void);<br />
<br />
public:<br />
~SRecordset(void);<br />
<br />
protected:<br />
CStringArray saDataContainer;<br />
short iNumFldCount;<br />
long iNumRec;<br />
int iRecCount;<br />
int iTotalSize;<br />
int iRecordState;<br />
int iLocalIndex;<br />
public:<br />
BOOL SSOpen(CDatabase &dbConnectedObj,CString sQuery);<br />
BOOL SSIsOpen(void);<br />
void SSClose(void);<br />
public:<br />
BOOL SSIsBOF(void);<br />
BOOL SSIsEOF(void);<br />
public:<br />
void SSGetFieldValue(int iIndex,CString &FldValue);<br />
short SSGetFieldCount(void);<br />
long SSGetRecordCount(void);<br />
long SSGetCurrentRecordCount(void);<br />
public:<br />
void SSMoveNext(void);<br />
void SSMovePrevious(void);<br />
void SSMoveFirst(void);<br />
void SSMoveLast(void);<br />
public:<br />
virtual void Serialize(CArchive& ar);<br />
};
I has been created my dll successfully. But, it won't support to the client application,it will be thrown only one linker error, when i call rather the SSOpen(CDatabase &dbConnectedObj,CString sQuery) function only, not other function calls from my above the class during the runtime.
Here the part of code from my client app...
void CtestingDlg::OnBnClickedOk()<br />
{<br />
<br />
<br />
CDatabase db;<br />
CString sIp,sDb,sPwd,sConn,sPort,sUn;<br />
sIp="192.168.2.17";<br />
sPort="5432";<br />
sPwd="fasp";<br />
<br />
<br />
try<br />
{<br />
sConn = "DRIVER={PostgreSQL ANSI};SERVER=" + sIp + ";port=" +<br />
sPort + ";DATABASE=" + sPwd + ";UID=" + sPwd + "WD=" + sPwd + ";";<br />
db.OpenEx(sConn);<br />
AfxMessageBox("Success");<br />
}<br />
catch(CDBException *e)<br />
{<br />
MessageBox("Database Connection Refused."+e->m_strError,"DataBase<br />
Connection Error",MB_OK|MB_ICONERROR);<br />
e->Delete();<br />
<br />
}<br />
<br />
<br />
SRecordset set1;<br />
<br />
set1.SSOpen(db,"select name from master;");<br />
set1.SSGetFieldCount();<br />
set1.SSGetRecordCount();<br />
set1.SSClose();<br />
<br />
OnOK();<br />
}
where set1.SSOpen(db,"select name from master;"); is the problem
Error is.....
testingDlg.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall SRecordset::SSOpen(class CDatabase &,class ATL::CStringT > >)" (__imp_?SSOpen@SRecordset@@QAEHAAVCDatabase@@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function __catch$?OnBnClickedOk@CtestingDlg@@QAEXXZ$0
please note that my class is derived from CObject class meanwhile CDatabase is also derived from CObject class...i think may be this is the reason for my problem?
please help me!
|
|
|
|
|
Did you provide a body for this function ?
|
|
|
|
|
yah sure..
this is my function body..
IMPLEMENT_SERIAL(SRecordset,CObject,VERSIONABLE_SCHEMA | 2)<br />
<br />
BOOL SRecordset::SSOpen(CDatabase &dbConnectedObj,CString sQuery) <br />
{<br />
if(!dbConnectedObj.IsOpen())<br />
return FALSE;<br />
<br />
CRecordset rsObject(&dbConnectedObj);<br />
<br />
CString sValue;<br />
<br />
if(!rsObject.Open(AFX_DB_USE_DEFAULT_TYPE,sQuery)) <br />
return FALSE;<br />
<br />
iNumFldCount = rsObject.GetODBCFieldCount(); <br />
<br />
iNumRec = 0; <br />
<br />
while(!rsObject.IsEOF())<br />
{<br />
rsObject.MoveNext(); <br />
iNumRec++; <br />
}<br />
<br />
iTotalSize = iNumFldCount * iNumRec; <br />
<br />
saDataContainer.SetSize(iTotalSize); <br />
<br />
rsObject.MoveFirst();<br />
<br />
iRecCount = 0;<br />
<br />
while(!rsObject.IsEOF())<br />
{<br />
for(int ic=0; ic < iNumFldCount; ic++)<br />
{<br />
sValue = "";<br />
rsObject.GetFieldValue(ic,sValue);<br />
saDataContainer[iRecCount] = sValue; <br />
iRecCount++;<br />
}<br />
<br />
rsObject.MoveNext();<br />
}<br />
<br />
rsObject.Close();<br />
dbConnectedObj.Close();<br />
return TRUE;<br />
<br />
}
|
|
|
|
|
I am not sure: check that for both projects you are using the same unicode settings (unicode needs to be defined for both or for none of them). Maybe it is due to the fact that for one of the project, CString will be defined as CStringA (non unicode) and for the other, CString will be defined as CStringW (unicode). Thus, a linker error.
But I'm not sure at all.
|
|
|
|
|
ok fine you are correct my dll is unicode character set but my client is non unicode set,now its working fine. thank you.
-- modified at 6:07 Thursday 10th May, 2007
|
|
|
|
|
I am attempting to POST to a HTTPS server all is apparently S_OK but I get a STATUS code returned of 12019 and no ResposeText! Is this because MS XMLHTTP40 does not cater for certificates? If so any idea how I can POST my XML to the HTTPS server and successfully receive responses???
|
|
|
|
|
I have added:
hr = pXMLHTTPReq->setOption( (MSXML2::SERVERXMLHTTP_OPTION)2, 13056 );
and now get the following response:
<code>STATUS CODE: 405
Response Text: <HTML><HEAD><TITLE>Method Not Allowed</TITLE></HEAD><BODY><H1>Method Not Allowed</H1>An error occurred.</BODY></HTML>
All Response Headers: Server: Sun-ONE-Web-Server/6.1 Date: Thu, 10 May 2007 10:10:58 GMT Content-length: 124 Content-type: text/HTML Allow: Head, GET Connection: close</code>
I would very much appreciate if anyone could shed any light on how to resolve this.
|
|
|
|
|
This is getting rather anoying!
I have changed:
hr = pXMLHTTPReq->open( "POST", bstrURL, VARIANT_FALSE );
to:
hr = pXMLHTTPReq->open( "post", bstrURL, VARIANT_FALSE );
This changes the returned STATUS code from 405 "Method Not Implemented" to 501 and the resposeText I now get is: "This server does not implement the requested method". How else other than using the "post" method do we SEND XML to a HTTPS service?
|
|
|
|
|
i got crash when tried to close the dialog which is called by domodal
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
How are you trying to close it?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Can you show code snippet that you got error?
|
|
|
|
|
yes this is the code
BOOL CMyConnCustomInstall::OnCUSTInstall()
{
int MyConnecCheck = 0, ChatCheck = 0, PwdMgr = 0, Response = 0, nStatus = 0;
int EKMyConnDLSuccess = 0, EKChatDLSuccess = 0, EKPwdMgrDLSuccess = 0;
CFileOperation *fileOpr = new CFileOperation();
m_Downloading = 1;
BeginWaitCursor();
if(m_Ekpass==1)
{
//Check if the Tools are already installed
PwdMgr = ToolExistCheck(EKPWDMGR, "EKPassword Manager");
//Downloading
if(PwdMgr)
EKPwdMgrDLSuccess = Download(EKPWDMGR, "EKPassword Manager");
//Installing
if(PwdMgr && (EKPwdMgrDLSuccess == DLSUCCEED))
{
nStatus = InstallTools(EKPWDMGR, "EKPassword Manager");
if(nStatus == DLSUCCEED)
InstallPackages(EKPWDMGR, "EKPassword Manager");
}
this->EndDialog(0);
}
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Why you use of this code
CFileOperation *fileOpr = new CFileOperation();
|
|
|
|
|
Hi,
have you tried to insert your own "stop"-points with AfxMessageBox () to see where it exactly crushes?
And, on the other hand...
this->EndDialog(0);
void EndDialog( int nResult );
Parameters
nResult: Contains the value to be returned from the dialog box to the caller of DoModal.
Why don't you use a simple "return 0;" ??
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|