|
|
Hello,
I'm have the need to write a custom window arrangement routine (like the normal tile, cascade, etc) in an MFC MDI app.
What i'm need to do is "stack" MDI child windows of a certain CMdiChildWnd derived type, while minimizing all other MDIChild frame windows.
Does CMidFrameWnd maintain a list of pointers to it's child frame windows? If not, any idea how i can enumerate the child frames, and figure out what CMDIChildWnd-derived type they are?
Thanks,
Heywood
|
|
|
|
|
Hi !
I was working on Device Independent Bitmap (DIB) and wanted to shrink my image down to a thumbnail size, so used the
StretchDIBits() function.
But the shrinking lead to a severe color loss. Why ????
Is there anyway I can shrink my DIB without color loss.
Please Help
|
|
|
|
|
SetStretchBltMode(COLORONCOLOR);
-c
Cheap oil. It's worth it!
|
|
|
|
|
Hi !!
It worked just fine.. The image is perfect now.
Thanks a lot.
Green.
|
|
|
|
|
If you don't mind it still looking bad on Win9x, you can try calling SetStretchBltMode(HALFTONE); prior to calling StretchDIBits() . Caveat: i know it works with StretchBlt() , but i've never tried it with StretchDIBits() .
---Shog9---
From now on we can call C# and MC++ "The square wheel languages" -- Jack Handy, The Lounge
|
|
|
|
|
Hi !!
Well, It did work for StretchDIBits().
The image is perfect now...
Thanks a lot.
Green.
|
|
|
|
|
Hi !!
Well, It worked for StretchDIBits().
The image is perfect now...
Thanks a lot.
Green.
|
|
|
|
|
Hi.
I have an interesting problem. I am working on a program with with a CEditView window. I use GetEditCtrl().SetWindowsText to update the view with new text. Whenever I call SetWIndowsText, the CEditView repaint the entire view, but it always resets the scroll position. For example, let say I am view line 200. (line 200 is at top of view). Whenever I update the view, CEditView resets the current view to line 0.
Is there a way to set what line should CEditView beginning?
Thanks,
Kuphryn
|
|
|
|
|
Use
CEdit& edit = GetEditCtrl() ;
edit.LineScroll(200,0) ;
|
|
|
|
|
Thanks.
A special thanks to Scott McPhillips of MSDN newsgroup also for the solution (he posted it yesterday).
Kuphryn
|
|
|
|
|
Hi,
CStringArray& MyArrayFunction()
{
CStringArray aArray;
aArray.SetSize(...
aArray.SetAt(...
...
return aArray;
}
Question1: is the return line OK?
Question2: how can I fill another array in my code with the returned stringarray?
I tried
CStringArray aMyArray = MyArrayFunction();
but
error C2440: 'initializing' : cannot convert from 'class CStringArray' to 'class CStringArray'
is the answer.
Could you please help me?
Thanks a lot
Ricardo
|
|
|
|
|
change to:
CStringArray* MyArrayFunction()
{
CStringArray *paArray = new CStringArray();
paArray->SetSize(...);
return paArray;
}
getting the array
CStringArray *paMyArray = MyArrayFunction();
do not foget to delete paMyArray;
soptest
|
|
|
|
|
|
I have the following problem. I have included this header file many times in my code with no problems. Then I "included" it into a new file which now produces errors in my typedef statement. I really dont know if it is a problem with namespace as I have no idea how to use that correctly anyway.
Code for "entity.h"
<br />
#include <list.h><br />
<br />
using namespace std ;<br />
<br />
typedef struct<br />
{<br />
int ref;<br />
std::string name;<br />
<br />
}EntityData;<br />
typedef list<EntityData> ENTITYLIST;<br />
How can I include this file with out errors??
Code for "NewFile.cpp"
<br />
#include "stdafx.h"<br />
#include "NewFile.h"<br />
#include <list.h><br />
#include "entity.h"
using namespace std;
Pease help!!
---
|
|
|
|
|
Ooops, Rather than delete this message I will just post my solution.
Use <list> instead of <List.h>
---
|
|
|
|
|
what is the error?
soptest
|
|
|
|
|
It didnt understand the list definition in my header file. This is now fixed due to the way I included the list.h file. I.E #include <list> without a .h
Thanks anyway.
---
|
|
|
|
|
The list.h is the old header file from the old C++ standard and is included to prevent old code from breaking. That is why if you are developing new code you should use the plain <list> header.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Also to make sure your header is included only once you must do the #ifdef stuff
#if !defined __ENTITIY_H
#define __ENTITIY_H
....
#endif
Best regards,
Alexandru Savescu
|
|
|
|
|
This is kind of trivial, but I have an ATL DCOM server project, and when I monitor it in the task manager, the .exe's name gets mangled. So, instead of the process entry reading DCOMServer.exe, I see DCOMS~1. Sometimes the problem doesn't show up. I just wondered if anyone knew why this happens.
|
|
|
|
|
If you look at how its registered, either in the registry or in OLEView, its probably using short file names. Its probably not a big deal unless you need it to be in long name format.
Like it or not, I'm right.
|
|
|
|
|
#include <string>
#include <iostream.h>
using namespace std;
string pres[5];
void loadPrescriptions(){
//this will read from a file later
pres[0] = "David Seruyange";
pres[1] = "Laura Bush";
pres[2] = "Jamie Myers";
pres[3] = "Pamela Anderson Lee";
pres[4] = "Grace Lozano";
}
int main(){
int select;
char quit;
loadPrescriptions();
while(1){ //forever
cout << "Enter a prescription ID\n";
cin >> select;
cout << "You are looking for:\n";
cout << pres[select].c_str() << endl;
cout << "Do again?\n";
cin >> quit;
if(quit=='q'||quit=='Q'){
break;
}
}
return(0);
}
It compiles perfectly but when I try to 'build' I get:
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/string.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Go to Linker settings, In the command line text box type the following
/ENTRY:_mainCRTStartup /SUBSYSTEM:CONSOLE
|
|
|
|
|
Is his problem that the project is not a console project, so it's looking for winmain instead of main ? I thought of that after I posted, although my advice ( create a new console app and paste the code in ) would still solve it, and to be honest, I had no idea it could be set in this manner.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|