|
Take file A and split into paragraphs. Search file B for each paragraph appending them to file C when not found. Swap files A & B then repeat.
You could do this in a single command line in bash I reckon.
|
|
|
|
|
Hi,
I have a windows service (system level) and a user level MFC app (non admin rights).
I need to send some notification to service from MFC app on some instance.
Is there any way to do it?
|
|
|
|
|
|
We have an application to do chemical process engineering calculations. As an inclusion, we require a graphics builder to be integrated to bring dynamics into it. So we need to develop a graphics builder kind of application.
It should have provision to create and add a new graphics pages and to save the graphics page which is to be linked to the existing application which does the calculations.
It should have a tool box with symbols of various equipments and when we drag and drop a symbol into the graphics page, it should be placed appropriately and connected to various other equipments.
Can you please suggest me how to start and proceed as i dont know how to create drag and drop graphics builder.
|
|
|
|
|
|
Is it possible to get some sample applications?
|
|
|
|
|
|
Hi
I have a number of rich edit classes in my project. Defined basically as such
class Myrich : public CrichEditCtrl they all have a default constructor with no parameters
I now wanted to extend their functionality with paging (up or down) cursor selection etc.
So I wrote a class KeyStroke. I declared KyStroke(s) in each of my classes as such
KeyStroke mykeys; in my .h class definitions. My constructer for KeyStroke takes 2
parameters the number of lines in the rich edit and a pointer to a rich edit class
So that meant I would have to modify my rich edit constructor as such
MyRich::MyRich() ---> MyRich::MyRich(int numlines, CRichEditCtrl* myrichptr) : KeyStroke(int numlines, CRichEditCtrl* myrichptr)
I am getting all sorts of errors with this such as "int" unexpected and KeyStroke no default contsructor
|
|
|
|
|
If you create a parameterised constructor for a class you must also provide a default parameterless one.
class KeyStroke
{
public KeyStroke(int numlines, CRichEditCtrl* myrichptr)
{
}
public KeyStroke()
{
}
|
|
|
|
|
I did that I am still getting errors as stated below
\progedit.cpp(13): error C2062: type 'int' unexpected
1> progdialog.cpp
while intellsense says class KeyStroke
"KeyStroke" is a nonstatic data member or base class of class Cprogedit
I have KeyStroke in Cprogedit.h as KeyStroke mystroke; in the public section of the class
I have defined a constructor for Cprogedit which will provide the paramters for Keystroke
as such
CProgedit::CProgedit(int numlines, CProgedit* editptr) : KeyStroke(int numlines, CProgedit* editptr)
KeyStroke::KeyStroke()
{
}
KeyStroke::KeyStroke(int numlines, CRichEditCtrl* editptr)
{
max_line = numlines;
edit_ptr = editptr;
}
|
|
|
|
|
Sorry, I cannot make head or tail of that. Can you show the class definition for Keystroke and indicate exactly where the error message occurs?
|
|
|
|
|
Not home now Dr appt but I'll paste the entire output in about 1 and 1/2 thanks so so so much
|
|
|
|
|
Richard, Richard Andrew X64 got me pointed in the right direction
For the Class Declaration
KeyStroke mykeys;
inside
class Cprogedit : public CrichEditctrl
this was the necessary constructer
CProgedit::CProgedit(int numlines, CProgedit* editptr) : mykeys(numlines, editptr)
|
|
|
|
|
ForNow wrote: CProgedit::CProgedit(int numlines, CProgedit* editptr) : KeyStroke(int numlines, CProgedit* editptr)
This is a problem. While you're declaring the CProgedit constructor on the left-hand side, the part on the right-hand side is actually a call, so you wouldn't put the data types of the aguments. In other words, try the following:
CProgedit::CProgedit(int numlines, CProgedit* editptr) : KeyStroke(numlines, editptr)
Let me know if this helps.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard
Thanks almost I got a compiler error saying KeyStroke not a member ... and that's right KeyStroke was a type as I declared KeyStroke mykey. However when I declared I got a clean build
CProgedit::CProgedit(int numlines, CProgedit* editptr) : mykey(numlines, editptr)
|
|
|
|
|
I'm glad you got it fixed.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
KeyStroke mykey; defined in Cprogedit.h
CProgedit::CProgedit(int numlines, CProgedit* editptr) : mykey(numlines, editptr)
KeyStroke::KeyStroke(int numlines, CRichEditCtrl* editptr)
Cprogedit* myrich = new Cprogedit((int) 30, myrich);
DO you think this will work. What I mean is the two parameters are being passed to KeyStroke
but will myrich have a vaule before KeyStroke constructor is called
|
|
|
|
|
I think that will definitely not work. Because it passes an uninitialized value into the constructor before it returns the new pointer.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is there any way this is do-able
What I mean by that is I am sure you know MFC internals better than me does get the storage
for the Object class BEFORE it calls one or all of the member classes/object in the class
For some reason I thought that it did
|
|
|
|
|
I don't know what to tell you because you need to explain what you are trying to accomplish.
If we can talk about what you want to accomplish, then we can probably find a solution.
Why do you think you need to do it this way?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I wrote a number of rich edit classes after finishing I realized they would all have common functionality
1) processing KeyStrokes
2) cursor select
3) Finding data
I decided to encompass all of this in a class called KeyStroke which would expand functioality on a EditCtrl object
so I declared KeyStroke mykey1; etc; 2 3 ...
The constructor of KeyStroke takes a RicheditObject it was my understanding that when "new" build a class/object the First thing it does is allocate storage for the class/object and then
call member classes which is why I thought this was doable
Thanks
|
|
|
|
|
If you do,
CObject* ptr = new CObject();
It performs that in two steps:
1. Calls the CObject constructor
2. Then it assigns the instance to the ptr
ptr is uninititalized when the CObject constructor is called. It's not initialized until after the constructor returns.
It might allocate the memory for ptr before it calls the constructor, but it does not contain a useful value. It's uninitialized until the assignment occurs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thanks I think the only other way I Might ? be able to do what I want is use the "this" pointer
Assuming that KeyStroke is a Abstract Object used within the context of Cricheditctrl
The this pointer would be that of the CRicheditctrl
I can set a breakpoint inside the KeyStroke constructer check the "this" value
and check "myrich =" pointer afterwards to see if they are the same value
otherwise I guess I would set the richedit ptr after I allocate the object
thanks
|
|
|
|
|
In the KeyStroke Contructor
I cast a "this" pointer to CRicheditctrl * and I wrote down the address
I then observed Cricheditctrl pointer assigned after the new and it was the same address
i'll cut and paste the code for more clarity
KeyStroke::KeyStroke(int numlines, CRichEditCtrl* editptr)
{
max_line = numlines;
edit_ptr = editptr;
edit_ptr = (CRichEditCtrl*)this;
}
myedit = new CProgedit((int)30,myedit);
|
|
|
|
|
A common solution to add such functionality is adding a KeyStroke member to your Rich Edit derived class and pass the this pointer to the member:
class MyRich public CRichEditCtrl
{
public:
MyRichyRich(int numlines);
KeyStroke m_KeyStroke;
};
MyRich::MyRich(int numlines) :
m_KeyStroke(numlines, this)
{
} But this will generate a C4355 warning. To avoid that, you can make the KeyStroke member a pointer and allocate it in the constructor:
MyRich::MyRich(int numlines)
{
m_pKeyStroke = new KeyStroke(numlines, this);
} or provide an initialisation function:
MyRich::MyRich(int numlines)
{
m_KeyStroke.Init(numlines, this);
}
Your problem is not the error message from the subject but that you want to access your Rich Edit object before it is created (and did not use this instead).
|
|
|
|