|
I am building my first MFC application which has MFC statically linked. A colleague says that I am not allowed to release a debug version of this to machines in the organisation that don't have a VC++ licence. He has pointed to an article in MSDN that says "..Note that debug versions of an
application are not redistributable and that none of the debug versions of various Visual C++ dynamic-link libraries (DLLs) are redistributable." Can anyone confirm my colleagues view and say why Microsoft are bothered about what version of my app I distribute?
|
|
|
|
|
Why on earth would you *want* to release a debug version - it is going to be bigger and slower than a release version.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
The increased size and the performance hit haven't been issues to date. The user machines are over-spec'd. They'd probably run XP without blinking...
I've used assert to stop the program with a hint, when "that should never happen" happens. To date typically this is because rogue data is coming in from another system. I rather not re-invent that wheel if I can get away with it
|
|
|
|
|
Either way, it is wrong in my opinion to release crippled code just because the system can handle it. The debug version is different in many ways, and designed for debugging, not for release.
What wheel do you not want to reinvent, assert ? It's just a macro, have a look at it, it is about five minutes work. Your code should handle the case of rogue data, that's what programming for the real world is all about. It should do it in a prettier way for the end user than an assert message, you should assert liberally to help you debug and release the product when the debug version gives no asserts because everything is being dealt with correctly.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
For debug release a lot of DLL's will be required and debugging errors can pop up after distribution.
Release is the best option for distributing the appl. It is smaller and requires less DLL's of MFC.
|
|
|
|
|
|
Why would you think that ?
The beauty is we can keep using it even if it is, if we want to. We have the source, after all.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
- I want to change the drive letter of my CDROM.
I want to implement it in VC. How to do that?
- Can you help?
Thanks,
Maer
|
|
|
|
|
Define operating system (unless you _really_ want to implement it inside VC in case you're trolling).
You should however have a look at QueryDosDevice and get some ideas from that.
|
|
|
|
|
- Thanks for your reply, my Pal!
- I am not very familiar with "QueryDosDevice". Can you show me an example in my case?
- Regards,
Maer
|
|
|
|
|
I'm trying to draw control programmatically in the 1st sub item of a
listview row when the user sets the focus to that item.
I have a handful of questions.
Currently I'm doing this in the OnItemChanged and seeing if the items
uNewState is SELECTED. Is this the best place to do this? Seems to work.
Next, I use GetSubItemRect in combination with pNMLV-iItem to get the rect
of the subitem I want to put the control over.
This seem to work ok...except..with a combobox.
GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_BOUNDS,itemRect);
CComboBox *pCombo = new CComboBox;
pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN,
itemRect, this,190);
The combobox shows up to big. It must have a minmum size or something? when
I do the same thing with CEdit and CButton they work perfect. Also isn't the
size difference in a combobox's CRect top and bottom the amount the combbox
will drop down?
Also, is there a way to create the combobox without a boarder so it will
show up over the subitem better?
Is there a style to make CButton flat?
thanks
mike
|
|
|
|
|
I believe you can make the buttons flat in the resource editor.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I have a full com serverwith three interfaces. A different client will access each of the three interfaces at overlapping times. I only want one instance of the .EXE to be running. As each of the client apps performs its _CreateInstance, a new instance of the app is launched. Giving me three altogether.
Is this possible?
How is it done?
I am familiar with the technique of using FindWindow and setting the focus to the already existing window to ensure only one copy of an app runs at a time. I don't think it applies here because 1) No window, the client apps are NT services. and 2) I don't think the interface would be attached if I simply re-directed the focus and exited.
Can anyone help, please?
Thanks for the help,
Bill
|
|
|
|
|
Try searching
http://discuss.microsoft.com/archives/atl.html
for singleton
Todd Smith
|
|
|
|
|
How can I launch multiple views fron one SDI and make them totally independent???
I can launch multiple views, but if I close the first one the others get closed!!
|
|
|
|
|
r u closing the view or closing the document ?
D.W.
|
|
|
|
|
Hi,
I am trying to write some VC++ code that will allow me to display a screen image at different resolutions (640x480, 1280x1024 etc) and then allow me to save at the chosen resolution (as BMP, JPG, GIF.)
Any assistance would be greatly appreciated!
Thanks
|
|
|
|
|
The problem is one of bit mapping. You must map the bits in your image to your display.
Your source image is a matrix of pixels of some size. This is independent of the resolution you wish to display it at. It may be larger or smaller than any one of your target resolutions. It may have a different shape. There are seveal problems to solve:
1) Decide the type of mapping you want: Clip, Stretch, Maintain aspect ration are the main ones.
2) Suppose you had a source image of 2000 X 2000 pixels. To display at 640 x 800, for example you must match 2000/640 bits to each bit in the display horizontally and handle the same situation veritcally (taking into account whether you want to preserve the aspect ratio or not). This operation must be done at each resoulution.
3) if you are mapping many pixels from the source to 1 in the display, you must compute some sort of average pixel value for each color. If you are going the other way, you need to interpolate each pixel from the values of the source pixels around it.
Saving the result can be done with the usual format specific algorithms. Its been a few years since I worked with this sutff, I've seen libraries of graphics sotware for reading and writing the various types of image files. The free ones were complicated and hard to use. The commercial ones cost money.
Good luck. Image processing is something very few want to get involved with. It is very labor intensive.
Hope this helps,
Bill
|
|
|
|
|
Hello,
I'm wanted to write an file output stream that outputs in the zip format. I wanted to do this by inheriting the new class (zofstream) from ofstream. However, I was a bit confuse as to ofstream's implementation. Here are my questions...
1) ofstream inherits from ostream, but none of the operators in ostream are virtual. How is it that you can use these operators with ofstream and have the data be directed to the file? I wanted to overload the operators for my own class, but how can I do that when the operators weren't declared virtual? (and I'd rather avoid having to make this a wrapper class). There's obviously a mechanism in place here that I'm not aware of.
2) Reading the ofstream's implementation source code would help, but I don't have it, and couldn't find it. Can anyone help me with that, if they can't answer question 1?
|
|
|
|
|
There's no need for the operators to be virtual. You just override whatever methods you want. The only time virtual comes into play is polymorphism - when you're accessing zofstream methods through a ofstream* variable and you need the zofstream version to be called. Folks don't usually use polymorphism with streams, so the ofstream methods aren't virtual.
The code is all in the "fstream" header I believe. Good luck understanding it, though, it's horribly obfuscated and impenetrable.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
The usual way to have user defined streams is not by deriving from ofstream or any other standard stream , but rather by deriving from streambuf , which is the holder of the virtual functions you're after. Only after this you can define your ozfstream as a derivation of ostream having a zstreambuf (or whaterever you decide to call it) as a member and attaching the base class to it. The details are a little convoluted, but the task if way simpler than your intended approach of overriding each and every ofstream method. Plus, you got some extra bonuses, like the possibility of having zipped streams of any kind, not just coming from files but from memory buffers or other sources.
Good luck with your project.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm having a hard time making a macro for my outputdebugstring function.
void CMyTrace::ODS(const CString& message, ...)
{
va_list args;
char textBuffer[1024];
va_start(args, message);
_vsnprintf(textBuffer, 1023, message, args);
va_end(args);
OutputDebugString(textBuffer);
}
I've tried something like this with no luck. I've searched and search to find a way. I know it can be done because micro$oft does it with ATLTRACE and TRACE but I'm not having any luck.
#ifdef _DEBUG
void ODS(const char* msg, ...) { .code. }
#define DEBUGOUT debugOut
#else
inline void ODS(const char* msg, ...) { /* empty */ }
#define DEBUGOUT 1 ? (void)0 : ODS
#endif
|
|
|
|
|
try this:
#ifdef _DEBUG
void ODS(const char* message, ...)
{
va_list args;
char textBuffer[1024];
va_start(args, message);
_vsnprintf(textBuffer, 1023, message, args);
va_end(args);
OutputDebugString(textBuffer);
}
#define DEBUGOUT debugOut
#else
inline void ODS(const char* msg, ...) { }
#define DEBUGOUT 1 ? (void)0 : ODS
#endif
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I know that is possible to draw a bitmap using SetROP2 in such a way that some of the bitmap's pixel to be transparent ( i.e. to be not copy onto screen ). But is there a way to draw a polygon onto screen and only pixels with some color to be touched ( i.e. changed ) by this operaion ?
|
|
|
|
|
Yes, you could just build the mask from the destination instead of the source bitmap. I *think* that would work. You could also turn it into a DIBSection if it isn't already and do it manually.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|