|
Hi All,
I have .Prn file which was generated out of PCL printer.I need to find a string in that file and then I have to replace it with another string.
Iam able to do it by using stream writer,streamreader,Binary reader,binary writer and file streams.
But if gave a print(LPR)for it, it get failed and giving me syntax error as Illegal tag.
If I print original file it is printing very well.
I came to know that while writing it has lost some of its originality ,so it was failed
Please help me
Thanks in advance
|
|
|
|
|
It sounds like you've done more than just changing the string. I don't know about the format, but maybe just before the string is a tag describing the string and its length?
Try replacing just one character in the string - or maybe make one already there be in upper instead of lower case.
Yours experimentally,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
Thanks for the reply,
The original file size is like 16k, after the editing it becoming as 22k..
more over it is not normal file,It is a file generated by PCL printer.
So may be during the conversion it is losing printer supported font.
so that's the reason printer cannot understand the file(after editing)to print.so it gives syntax error as Kernel and Illegal tag error.
I have no clues to overcome this problem
kindly help me
|
|
|
|
|
If the size is changing from 16k to 22k, you're doing a lot more than swapping a string!
Just try with baby steps. Tweak one little bit, test, tweak a bigger bit, test, and so on.
I've no idea about the format either - this is just general advice.
It's worth jumping in the deep end sometimes, but other times you just dip one toe in the water.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi all
I am having a C++ class and in that some functions are also there.One variable i want to use in a function only.So i can declare it inside that function or as a member variable.
Variables declared in a function will be saved on the stack but what about member variables.
Which way should be more efficient.
Can anybody help me to show some good articles in good programming practices.
Thanks and regards
Deepu
|
|
|
|
|
Where member variables are stored will depend upon how the class is instantiated.
If an object of the class is created on the stack, the member variables will also reside on the stack.
If the object is created on the heap, the member variables will also reside on the heap.
If a variable is used only within a function, you should declare it within that function itself.
And if you want the value retained across function calls, then declare it static.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Hai !
There is a global byte pointer in my apllication, I donot know its size,
is there any inbuilt function in MFC to know its length similiar to GetLength () for strings !!
thanks!
|
|
|
|
|
If the pointer points to a NULL terminated string you can use strlen .
If it points to some binary data, there is no way to get the length.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Does it point at a dinamically allocated block? If you allocated it with malloc, you can try to use _msize[^] to get the size.
> 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 ve a small doubt.
Suppose i ve a class like
class A
{
public:
void F();
}
class B:public A
{
public:
virtual void F();
}
My requirment is that whenever i'll call F() of class B it should execute F() of B followed by F() of A
i wrote like
vod B::F()
{
/// doing sm thing
A::F();
}
IS this correct?
is theree any other way to do this?
Regards
Phillip
Regards
Phillip
|
|
|
|
|
You're doing it just fine. One small question: why is F virtual in B but not in its base A ?
Steve
|
|
|
|
|
Hi. Thanks for the reply.
Actually i faced this question in one interview. I gave same answer but the interviwer was unhappy with the answer. she told me it c'd b done in better way.
Regards
Phillip
|
|
|
|
|
Perfect!!!
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
In case if you are trying for chain of events, I'd suggest the below one. I just typed it for fun, so don't look at the convections
class base
{
public:
base* m_p;
std::string m_st;
base(std::string st):m_st(st),m_p(NULL)
{
}
void setRoot(base* p)
{
m_p = p;
}
void execute()
{
cout<<m_st.c_str()<<endl;
if(m_p)
{ m_p->execute();}
}
};
You don't need to derive & create a separate classe, just try this:
base b("Code");
base b2("Project");
base b3("Bob");
b2.setRoot(&b);
b3.setRoot(&b2);
b3.execute();
might look like the responsibility pattern, but not exactly, it's Vunic's custom patter .
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I want the code for soundex algorithm which is used for the spell checking compatible for front end in ASP and back end in C#
|
|
|
|
|
Well, what to say...Good luck and enjoy the experience.
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]
|
|
|
|
|
priyanka narkhede wrote: for front end in ASP and back end in C#
So, that's why you post your question in the C++ forum. That makes sense, everybody knows that C++ is a mix between ASP and C#
|
|
|
|
|
Hmmmm - now what[^] websites[^] could POSSIBLY help you...
Open your eyes - maybe your mind will follow.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Please let me know how can i use CCheckListBox class bcos when i tried to use im getting Debug Assertion failed...
when i had a look it was mentioned that this class is owner drawn...
So please let me know how can i use it...
|
|
|
|
|
|
thanks for ur link.....it"s working.....
|
|
|
|
|
OIOIC is a completely new object-oriented mechanism for the C programming language.
Please download the "OIOIC-Primer-2nd-Edition.tar.gz" (an English version in it.)
http://code.google.com/p/oioic/downloads/list
Welcome your advice!
Using OIOIC, you can describe the flower, birds, grass, insects, trees, houses ...
Using OIOIC, you can describe the elements, atoms, protons, electrons ...
Using OIOIC, you can describe the earth, the sun, the Milky Way galaxy, collapsar ...
Using OIOIC, you can describe ...
1. OIOIC perfectly supplies the gap of object-oriented technology for the C programming language;
2. OIOIC perfectly solved the multiple inheritance problem in the Software World;
3. OIOIC perfectly objectivizes multithreading access control of object;
4. OIOIC unifies the norm of components in the Software World;
5. OIOIC unifies the structure of code tree in the Software World;
6. OIOIC unifies the thinking of object-oriented programming in the Software World;
7. OIOIC unifies all advanced programming languages in the Software World, to make the C programming language as the preferred.
|
|
|
|
|
Please don't spam the message boards.
|
|
|
|
|
I voted to remove your message yesterday, and I'm voting again today.
And apparently you're spamming other message boards.
If this is an advert for a commercial product, you should be paying codeproject properly to put it in front of out eyes.
If it is a project you've created, and want other people to know about, how about writing an article about it? Show us a useful application. Show us a real world problem this solved.
We're used to alphabet soup of multiletter acronyms, but they're usually only 3 letters long.
As for "...you can describe the flower, birds, grass, insects, trees, houses...", it sounds like Poetry SDK to me, and we've had that for 1000's of years.
If this is your result of years of hard work, I congratulate you, but spamming our message boards is not the way to make friends and influence people.
I wish you luck in the correct venue(s),
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|