|
Need help! How can I remove the program button from the taskbar?
|
|
|
|
|
Need help! How can I remove the program button from the taskbar?
|
|
|
|
|
Explain: "The program button"
--Bar Cochva--
|
|
|
|
|
With Program Button I mean the button in the taskbar.. where the start button is... in the buttom of the screen
but I have a solusion.... I replaced _EX_APPWINDOW with _EX_TOOLWINDOW
|
|
|
|
|
With Program Button I mean the button in the taskbar.. where the start button is... in the buttom of the screen
but I have a solusion.... I replaced _EX_APPWINDOW with _EX_TOOLWINDOW
|
|
|
|
|
Paul DiLascia addresses this question in the May 2000 issue of MSDN magazine. Search MSDN for May 2000.
Frank
|
|
|
|
|
How can I get back to my previous position in VS? Lets say I hit ctrl-home on accident and I want to get back to the previous line I was on. Is there a keyboard bind I can set for this?
|
|
|
|
|
Tools -> Options -> Combatibility
Select "Include caret positioning in undo buffer"
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
I wish I had asked this question a looooooooong time ago. Thank you!
|
|
|
|
|
I know that VC++ doesn't have export keyword . However, is there some way around, so that I can separate declarations and definitions of template functions?
I vote pro drink
|
|
|
|
|
Separate them like you would a regular class (.h/.cpp respectively) but instead of compiling the .cpp file directly, just include it in your header file -- you can also add the .cpp file to you project, just make sure it does not get compiled ( Settings... > General > Exclude file from build ( or just give it a different file extension ) )
functionTest.cpp
#include <iostream>
#include <vector>
#include <string>
#include "function.h"
using std::cout;
using std::endl;
using std::vector;
using std::string;
typedef vector<string> STRINGVECTOR;
int main ( int argc, char * argv [] ) {
STRINGVECTOR myBooks;
myBooks.push_back ( "Cryptonomicon" );
myBooks.push_back ( "Elemental Mind" );
myBooks.push_back ( "My Brain is Open" );
myBooks.push_back ( "Principia Mathematica" );
myBooks.push_back ( "The C Programming Language" );
STRINGVECTOR::iterator stolen = get_n (
myBooks.begin (), myBooks.end (), 4 );
cout << "My copy of \'" << *stolen << "\' was stolen!!" << endl;
return 0;
}
function.h
template <class _Iterator, class _Size >
_Iterator get_n ( _Iterator first, _Iterator last, _Size index );
#include "function.cpp"
function.cpp
template <class _Iterator, class _Size >
inline _Iterator get_n ( _Iterator first, _Iterator last, _Size index ) {
while ( first != last && 0 != index ) {
++first;
--index;
}
return ( first );
}
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hi all,
I need some helps with ObjectARX for AutoCAD 2000i.
Working anybody with ObjectARX ??
ObjectARX is API for Autodesk AutoCAD.
Libor Matejka
|
|
|
|
|
Arx come with help files, afaik.
What do You need?
|
|
|
|
|
Hi,
I need use SaveAs() function, but I don'n know how.
If I use this code :
AcDbDatabase *pDb = new AcDbDatabase();
pDb->saveAs("d:\\test1.dwg");
delete pDb;
then test1.dwg is empty file without etities (line, circles ....)
What is wrong ?
What I must do for using SavaAs();
Libor Matejka
|
|
|
|
|
Try tu use AcDbDatabase::insert method.
And maybe calling save as command from autocad will be solution. As I remember that is ADS_COMMAND
|
|
|
|
|
Hi,
you must use this code :
AcDbDatabase* pDb=NULL;
pDb=acdbHostApplicationServices ()->workingDatabase ();
pDb->saveAs("d:\\pokus.dwg");
Libor Matejka
|
|
|
|
|
Hi,
In my OnMouseMove(...) I'm loading a bitmap like so:
<ccode>
CSize sizeOfBmp = m_dibMask.GetSize();
CBitmap *pOldBm = pDibMask->MakeBitmap(&m_dib, &dc, sizeOfBmp);
//This is to fix Dundas bug
delete dc.SelectObject(pOldBm);
dc.SelectObject(pOldBm);
Since my masked image (I'm using a masked image to create "hotspots") get's loaded everytime the mouse moves in the view, I was wondering if it's possible to do the above code but somehow persist the dc so I can make a call to dc.GetPixel(...) without actually having to load it all over again. My masked image is about 800k so I'm thinking that if I can persist the dc I can gain some performance.
Also, in my UI, the user can change the image/mask pair by selecting a different image, will this cause any problem?
Thanks for any help you can provide,
Craig
|
|
|
|
|
You could make it static or make it a member variable and set it up in your initialisation.
I just reread your post - I'd make it a member variable and then delete/recreate when the user changes what it is.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Thanks for the info Christian. Just so I'm clear on what you mean.
1. Create member variable in my .h file
CDC dc;
2. In my loadFile function (when the user selects a new imgage.)
if(dc != NULL)
delete dc;
dc.CreateCompatibleDC(NULL);
CSize sizeOfBmp = m_dibMask.GetSize();
CBitmap *pOldBmp = m_dibMask.MakeBitmap(&m_dibMask, &dc, sizeOfBmp);
//Fix Dundas bug
delete dc.SelectObject(pOldBm);
3. In my destructor
if(dc != NULL)
delete dc;
I'm kind of questioning the deletion of the dc, how do I do that correctly without creating memory leaks?
Thanks again for all your help,
Craig
|
|
|
|
|
No, this is dodgy - it won't compile. You are treating the variable DC as a pointer when you check for NULL and call delete, but it isn't one.
You can get the same effect without using a pointer by using dc.DeleteDC(); which will get rid of anything that was there before, but not crash if it was empty.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Yes, that works correctly and doesn't even crash . The only thing I question about this whole situation is, the call to
CBitmap *pOldBm = m_dibMask.MakeBitmap(...)
is basically making a call to SelectObject which returns the old object. According to the documentation you should always call SelectObject using the originally selected object, in this case pOldBm. Will I run into any memory leaks by not selecting the old pOldBm back into SelectObject()?
Thanks again for all your help, it's actually working ,
Craig
|
|
|
|
|
There's no point catching it if you don't put it back in ;0)
Usually this is a major disaster, but if you create the DC afresh before selecting the bitmap, the one coming out is 1x1x1, in other words, it's not really important. You could store the bitmap *, and check it for NULL before deleting the DC to know if you need to select it back in, but I doubt it's necessary...
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I see now, so I will have to worry about this when for instance I open up another image using the same dc right?
Currently, I have the following code in my LoadImage(...) method
if(m_dc != NULL)
dc.deleteDC();
m_dc.CreateCompatibleDC(NULL);
CBitmap *pOldBm = m_dibMask.MakeBitmap(...);
So, for the dc.deleteDC() do I need to worry about saving the old bitmap? Or, does deleting the dc pretty much mean I'm starting with a clean one again without worrying about selecting the old bitmap back in?
Thanks again for all of your great help to get me to understand how all this dc stuff works,
Craig
|
|
|
|
|
Yes, you've got it. Don't bother catching it, unless you want to use a member variable, and select it back before calling DeleteDC(); It's probably better that you do, but I doubt you'll notice any difference if you don't.
Glad to help
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I wrote an STL version of my CQStringParser class, and in order for it to compile cleanly at warning level 4, I had to do the following:
#pragma warning (push, 3)
#pragma warning (disable : 4786)
#include <list>
#include <string>
#pragma warning (pop)
Why do I have to pragma around those includes? Is this just an example of Microsoft's inability to develope standard code?
Next question - When I run the app, Boundschecker reports memory and resource leaks in the very same files that generate the warnings. Why?
I guess I just don't get it - what does the STL bring to the table that MFC doesn't do as well or better?
|
|
|
|