|
Not with the default list control from MFC. This is how I do it...
while(m_myListCtrl.DeleteColumn(0));
This way, I don't have to get the column count, I know that is not much overhead, but you never know where extra CPU time will come in handy.
|
|
|
|
|
Attention please~~~
Hi~
Last time, I wrote my problem at here.
But In my mistake, I don't gain a solution.
So I record my question again.
I seriously desire your assistance.
I'm a University student preparing a graduation thesis, in Korea.
But in the process, there raised an obstacle, so I'm in stuck with a problem.
So now I sincerely call for your help...
As the question contains some images and source file, I make out html document file.
The address is http://my.netian.com/~sibuzigi/forsite.htm
I hope your quick and adequate answer.
p/s Please~~~ Somebody help me~~~!^^;;;;;;
|
|
|
|
|
Hi,
What's the actual question?
Do you want to know how to make gradients?
It seems that your sample app does them well!
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hi,
I think you are approaching this problem from the wrong direction. You should not need to worry about smoothing out discrete bands of color if you are trying to represent continuously variable field strength. I think the easiest approach would be to simply generate the color of each pixel based on the field strengh at that point.
For example say you want to represent field strength with
green=weakest value and yellow=strongest value in an RGB24 image
all you need to do is set G=255 and B=0 and then scale R from 0 to 255 proportional to field strength at that pixel position.
In the simple case of a single field source use pythagorus to find each pixel's position relative to the pixel you designate as the source of the field then use whatever formula you need (probably some inverse square relationship) to calculate the field strength at that pixel poition and scale that position to your R value in the RGB image. ( You may want to do a preliminary pass of the field to find minimum and maximum values in the the area you are representing so you can scale to the full 0-255 value of the R value.
You should get a nice smooth image.
Steve T.
|
|
|
|
|
Hi,
I have the dialog box with the ID: IDD_LISTCTRLDEMO_DIALOG
It has its class CshowResults.
In that dialog box I have a list control, which I would like to print.
The list control's ID is IDC_LIST_CTRL
and its member variable is m_cListCtrl
Now, how can I print that specific tree control, there might be about 40 pages of items in it!
Tanks a lot
|
|
|
|
|
I need to hold an array of values of varialbe type such as int's float's string's etc. The array will be created at compile time.
Any ideas?
|
|
|
|
|
Can you use VARIANT ?
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I dunno. Is VARIANT compatible with string and iostreams?
Can you say
VARIANT somevar;
somevar >> aniostream;
aniostream << somevar;
|
|
|
|
|
Hmmm, off the top of my head, may I suggest you try creating your own struct/class that holds a string, float, int, etc. Infact, this is how VARIANTs in VB/COM are implemented under the hood anyway. Then use this struct/class in your maps, lists, and other STL structures. You might want to experiment with unions as well.
You could also take a look at MFC's COleVariant, and see if you can bend it to meet your needs (this is mostly used for database related stuff, but am sure you can use it for other needs as well).
|
|
|
|
|
If I understand you want one place to hold variables of different type(long, int, string, etc.).
The only way I'm aware of is to use VARIANT, but this has its draw backs. Using a VARIANT adds bulk and slows down your code. If you don't need to support VB or scripting languages then don't use VARIANT.
Is this for MFC? Then you can COleVariant << and >> operators, otherwise I don't beleive _variant_t has that capability.
Can you use seperate containers for each type? list<int>, list<long>, etc.
|
|
|
|
|
If this is what you want to do, I suggest that you uses a wrapper class like COleVariant or _variant_t (or maybe your own class).
At least those class properly handle memory managment and help a with initialisation. The one to uses depends on your needs. If you need more functionaly, then you should create your own class that may derive or embed a COleVariant or _variant_t.
_variant_t class may be a bit easier to uses since it allows conversion from the variant to another type:
_variant_t v(3.2);
double d = v;
but it does not support writting to CArchive...
You may also uses _variant_t for the container and create ColeVariant object at place you need extra functionaly.
Philippe Mori
|
|
|
|
|
I think this will work
http://www.boost.org/libs/any/index.html
gonna try it out...
|
|
|
|
|
|
with SetCursorPos(x,y);
cheers!!!
Carlos Antollini.
|
|
|
|
|
In MFC, if I didn't want my program to close by hitting Esc or Alt+F4, or any other escape sequence, how would I disable that? I can't find any code that works.
I Want Chicken, I Want Liver, Meow Mix, Meow Mix, Please Deliver...
|
|
|
|
|
I am not sure what you mean by "program". But one way to stop the user closing your dialog would be to overload the OnCancel or OnOK methods of your CDialog inherited class. (eg. They could do nothing at all.)
Accept that some days you are the pigeon and some days the statue.
|
|
|
|
|
|
Hello every1!
I am looking at some sample code that microsoft is giving out with MSDN and i can't understand what is going on...if some1 knows it...
Here's the problem - the project palmap(can be found in any MSDN library) is a dll file that is used as an extension of aviview(a prog for viewing avi files and also can be found in the MSDN). A part of the source of palmap.c says:
typedef struct {
IAVIStreamVtbl FAR * lpVtbl;
ULONG ulRefCount;
//
// instance data
//
PAVISTREAM pavi;
PGETFRAME pgf;
AVISTREAMINFO sinfo;
HPALETTE hpal;
LPBYTE lp16to8;
LONG lLastFrame;
LPBITMAPINFOHEADER lpdibLast;
} PALMAPSTREAM, FAR*PPALMAPSTREAM;
There is something sneaky in this struct since IAVIStreamVtbl is defined nowhere(i checked the headers and tried to see if any IDLs exist). I searched the whole project directory for that string and there is no match. It is obviously the vtable and also has an interface prefix but i don't find any interface definitions too. BTW: i tried to look for the definition by clicking with the right button on the "IAVIStreamVtbl" and choosing "Goto definition...." but there is no brosing files with that project. After building the project there are no errors or warnings. so - Where could this IAVIStreamVtbl be defined?
Thanks for any reply!
Vladimir Ralev
|
|
|
|
|
Hi, I'm hoping someone here can help me with a synchronization question.
I have a global function that adds entries to a log file. This function can be accessed by several threads in my program, and this function will also be used in different programs to write to the same log file. Because the log file is opened with the CFile::shareDenyWrite flag, I can only allow one thread to have access to this function at one time.
void WriteLog (LPCTSTR EntryString)
{
CMutex mutex(FALSE, _T("WriteLog - {AE4E28C0-84E6-11d5-B625-F80C283F7922}"));
CSingleLock lock(&mutex, FALSE);
while (lock.IsLocked());
lock.Lock();
COleDateTime dt = COleDateTime::GetCurrentTime();
CString LogEntry = dt.Format("%d/%m/%y %H:%M:%S - ");
LogEntry += EntryString;
CRotatingLog rl(_T("C:\\Bird_Log.txt"), 1000, 100);
rl.AddLine(LogEntry);
} As this is the first time I am using this method, I would like to know if this is the correct way of doing this, or will this just give me problems in the future? Is there a better way to wait for the CSingleLock object to unlock? The while loop seems to be very processor intensive. Any advice appreciated.
TIA
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
You can delete the 'while' loop. The default value of Lock method parameter is INFINITE, this means that CSingleLock::Lock will wait until mutex is released. This waiting will have no impact on CPU usage - it's implemented using ::WaitForSingleObject.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks, I'll try it;)
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
Does anyone know of any algorithms to convert degrees to pixels. I need to be able to rotate a bitmap by a given degree.
|
|
|
|
|
|
As degrees are an angular measure and pixels lateral the convertion would depend on how far from the rotation point you are. I have been playing with images for a while now and was going to write a lot of the code myself, but found it was better to concentrate on the rest of the project and do the image handling with a library written be someone who has more experience than I do. In the end I opted for ImgSource
http://www.smalleranimals.com/
It is inexpensive (note I don't say 'cheap') and does a very good job for what I need to do. Have a look it may do what you want.
Happy programming!!
|
|
|
|
|
Is there a way to understand if a port is listened by a server process on winsock ? If you know how to do this can you post a code sample.
Orcun Colak
orcuncolak@yahoo.com
|
|
|
|