|
acemahesh@yahoo.co.in wrote: "myLib" is in "myAppl" folder.
use #include ".\myLib\myLibA\yourheader.h"
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
"myLib" is in "myAppl" folder.
All the C files in myLibA and myLibB has corresponding header files. All C files have:
#include "myLib/myLibA/fileX.h"
-- modified at 2:26 Wednesday 24th May, 2006
|
|
|
|
|
acemahesh@yahoo.co.in wrote: All the C files in myLibA and myLibB has corresponding header files. All C files have:
#include "myLib/myLibA/fileX.h"
instead of above try this
#include "..\myLibA\fileX.h"
hope this works.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi All,
I want to manually refresh an item in an owner-drawn list box.
how we can do this? Calling Invalidate will redraw teh entire items I want to avoid that. pls help me in this regard.
SaRath
|
|
|
|
|
SaRath C wrote: I want to manually refresh an item in an owner-drawn list box.
how we can do this? Calling Invalidate will redraw teh entire items I want to avoid that. pls help me in this regard.
Use GetItemRect (method of CListBox ) and InvalidateRect .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
thank u for ur reply
SaRath
|
|
|
|
|
Hi,
I have dialog window in which I have a list box which contains file name as items, all these files are text files which open by default by note pad.
Along with the file name I have some offsets (location of some words in the text file), till now I have finished just opening a file I want to know is there anyway in VC++ that we can open the file and highlight those words after file opening?
I want to highlight the words in notepad or I can create a new dialog where I can display the contents of the file and highlight the words …can u please give me some information how to proceed with this work …
Regards,
Vinay Charan.
|
|
|
|
|
I think you want to search in file
whitesky
|
|
|
|
|
|
Hi WhiteSky,
Thanks for the reply....
I dont want to search in the file..
I just want to Highlight the words which are present along with the file name
Data which i have is filename & offsets (200,340,450,700 location of the words)
now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
|
|
|
|
|
Vinay wrote: I just want to Highlight the words which are present along with the file name
Data which i have is filename & offsets (200,340,450,700 location of the words)
now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
You may required hooking of the NOTEPAD.exe Application so that you can explicitly highlight the words from other application.
Because you are using ShellExecute() for opening files where you never get the Handle of the opened file.
Other way is to Use the RichEditCtrl and open the file using CFile or CStdioFile and put the contents into that RichEditCtrl and do whatever you want, as it is in your application scope..
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
When i add Rich Edit control i am getting run time error (VC++ Debug Library error) can u please tell what will the cause ...
|
|
|
|
|
vinaycool wrote: When i add Rich Edit control i am getting run time error (VC++ Debug Library error) can u please tell what will the cause ...
use following in InitInstance of the application
AfxInitRichEdit ();
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
Now i have used
CFile myFile("str", CFile::modeRead);
how to pass the contents to Richedit box ??
I have created m_FCONT of type CRichEditCtrl ..
I have no idea working with Rich Text
|
|
|
|
|
You could probably read the file into CRichEditCtrl, loop through each of your words and highlight them (make them bold, change the color, etc.) using the SetSel and SetSelectionCharFormat functions.
I don't have an example, just an idea you might be able to look into....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
In the mfc application when does the Ondraw handler gets called?
what is the significance of that?
Regards
Shikha
|
|
|
|
|
if you are referring to CView this is what I read from the docs :
Called by the framework to render an image of the document. The framework calls this function to perform screen display, printing, and print preview, and it passes a different device context in each case. There is no default implementation.
You must override this function to display your view of the document. You can make graphic device interface (GDI) calls using the CDC object pointed to by the pDC parameter. You can select GDI resources, such as pens or fonts, into the device context before drawing and then deselect them afterwards. Often your drawing code can be device-independent; that is, it doesn’t require information about what type of device is displaying the image.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Also, you might lookup WM_PAINT in the docs.
Your window will get redrawn in a number of circumstances, some that you might not be expecting, such as when you drag another window over your window, you will get numerous WM_PAINT (OnDraw) events.
Not sure why you need to know "when" it gets called, just be prepared to handle OnDraw at any time, because you never know when it will be called.
Or maybe you're wondering about the order events are fired...can't help you with that one...
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi,
I declare CObject *obj;
I get some object in it from the array of objects of one perticular type of class.
and I modify that object.
Now I want to free obj. Should I directly make equate with NULL
or delete obj;
If I delete then the original object from the array will be lost.
How to prevent such kind of memory leak?
pathak
|
|
|
|
|
pathakr wrote: Now I want to free obj. Should I directly make equate with NULL
or delete obj;
Depends! If it's created with new then use delete . Else leave it alone. Of course you can set the object pointers to NULL afterwards.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
It was not created with new.
I declare it as CObject *obj=NULL;
then from a function I assign a object pointer to this one.
but then after modifying the object i wanted to vacate this one. (obj).
thanks
pathak
|
|
|
|
|
pathakr wrote: I declare it as CObject *obj=NULL;
then from a function I assign a object pointer to this one.
but then after modifying the object i wanted to vacate this one. (obj).
Then set it to NULL .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
|
pathakr wrote: Thanks Nibu.
You have to be careful here.
An example...
CAnotherObject anObject;
CObject *pToAnObject = &anObject;
pToAnObject = NULL;
Another case...
CAnotherObject *anObject = new CAnotherObject;
CObject *pToAnObject = anObject;
pToAnObject = NULL;
delete anObject;
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks,
I understood .
pathak
|
|
|
|