|
Your BOOL idea works great! Why didnt my GetSafeHwnd idea work? Isnt it equivalent? Whats the subtle difference between your approach and mine?
Happy Lights to you too! I lose track of these things - though my mom is a real surfer and keeps me informed via email. They have one of those webTV thingies...
Appreciate your help,
ns
|
|
|
|
|
You were checking that the view was valid. But the controls within the form view may not get completely set up until the view is shown. OnInitialUpdate() catches the initial display, hence the bool guarantees that all is well.
ns wrote:
They have one of those webTV thingies...
I'm so jealous! I set up my dad with a laptop and internet service, but he's so busy taking care of mom that he has no time to use it. Sad, 'cos he's such a gadget fan and at 83 has the wherewithall of a young man.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I put the BOOL as false in the constructor. How come the constructor runs even if view2 hasnt been spawned yet? I can see that it would get set to TRUE in OnInitDialog(), but at what stage does the constructor run? I have a SwitchView function in my MDI app which either creates if necessary, the view, or else it just switches.
CView* pView;
POSITION pos;
pos = pDoc->GetFirstViewPosition();
while( pos != NULL )
{
pView = pDoc->GetNextView( pos );
if( pView->IsKindOf( pViewClass ) )
{
pView->GetParentFrame()->ActivateFrame();
return TRUE;
}
}
pChild = (CMDIChildWnd*) pTemplate->CreateNewFrame(pDoc, NULL );
Which line runs the constructor?
Another very puzzling fact is that even though I hadnt run SwitchView, pView still came out to be nonNUll in my debugging......pos wasnt NULL....
Appreciate your help,
ns
|
|
|
|
|
The view might be created (constructed) when it's added to the multi doc template. Btw, tell me you meant OnInitialUpdate() , not OnInitDialog() , right?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Yeh u want RemoveAll if it is a CList???
|
|
|
|
|
Hi,
I receive from a Barcode Reader a string with a end of message character LF, TAB+, ENTER, RETURN, CR/LF in an editbox.
For example : *B00001*+<cr> or *B00001*+<enter>, ...
When I receive the string and the End of Message is RETURN, CR, ENTER, the program is closed. Ok I use Pretranslate Message for inhibit.
But when I would like to use TAB+ or LF nothing. I listen a BEEP.
My question is :
I would like when the Editbox detect the End of Message from the Barcode Reader, I execute a command.
Best Regards,
youssef
|
|
|
|
|
How to do this by using SQL-DMO? Subscriber and publisher status must be known.
I keep submitting “VB” as a Priority-1 bug, but apparently no one here knows how to fix it. Nick Hodapp, Semicolon
|
|
|
|
|
Hi!
In a system that has full memory protection, what are the way that allow user application to communicate with function inside the OS???
Thanks
|
|
|
|
|
You do it with system calls. Basically a system call is a "software interrupt" that get fired off from a user process, which is intercepted by the kernel of the OS to do work on behalf of the user.
What OS? Google[^]
|
|
|
|
|
Consider the following (i've cut things for brevity)...
using namespace Gdiplus;
CImageList img;
img.Create(IDB_USERBUTTONS,32, 52, RGB(192,192,192));
CLSID bmpClsid;
if (GetEncoderClsid(L"image/bmp", &bmpClsid) == -1)
{
ASSERT(FALSE);
}
IMAGEINFO *i;
for (long t = 0; t < numbuttons; t++)
{
HICON bibi = ImageList_img.ExtractIcon(t);
HICON bibi2 = CopyIcon(bibi);
Bitmap image(btn.GetIcon());
s = image.Save(name.AllocSysString(), &bmpClsid, NULL);
}
So, in effect, I'm trying to use the Bitmap class' constructor to load an image from a HICON which itself derives from an ImageList (ExtractIcon). However, although this should work (and i can use the HICON on a button for example) the Bitmap constructor simply blows up, trashes the stack and leaves me with nothing useful to work with. Passing a HICON from an icon resource... works. Why?
It seemed like a fine idea to parse an imagelist into a bunch of disk-based image files...
Tim Stubbs
|
|
|
|
|
Hi!
Could anyone tell me why disabling interupts to achieve mutual exclusion is not acceptable on a multiprocessor sytem???
Thanks
|
|
|
|
|
Well, the first thing that springs to mind is that you can't arbitrate access to any external shared resources with this method e.g. shared RAM. However, the use of something like a Semaphore in the context of a multi-processor kernel would allow this. In general, it is always best to think twice about disabling interrupts to implement mutual exlusion since any time spent in this state will increase interrupt latency - which may not be desirable.
Phil
|
|
|
|
|
Hi
I want to bring up a dialog box when a button is clicked.I'm having problems getting the dialog box to appear when I click on the file.
My code is:
void CMainFrame::OnSFile() <br />
<br />
{ <br />
<br />
m_chatterChooser.DoModal(); <br />
}
And I've declared in the header:
CDialog m_chatterChooser;
Is this correct?
Thank you.
|
|
|
|
|
Did you create a dialog ressource and derived a new CDialog class based on this ressource?
Gero
|
|
|
|
|
I created the resource, but no.. didn't derive a new CDialog class. I thought I didn't have to.
I will try that. Thank you!
|
|
|
|
|
Use class-wizard to generate the derived class from CDialog. Remember to select the right dialog ressource id when generating the derived class.
Gero
|
|
|
|
|
ok, I've done that, but still nothing happens when I click on the button.
What am I not doing?
|
|
|
|
|
Did you use class wizard? Did you chose the right dialog ressource id in class wizard? Which type is m_chatterChooser now?
Gero
|
|
|
|
|
I have it as CDialog. I chose the resource ID for the dialog that I just built. (Chatter chooser).
What do I have to change the type to? I put CCHooser which is the name of the class.. and I got errors.
Please bear with me, I'm new to this.
Thank you so much
|
|
|
|
|
If your derived class is named CCHooser you have to include CCHooser.h in the source file where you have declared m_chatterChooser.
#include "CCHooser.h"
Gero
|
|
|
|
|
I have six errors!
I have in my mainframe.cpp
#include "CHOOSER.h"<br />
#include "CHOOSER.cpp"
and
void CMainFrame::OnSFile() <br />
<br />
{<br />
<br />
m_chatterChooser.DoModal();}
In my mainframe.h:
CCHOOSER m_chatterChooser;
Also, the name of the class is CCHOOSER, but the fileview has chooser.cpp and chooser.h
I know this is a simple thing.. why I am having so much trouble?
|
|
|
|
|
You must not include this line!
#include "CHOOSER.cpp"
Gero
|
|
|
|
|
If this wasn't me, ikt would almost be funny!
Now I have 5 errors!
|
|
|
|
|
Just send me your project (gerogerber@gmx.de), or tell me which errors you get.
Gero
|
|
|
|
|
m_chatterChooser must be of type CChooser
|
|
|
|