|
Bertrand Boichon wrote:
So you mean actually passing a CImage reference would not do that?
Yes, because you would not declare CImage inside Acquire:
void Acquire(ISampleData & image)
{
image.DoThis();
image.PerformThat();
}
...
CImage image;
Acquire(image);
The image Acquire is operating on is declared outside of function, so it's lifetime isn't bound to Acquire scope.
Returning a pointer to object allocated in Acquire is also OK. You may consider using std::auto_ptr or boost.org scoped_ptr to ensure proper deletion.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Thank you very much for the lesson!
Very helpful!
Bertrand Boichon
|
|
|
|
|
To enable / disable the toolbar buttons I use the update handler (ON_UPDATE_COMMAND_UI() macro)... ok... but when does the system change the state (enable/disable) of the toolbar buttons?
Have I to call Invalidate or UpdateWindow ???
--
Nice greets, Daniel.
|
|
|
|
|
'The system' (MFC app) updates the button state during its idle update cycle. See CWinApp::OnIdle and CFrameWnd::OnIdleUpdateCmdUI (undocumented).
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hi,
I would like use CMultiRectTracker into CScrollView to manipulate gdi
objects,
such as CRect, but when I try select object after scrolling there is bug
to move and positioning its RectTracker.
Can anyone help me?
Thanks, in advance
Gianfranco
|
|
|
|
|
Without any additional information about 'the bug', I guess you could forgot to convert from device units to logical units (with CDC::DPtoLP) in mouse event handlers.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
I can get the select text in html in my ap. But how to get the position of the select text? Because next time I open the same html I want select the text auto.Or have any other way to do it?
|
|
|
|
|
This tag is part of the DOM, right ? So you need to store the path traversal from the root down to this node. It's up to you to find a convenient model. AFAIK, there's no such built-in model provided in the current IE DOM.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
So the html must have begin tag and end tag,if not. I would not do this feature right? Thx your reply.
|
|
|
|
|
Path traversal has nothing to do with end tags.
We are talking DOM IE API. That's just a matter of root node, and children.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Sorry. I misunderstand. What is DOM IE API? Where I can find examples?
|
|
|
|
|
How can I change the bitmap of a toolbar button at runtime?
--
Nice greets, Daniel.
|
|
|
|
|
Try using the LoadBitmap() member function of CToolbar class.
|
|
|
|
|
Do you want to use any bitmap, or you just need to switch between some bitmaps you know at compile time?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Only between bitmaps I know at compile time (like a bitmap or a bitmap in a image list).
--
Nice greets, Daniel.
|
|
|
|
|
Use CToolBar::GetToolBarCtrl and CToolBarCtrl::AddBitmap to load bitmap from resource and append it to toolbar's image list, then CToolBar::SetButtonInfo to change the index of button's image. Bitmap should have the dimensions of your toolbar buttons, usually its 16 x 15. RGB(192, 192, 192) - light gray - is used as transparency by MFC toolbars.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Thanks... I try it...
--
Nice greets, Daniel.
|
|
|
|
|
How can I change the title of a dialog at runtime?
I want to add a constructor to my dialog, so that I can set the title of the dialog, like CMyDialog dlg(_T("Settings")); .
I save the title text in the constructor and want to set the title in the OnInitDialog function, but how can I set the title?
--
Nice greets, Daniel.
|
|
|
|
|
void SetWindowText( LPCTSTR lpszString );
|
|
|
|
|
In my application I am using Shellexecute to run SQLs through isql.exe.
I want to trap the exceptions/errors which isql throughs in messagebox dialogs.
Can I trap those messages anyway out.
Souchakra
|
|
|
|
|
Try using SQL Server 2000 commandline tool osql which is the recommended tool for running sql scripts on commandline (if you not need to connect to SQL Server 6.5 or before). All sql server 2000 commandline tool output errors on stdout/stderr and there should be no message box at least. To catch the output it is a good idea to use the -o switch which directs it to the given file. (For more options see sql server 2000 online help "Using the SQL Server Tools)
Possibly the messagebox may occur because ShellExecute is used and has this (configured?) effect for the case of a stderr output?
|
|
|
|
|
Hai Juergen,
Thanx for your urly response.U suggested me of using osql but, I have to use Sybase Anywhere 5.5 which has the rtdsk50 eng free to distibute.For the same I am using isql.exe.
Could u suggest me anything related to this....
|
|
|
|
|
How can I register one file type with my application? I want my application to open all files that have the extension of ".tsx". I also would like to use DDE because I one instance of my program is always running and I do not want to run another instance. All I want is to send a message to the running instance. I am looking forward to hearing from you guys
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
More than one hundred native Windows apps are using DDE file association already. So I guess it's not cumbersome to find them.
First thing to do is in Windows Explorer file association, check the use DDE checkbox, and type Open("%1") as DDE message, and system as Topic. This in itself in almost enough (depending then on how you handle default verbs in your apps).
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
In fact I did that. But when I do that, CWinApp tries to open the file on its own. But what I want is to do different things but I could not figure out how to. I overrided CWinApp::OnDDECommand () but this method is never called
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|