|
|
sBuf is not a c string as it has the member function Format - It's probably a CString . As such it has an assignment operator which takes a c string. The code I submitted should work and there is no need for strcpy .
Steve
|
|
|
|
|
|
And what are you trying to do ? The %s in the Format functions specifies that the function expect a string, and you supply it with a char. Change it to:
sBuf.Format("%s",mychar);
|
|
|
|
|
Joy Anne wrote: char mychar[4] = {65, 97, 62, 0};
sBuf.Format("%s",mychar[0]);
sBuf.Format("%c, %c, %c, %c", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
sBuf.Format("%d, %d, %d, %d", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
sBuf.Format("0x%X, 0x%X, 0x%X, 0x%X", mychar[0], mychar[1], mychar[2], mychar[3]);
Maxwell Chen
|
|
|
|
|
|
|
WhiteSky wrote: for(int i=0;i<3;i++)
sBuf.Format("%c",mychar[i]);
AFAIK, this will overwrite sBuf three times, and is equivalent to
sBuf.Format("%c",mychar[2]);
~RaGE();
|
|
|
|
|
its only example for %c and %s.%c isnt problem
(sBuf.Format("%s",mychar[0]);)
<br />
Maxwell Chen<br />
sBuf.Format("%c, %c, %c, %c", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
|
|
|
|
|
I'd like to create dialog box with completed fields...
write smth like this
class CDlg:public CDialog{
public:
CDlg(UINT nRes, CWnd *pParent,int nIndx=-1);
DECLARE_MESSAGE_MAP()
afx_msg void OnOk();
};
CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) {
if(nIndx!=-1){
CPerson* pers=(CPerson*)ob_arr[nIndx];
AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK
SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156
}
}
|
|
|
|
|
NoName II wrote: CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) {
if(nIndx!=-1){
CPerson* pers=(CPerson*)ob_arr[nIndx];
AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK
SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156
}
Do the initialization part in OnInitDialog . Do not do this in the construtor.
Nibu thomas
Software Developer
CPP Faqs by Michael dunn
|
|
|
|
|
how can I send nIndx in OnInitDialog?
|
|
|
|
|
Use an Init function for these kind of initialization purposes.
NoName II wrote: how can I send nIndx in OnInitDialog?
Store the nIndx as a member variable or store the person object as a member variable of the dialog class.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
|
Hi,
I have these coding in my vc++ project.In this,bitmap m_pdib is converted in to jpeg and this jpeg image is shown in the videoplayer.
m_pdib.GetJpgData(1,true);
m_pdib.DispTODC(1, true);
I want to store this converted jpeg image into a file.How to create a file and store this jpeg image
sunita ramesh
-- modified at 3:09 Friday 5th May, 2006
|
|
|
|
|
|
I have a newly desinged cam file in which image files are stored in the form of bitmap.This bitmap is retrived & converted in to jpeg image and then it is displayed in the video player.(it is an Active control ).
Everytime to play the video,i call this function,Playwave(int picno).
for displaying this image,i call m_pdib.GetJpegData(1,true) and m_pdib.DispTODC(1,true).
I want to store this jpeg image in a folder.
How to do that.
sunita
|
|
|
|
|
If you could put the image on a DC or on a CBitmap object you can solve your problem using the class CImage . It has the Save function that automatically convert the image in many file format (jpg gif png bmp).
Hope this helps.
|
|
|
|
|
thanks for ur reply.
Do i need to add class cImage.
How to do this..
Can u please explain me in detail.
sunita ramesh
|
|
|
|
|
DEFINE_GUID(ImageFormatJPEG, 0xb96b3cae,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
CImage m_Image;
m_Image.Attach(hbitmap handle);
m_Image.Save(yourfile,ImageFormatJPEG);
m_Image.Detach();
|
|
|
|
|
I think your problem is write file(jpeg)
But I suggest if you can convert bitmap to jpeg use to write data jpeg to file instead use CImage
|
|
|
|
|
thats wat my problem.
Can u please explain how to put jpeg data in a file.
sunita ramesh
|
|
|
|
|
|
Thanks for ur reply
Already I display the image using
m_pdib.GetJpgData(1,true);
m_pdib.DispTODC(1,true);
1 is nothing but jpeg image1.similarly if i put 2 means i get second image.
So can't i able to store this image in a file by adding few lines instead of using a new class.
sunita ramesh
-- modified at 5:43 Friday 5th May, 2006
|
|
|
|
|
Every body knows Outlook.pst file stores person folders
info. But how to read the contents of this binary file in
order to know how many folders under the personal folders
and what are their names? If anybody knows please help me?
knarasimharao
|
|
|
|