|
Cool... It worked so well Thank you so much for help.
|
|
|
|
|
|
|
the decryption is wrong
1.encryption
#include<stdio.h>
void main(){
int i[4];
printf("\nEnter four digits (with a space in between): ");
for(int j=0;j<4;j++)
{
scanf("%d", &i[j]);
}
i[1] = i[1]+7;
i[2] = i[2]+7;
i[3] = i[3]+7;
i[0] = i[0]+7;
i[1] = i[1]%10;
i[2] = i[2]%10;
i[3] = i[3]%10;
i[0] = i[0]%10;
int k=0;
k = i[0];
i[0] = i[2];
i[2] = k;
k = i[1];
i[1] = i[3];
i[3] = k;
printf("\nEncrypted Data - %d%d%d%d", i[0], i[1], i[2], i[3]);
}
2.decryption
#include<stdio.h>
void main(){
int i[4];
printf("\nEnter four digits (with a space in between): ");
for(int j=0;j<4;j++)
{
scanf("%d", &i[j]);
}
int k=0;
k = i[0];
i[0] = i[2];
i[2] = k;
k = i[1];
i[1] = i[3];
i[3] = k;
for(int j=0;j<4;j++)
{
if(i[j]<7)
{
i[j]=i[j]+3;
}
else
{
i[j]=i[j]-7;
}
printf("%d",i[j]);
}
}
|
|
|
|
|
I am trying to print some data from my application.It is printing the data but the page is not coming out of the printer.Please help me on this.
<pre>HANDLE hPrinter;
DOC_INFO_1 DocInfo;
DWORD dwJob;
DWORD dwBytesWritten;
char *lpData="welcome to delopt";
char *szPrinterName="CUSTOM TG2460-H";
if( ! OpenPrinter( szPrinterName, &hPrinter, NULL ) )
return ;
DocInfo.pDocName = "My Document";
DocInfo.pOutputFile = NULL;
DocInfo.pDatatype = "RAW";
if( (dwJob = StartDocPrinter( hPrinter, 1, (unsigned char*)(LPSTR)&DocInfo )) == 0 )
{
ClosePrinter( hPrinter );
return;
}
if( ! StartPagePrinter( hPrinter ) )
{
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return;
}
int dwCount=19;
if( !WritePrinter( hPrinter, lpData, dwCount, &dwBytesWritten ) )
{
EndPagePrinter( hPrinter );
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return;
}
.
if( ! EndPagePrinter( hPrinter ) )
{
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return;
}
if( ! EndDocPrinter( hPrinter ) )
{
ClosePrinter( hPrinter );
return;
}
if( dwBytesWritten != dwCount )
return;
ClosePrinter( hPrinter );
return;</pre>
this is for dialog based application.
|
|
|
|
|
|
I have commented that but still the same.
i will explain it once again.
see when i am executing the come then after clicking on the button it is printing the message but print is not coming out of the printer. It is printing the message on the paper but the paper is not coming out of printer it is just printing the text and stopping at that particular point only.
|
|
|
|
|
You need to use your debugger to step through the code and check exactly which of the spooler functions get called, and in which order.
|
|
|
|
|
there is only one spooler function is there in the code right n if i am wrong please explain it as for the first time i am doing that i dnt have much idea about that.
|
|
|
|
|
Sorry, I have not used the spooler functions before so cannot offer any further suggestions. You could try a Google search to see if anyone has written a tutorial on the subject.
|
|
|
|
|
|
I just tried this on my local printer using TEXT mode rather than RAW and it works correctly.
|
|
|
|
|
Thank you its working just one more help can u tell me how i can format the page which i want to print.for example:
name : XYZ
age : 19
.
.
.
etc.
|
|
|
|
|
You need to put the newline characters at the end of each string thus:
"This is line 1\r\n"
"This is line 2\r\n"
etc.
However, you would get better results by doing proper GDI based printing where you can format your pages properly.
|
|
|
|
|
what i should do for formatting the page like font size,font type , print quality and how many character should be printed in that particular line.
|
|
|
|
|
|
who i can improve the print quality because the print which it is giving out is very light.
|
|
|
|
|
Like I already told you, you will have to use proper GDI printing. Alternatively, if you know postscript and your printer supports it (which it should), you can use that and send as raw data.
|
|
|
|
|
i have checked that but i have not god anything regarding the formatting of text and increasing the pixel density.
|
|
|
|
|
|
right now i it printing like
name : xyz age : 19
but i want like this
name : xyz
age : 19
how do i format that
|
|
|
|
|
i want a simple project to create a simple form in c++ which is dll file and call it on c#(Csharp).
|
|
|
|
|
I want a ferrari and a million pounds.
|
|
|
|
|
It seems like i am in wrong place where no one in serious mood. I think its not a professional forum.
|
|
|
|
|
Why?
And what does "on c#" mean?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|