|
No probs.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello.
How i can print (ex. as pdf) with:
1. unicode support font (ex. farsi language)
and
2. insert bitmap file
with vc++ 6.0 ?
|
|
|
|
|
You can't create/print a PDF file from VC++ out of the box, you will either need a third party PDF writer library OR a PDF printer driver (like CutePDF[^]).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello,
no i don't want print directy pdf file,
now i install pdf distiller & have pdf driver - ok -
but when print my string with _T("") macro, print bad words !!!
My sample, use from class QPrint Code Project.
http://www.codeproject.com/KB/printing/QPrint.aspx?fid=301520&select=2885714&fr=1
for example:
CQPrint m_ocQPrint;
m_ocQPrint.Print(hFont,_T("محمد"),FORMAT_NORMAL);
but print bad-words - i found printing text out in CQPrint::Print function & with this code:
// now print the text...
m_DC.TextOut(lx,m_y,strSubText);
if (!(Format & FORMAT_NOLF)) {
m_y += Size.cy + CALCY(m_Abstand);
}
|
|
|
|
|
I see...i'm not sure but i guess you need the right font to be able to print this, in your TextOut aproach, try instantiating a CFont object, use e.g. CreateFontIndirect[^] to create a font that fits your needs, select it into the DC and then try to print your text.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
|
Maybe you also need to specify the charset for the font. If you used CreateFontIndirect then you specified it a LOGFONT struct, check out the documentation what it says about the lfCharSet member.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Excellent ............... it worked, .............
character set in old ANSI_CHARSET and i change it to ARABIC_CHARSET
I want have your E-mail, my email is mohammadmot@yahoo.com
I am hardware programmer with vc++ 6.0 .
|
|
|
|
|
Great!
Well, i don't give out my email address that easily, i get enough unwanted mail already. But if you want you can contact me thorough codeproject, i believe that is possible.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi All,
I have two dialogs(IDD_DIALOG,IDD_DIALOG1).How to hide and show these dialog.
|
|
|
|
|
I assume you have modeless dialogs, in which case simply use ShowWindow[^]. If this doesn't answer your question, please give us more info about your problem.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I did like this.
this->ShowWindow(SW_HIDE);
CMyDlg *NU = new CMyDlg();
NU->ShowWindow(SW_SHOWNORMAL);
But it showing debug Assertion error.
|
|
|
|
|
I think you either need something like this:
CMyDlg Dlg;
Dlg.DoModal();
or something like this:
CMyDlg *Dlg = new CMyDlg();
Dlg->Create(IDD_DIALOG, NULL);
Dlg->ShowWindow(SW_SHOW);
Of course you need to pay atention at deleting your dialog once you are done with it if you created it with new...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I dont need to create the dialog again. I need to show the hidden dialog.
Pls help me....
|
|
|
|
|
Ok, to clear out misunderstandings, show me how you created your dialogs. If you created both dialogs then you need to call ShowWindow(SW_SHOW) or ShowWindow(SW_HIDE) on the instances of the classe you already created, not on a new instance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
AnithaSubramani wrote: But it showing debug Assertion error.
Don't keep us in suspense. What line of what file asserted?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
Hello,
I'm new in Visual C++.I want to convert row elements from two dimensional array to one dimensional arrays.I wrote Visual C++ function to do this.This function has only one input parameter.Input parameter is two dimensional array.Firstly I tried to copy first row elements of input two dimensional array to one dimensional array in this function.One dimensional array will have been output parameter of function.But it didn't work.
The code is below:
// Temp is one dimensional array its length is 512
// Input paremeter is two dimensional array its width is 512 ,height is 512
// I want to copy first row elements of input two dimensional array to one dimensional array.
array<double>^ fonksiyon (array<double,2>^dizi )// The function
{ array<double>^ temp=gcnew array<double>(512);
Array::Copy(dizi,temp,512);
return temp;// return one dimesional array
}
Could you please help me ? Best regards...
|
|
|
|
|
You might get better help in the (Managed) C++/CLI one [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
emira67 wrote: Could you please help me ?
Only if you don't mind an unmanaged answer:
for (int x = 0; x < 512; x++)
copy 2D[0][x] to 1D[x];
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
i m taking help of this article for printing in my application.
http://www.codeproject.com/KB/list/listprintdemo.aspx[^]
its working fine,there is only on problem if the Text of ListCtrl item is greater than the width of Rect,than the full text not displayed or not print.
i m already ask this problem to the author of article but he did not respond me, so please help me for this.
i m doing one thing i m extracting the long string in multiple parts according to Rect width and fit it to multiple lines,by this the full text is displayed and print but its only working for first page.
text not displyed on second or other pages.
if u have any other option please tell me.
please provide me any code or example for this.
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
A long time ago I wrote this article http://www.codeproject.com/KB/printing/printlongtext.aspx[^] which splits a single string across multiple pages.
Its probably still ok. If you get stuck I may be able to help with replies. But its a last ditch thing for me as I dont get much spare time at work atm due to a heavy schedule.
I really shouldn't be replying atm as the Mrs is getting mad at me.
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks alot, this article really helps me.
but you can only use single string.
in my application i m using a list control and print its.
initially how can i clculate the total number of pages,becuse string for diffrent list item if of diffrent length.
provide me any guiide or help for this.
thank in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
1. I try to print text with this macro _T("") 'UTF-8' with this code:
// use CQprint class codeproject;
CQPrint m_ocQPrint;
m_ocQPrint.Print(hFont,_T("محمد"),FORMAT_NORMAL);
but print bad-words - i found printing text out in CQPrint::Print function & with this code:
// now print the text...
m_DC.TextOut(lx,m_y,strSubText);
if (!(Format & FORMAT_NOLF)) {
m_y += Size.cy + CALCY(m_Abstand);
}
if can soulve the problem with 'DrawText' Api Function ???
what's the solution ?
/////////////////////////////////////////////////////////////
2. I want print bitmap file & have problem then wrote this function
// Print path of bitmap file.
int CQPrint::InsertBitmap (CString StringPath, int ResColor, int fmt, CSize *dest, int left)
this is same InsertBitmap orginal function but change :
this part: ------
// load the bitmap from the resource
if (bmp.LoadBitmap (resbit) == 0) {
m_LastErrNo = PRERR_LOADBITMAPFAILED;
return (-1);
}
to: ------
if (StringPath.IsEmpty())
StringPath = "chart.bmp";
HBITMAP m_hBmp = ( HBITMAP )LoadImage( 0, StringPath, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
bmp.Attach(m_hBmp);
it't work but picture print tall, then change size to:
CSize size[1];
size[0].cx = 1600;
size[0].cy = 77;
m_ocQPrint.InsertBitmap("chart.bmp", IDB_BITMAP__CHART, FORMAT_CENTER, size);
but now a little stretch, what's the solution ?
/////////////////////////////////////////////////////////////
thanks.
|
|
|
|
|
1:i made a constructor in class (at c++ )
cart(char a[2]){a[2]=('p','a','q');
cout << a[0]<<a[1]<<a[2];};
and i call it in main function like this:cart x;
i have this error in this line :cart x;
error C2512: 'cart' : no appropriate default constructor available.
2:i made some function in my class(c++)like this:
char left()
{
char a[2];
swap(a[0],a[1]);
for (int b=1;b>=2;b++)
cout << a[b];
return 'L';
};
but it didn't swap 2 char.and this function didn't use that variable in my constructor (char a[2]).
i hope can explain well.
|
|
|
|