|
|
chandu004 wrote: what i want is, i should not be able to delete it from windows.
I personally would be extremely annoyed by a file on my I could not delete.
I would insert considerable energy in *getting* it deleted - up until formatting and reinstall, because I would immediatly suspect either a trojan or SONY and its infamous rootkits behind that.
Tweaking permissions is OK, though. I *COULD* technically get the rights to delete the file, but the file has "Do not delete me!" printed in big red letters on the surface.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
do you remember how to do a dos lock,
some clues i could recall.
we used something like >ren [filename] [alt+some numbers]
some thing we used to do. but now it is not working.
can you guide me in this regard also.
thank you.
|
|
|
|
|
hi all,
what is the function of CMainFrame::GetActiveFrame() function
thanks
panthal
|
|
|
|
|
|
hi,
yes, what is the function of CFrameWnd::GetActiveView
i got some code from your link, but what does it means,
what is the use of this function
thanks
panthal
|
|
|
|
|
panthal wrote: what is the use of this function
can't you just read the doc ????????
"Call this member function to obtain a pointer to the active multiple document interface (MDI) child window of an MDI frame window.".
So, you use this function only in a context of a Multiple Document application. then, you call GetActiveView() to get the active View. you get it now ?
|
|
|
|
|
I have a complex problem with my C++ application. To explain it better I have made a diagram(UML) which explains the problem better.
http://prasna991.googlepages.com/stuck.gif[^]
Classes are a1,a2,b1,c1 and Rel
b1 inherits a1 and a2
c1 inherits b1
Class a2 holds a pointer to object of type Rel
and has functions setR() and f1()
Class Rel holds a pointer to object of type b1. and has the given constructor which takes a pointer to b1 and update function which takes a void pointer.
CURRENT STATUS :-
Dubugger shows that There is a difference of 4 bytes between memory locations of b1 & tb1 if i put a breakpoint in update function.
eg...
b1 - a0cb0930
tb1 - a0cb0934
or vice versa i think.
|
|
|
|
|
You'll probably need to fix the errors in the UML posted before anyone can really answer this. the '.' operator doesn't work on intrinsic pointers, tb1 needs declaring etc. Some idea of why you want to compare the two pointer values, i.e. what's the goal beyond understanding inheritance would also be useful.
In the end I suspect you're just comparing two different pointers, possibly even by looking at the consecutive addresses where they are stored rather than their values. What you've done isn't really clear enough to be certain though.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I have corrected the diagram where tmp pointer is used and used actual C++ code now.
Please help me
|
|
|
|
|
Ok there's still an issue with if(tmp==b1) rather than if(tmp==obj_b1) but assuming that is just a typo my bet would be on the multiple inheritance causing an offset between what a2 thinks the value of this is and what a b1 pointer would be pointing at. A couple of things to try, instead of passing a void pointer to update try a a2, try making this a single inheritance hierarchy by deriving a1 form a2 or otherwise.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi thank you very much for replying.
I have corrected the problem. (Just inverted the triangles)
What I gave in the UML Diagram is just a kinda semi-pseudocode...
The program compiles and excecuted with no errors...
I am trying to develop a CAD Application with some complex relationships between the shapes
with GOF Observer - Notify pattern for maintaining the relationships
What I gave there is only the class structure where i have problems.
Please tell me why those two pointers are not holding the same address?
|
|
|
|
|
Firstly just a small correction:
In the program section the first line is as follows
c1 *myc1 = new myc1();
That certainly did not compile.
c1 *myc1 = new c1();
will.
In the method update you have the line:
if(tmp==b1)
did you mean:
if(tmp==obj)
Also why the use of the word function if this is C++?
When you instantiate Rel you cast a c1 pointer to a b1 pointer.
When you call f1();
you pass in a this pointer from within a2 in to the update method in the Rel class.
You then cast that pointer to a b1 pointer and compare to see if they are the same pointer.
If they are you call the success method.
So basically you're casting a c1* to a b1*, no problem there.
and casting an a1* to a b1*
I'm curious, how are you maintaining a pointer to Rel in a2 when Rel contains a pointer to a b1, a subclass of a2?
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
"The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane."
- Marcus Aurelius
|
|
|
|
|
Ah a multiple inheritance problem. Unless only one of the base classes has data members ( so the others are all interfaces ), it should not be done unless as a last resort.
Together with your Rel method update(void*) you appear to have a design problem. void* is untyped and therefore indicative of design flaws.
No doubt there are one or more bugs that could be fixed, but poor design can manufacture complexity and increase the risk of bugs, difficult bugs.
|
|
|
|
|
Hi All,
I m not getting process details (process name, process path) for some processes. for example, I m not getting process details for 3 svchost.exe out 5 svchost.exe. I m getting proper details for 2 svchost.exe.
Thanx,
Subhash
|
|
|
|
|
Subhash Karemore wrote: I m not getting process details...
Using what? Do you have the Debug privilege (i.e., SeDebugPrivilege ) enabled?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello to all,
i am creating one modeless dialog box whose id is "IDD_DIALOG_TEST" and i have placed some static text "Hello codeproject" on that dialog box. I am invoking that dialog box through "Create" method and showing it through "ShowWindow(SW_SHOWNORMAL)" method, after some time when i will call "DestroyWindow()" method the dialog box will get destroyed, now the problem is that dialog box is getting invoked and displayed properly but the static text on it is not getting displayed means i can see only dialog box but not the static text on it, what can be the reason, can anybody help me plz?
Thanks and Regards,
Anay
|
|
|
|
|
is this[^] article of any help ?
|
|
|
|
|
AnayKulkarni wrote: have placed some static text "Hello codeproject" on that dialog box.
how are you placing the Static text on the dialog. i.e. are you using SetWindowText or included that in Resource file or giving value to any variable to display the static text at startup
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How are you calling this update function on the dialog? Are you in a UI thread? If not, you can run into problems...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Hi all,
how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,,
thanks in advance,
Saravana...
|
|
|
|
|
saravana001 wrote: how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,,
how are putting you image in MainFrame Window, i.e. View Window. have you overidden the OnDraw function for drawing image on View Window. you can use this class for display variety of image format on windows http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I have an MDI app - and I wanted a less boring backdrop. The trick is to subclass the MDI Frame window - and then override WM_ERASEBKGND.
The below code uses CSubclassWnd by Paul DiLascia - you should be able to search for in from an old MSJ article on the web.
Good luck,
Iain.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_Backdrop.Install (m_hWndMDIClient, IDB_MIDAS, 32);
....
return 0;
}
class CUIMDIBackdrop : public CSubclassWnd
{
public:
CUIMDIBackdrop ();
~CUIMDIBackdrop ();
BOOL Install (HWND hWndMDIClient, UINT idBitmap, int nMargin);
protected:
virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);
};
CUIMDIBackdrop::CUIMDIBackdrop ()
{
}
CUIMDIBackdrop::~CUIMDIBackdrop ()
{
}
BOOL CUIMDIBackdrop::Install (HWND hWndMDIClient, UINT idBitmap, int nMargin)
{
return HookWindow (hWndMDIClient);
}
LRESULT CUIMDIBackdrop::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
{
if (msg != WM_ERASEBKGND)
return CSubclassWnd::WindowProc(msg, wp, lp);
HDC hDC = (HDC) wp;
CDC *pDC = CDC::FromHandle (hDC);
CRect rc;
::GetClientRect (m_hWnd, &rc);
return TRUE;
}
|
|
|
|
|
Hi all,
I have an application that create a process in suspend mode:
CreateProcess(filePath, 0, 0, 0, TRUE, CREATE_SUSPENDED, 0, 0, &startup, &procinfo);
and then later in code, we will run the program... so do a resume
ResumeThread(procinfo.hThread);
the problem I have is that the windows of the launched program does not appear. For example, if the create process is notepad.exe, when I resume the thread, the window of notepad does not appear and even not in the taskbar.
What is wrong with my approach?
thanks
InovaH
|
|
|
|
|
send it a WM_RESTORE or WM_MAXIMIZE...
BTW, what are you trying to achieve here ?
|
|
|
|