|
While in the dialog editor, hold the ctrl key and double click the dialog (not on a control). It will invoke the class wizard for you and do the necessary things...
Hope this helps,
Bill
|
|
|
|
|
Hi,
I use the Video For Windows function AVIStreamGetFrame which returns a Packed DIB.
I then convert it to a DDB using the following code fragment:
HDC hDc=GetDC(NULL);
BITMAPINFOHEADER* bminfoheader;
BITMAPINFO* bminfo;
LPVOID bits;
bminfoheader=(BITMAPINFOHEADER*)lpbi;
bminfo=(BITMAPINFO*)lpbi;
bits = bminfoheader->biSize + (char *)lpbi;
HBITMAP hbitmap = CreateDIBitmap(hDc, bminfoheader, CBM_INIT, bits, bminfo, DIB_RGB_COLORS);
My concern is the colour usage parameter in createDIBitmap, could there be a situation where AVIStreamGetFrame returns a image which uses DIB_PAL_COLORS.
Would DIB_PAL_COLORS have any effect on calls to GetPixel and SetPixel, when the image is selected into a device context?
Thanks Again
Richard
|
|
|
|
|
Hi
I have a processor demanding task, converting files on a server. What i want to do, is to avoid creating a bottleneck on the server. So i want to process a single file say every minute, leaving the server free in the meantime. Can anyone recommend and give details of a method i could use. Somebody recommended threads?
Cheers
Richard
|
|
|
|
|
You *could* use Sleep(60000); to suspend your program for a minute.
If you convert a file every minute, your server would be slow while the conversion is in progress...
I would make a thread with a very low priority, and just make that thread process all the conversions it could.
When the server is idle, it would use 100% cpu, but when another program need processor time it would get it, because it have a higher priority that your thread have. Your server would be just as fast as it always have been, but use all it's idle time to convert your files.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Does anyone know how to make a program that will interact with a web page (create a game ladder for leages and such)? I know it is possible.
"To wonder is to begin to understand"
|
|
|
|
|
You can make a program that *generates* a webpage.
If you use IIS it could be an IISAPI filter written in VC, or a COM Object (used from an ASP page).
You could also just write the code in ASP (scripting).
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
If you're just creating the page, then you can generate HTML as text, and save the file out.
Write your HTML to the file just like you would do if you were hand editing (or make the HTML with your favorite editor, view it in Source, and cut and paste this into your program. Substitute your dynamic content, and just write the .HTM file like you normally would.
Couple tips:
I added an HTML line to cause the page to refresh every 5 minutes to show the most recent data automatically - it might be useful for your ladder page.
I found it useful on the page to substitute the default quote " as a parameter for single quotes - this stopped me from having to define all my commands with a lot of SIZE=\"%d\" etc. I could just do SIZE='%d' COLOR='%X'etc.
--Mark Terrano
www.ensemblestudios.com
(Creators of the Age of Empires series)
|
|
|
|
|
how can i put a Status Bar in a Dialog? i've tried using the same code as a FrameWindow from Document/View architecture, but it doesn't work. please help
|
|
|
|
|
I have a problem to read the client area and then create my clipping region.
I was doing MyDc->GetWindow()->GetClientRect(&MyRect); but when I'm printing... this function do not work... so How can I get all the client area of the Dc...
any help
Thanks
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
you can try using CClientDC to get ONLY the Client Area
|
|
|
|
|
Hello,
[1]
I detected the following problem with the COleDateTime ==, <, >, <=, >= operators.
A COleDateTime object is internally represented by a double. So, when comparing two COleDateTime's it is in fact two doubles that are being compared and this means trouble.
I saw that 2 COleDateTime's that were perfectly equal (in human readable format) were indicated as not equal with the COleDateTime == operator.
Solution is to do the comparing yourself based on a stringcompare of the COleDateTimes.
These are the function's that I am using now.
BOOL DatesEqual(COleDateTime &odt1, COleDateTime &odt2)
{
CString str1 = odt1.Format();
CString str2 = odt2.Format();
return (!str1.Compare(str2));
}
BOOL DateSmallerThan(COleDateTime &odt1, COleDateTime &odt2)
{
if (DatesEqual(odt1, odt2)) return FALSE;
else return odt1 < odt2;
}
BOOL DateGreaterThan(COleDateTime &odt1, COleDateTime &odt2)
{
if (DatesEqual(odt1, odt2)) return FALSE;
else return odt1 > odt2;
}
BOOL DateSmallerThanOrEqual(COleDateTime &odt1, COleDateTime &odt2)
{
if (DatesEqual(odt1, odt2)) return TRUE;
else return odt1 < odt2;
}
BOOL DateGreaterThanOrEqual(COleDateTime &odt1, COleDateTime &odt2)
{
if (DatesEqual(odt1, odt2)) return TRUE;
else return odt1 > odt2;
}
[2]
Another aid in programming more accurate when using COleDateTimeSpan's is the following.
Suppose you want to produce a sequence of 15 minute ColeDateTime's, starting at some point in time. Normally, one would program this something like:
COleDateTimeSpan span;
span = COleDateTimeSpan(0,0,15,0);
ColeDateTime StartTime, DateTimeWalker;
StartTime = ...;
DateTimeWalker = StartTime;
for(int i=0; i<NR_OF_QUARTERS; i++)
{
...
DateTimeWalker += span;
}
However, it is more accurate to replace the body of the loop by:
{
COleDateTimeSpan dtsSpan(0,0,i*15,0);
COleDateTime TimeToUse = StartTime + dtsSpan;
...
}
This way, no error is accumulated during the loop, resulting in an almost perfect value for the variable TimeToUse even for the last loop iteration.
Anyone (dis)agrees with this?
Other ideas?
Bye
Geert
|
|
|
|
|
Sounds good to me. Anytime you work with floating point numbers, error accumulation is a problem.
|
|
|
|
|
Please, answer the topic question. The task is to change a window style for region (regions) of a dialog (window, as you wish). for example some part of window is lowered and another is rised (ore something else).
Is it possible in principle without creating addtional controls???????????????????????????
|
|
|
|
|
If you mean window's styles, like WS_DLGFRAME, you can't apply the style to regions of a single window.
What you can do is creating multiple windows, each one with a different style, then define a window region for each one, and handle messages like WM_MOVE as if they all were a single window. See SetWindowRgn() on MSDN.
That's a hard task however!
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Use the API function DrawEdge
Use the following flags to do your stuff :-
BDR_RAISEDINNER
BDR_SUNKENINNER
BDR_RAISEDOUTER
BDR_SUNKENOUTER
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
|
Hi all,
I'm writing Dialog-based program,
I loaded toolbar in my program, toolbar now in top and left on the dialog as default ...
How can i put it in top and right on my dialog ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have a dialog box that works perfect in debug. But when i build it in release and the dialog box does will not show. I do not get any errors. Any body have any idea how i can debug this problem.
thank you
|
|
|
|
|
You need to build your release version with debug symbols. Goto your project settings, select the release version.
In the C/C++ tab put the debug info to the level required (usually maximum)
In the link tab select the debug category and enable debug info.
You should then rebuild your project. At the call to DoModal() step into the code and see why its failing.
Usually the problems between debug/release can be down to the debug version initialising variables to 0. This does not happen in the release version, so you should check that variables have been inialised correctly.
Roger Allen the man
|
|
|
|
|
thank you for the reply but i am having a problem with the debug settings.
I do not have a maximum for debug info
all i have is
none
line numbers only
c7 compatible
program database
program database for edit and continue
I have tried all settings and the program will not compile correctly or when i run it i get a message " No Debug Info..."
these are my settings
/nologo /MD /W3 /GX /ZI /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"Release/ildococx.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c
thank you again
|
|
|
|
|
I wanted to get a checksum of a file.
when I wrote the following function with "#define READ_BUFFER_SIZE 1024"
It didn't get the right checksum for very big files.
I changed it to "#define READ_BUFFER_SIZE 2048"
and it worked!
can anyone please explane the reason for it?
then you.
Aviv.
BOOL FileCheckSum(CString FileName, unsigned long *Sum/*UINT32 * Sum*/)
{
#define READ_BUFFER_SIZE 2048//1024
FILE *fp;
char DataBuffer[READ_BUFFER_SIZE];
INT32 length;
fp=fopen(FileName,"r");
if(fp==NULL)
return FALSE;
*Sum=0;
while(!feof(fp))
{
/* Reset the data buffer before reading */
for(int i=0;i<read_buffer_size;i++)
databuffer[i]="0;
" length="fread(DataBuffer,1,READ_BUFFER_SIZE,fp);
" while="" (length="">0)
{
if(DataBuffer[length]=='\n')
*Sum += '\r'; //need to add CR to count for every LF since MC does it
*Sum += DataBuffer[--length];
}
}
/* Add 1 to the calculated CheckSum (agreed with the BMDS) */
*Sum += 1;
fclose(fp);
return TRUE;
#undef READ_BUFFER_SIZE
}
avivhal
|
|
|
|
|
I wanted to get a checksum of a file.
when I wrote the following function with "#define READ_BUFFER_SIZE 1024"
It didn't get the right checksum for a certain very big file(it worked fine for smaller files).
I changed it to "#define READ_BUFFER_SIZE 2048"
and it worked for the very big file as well!
can anyone please explane the reason for it?It shouldn't metter what the size of the buffer is ,so I don't understand.maybe it's a bug in the OS?!
thank you.
Aviv.
BOOL FileCheckSum(CString FileName, unsigned long *Sum)
{
#define READ_BUFFER_SIZE 2048
FILE *fp;
char DataBuffer[READ_BUFFER_SIZE];
INT32 length;
fp=fopen(FileName,"r");
if(fp==NULL)
return FALSE;
*Sum=0;
while(!feof(fp))
{
/* Reset the data buffer before reading */
for(int i=0;i<read_buffer_size;i++)
databuffer[i]="0;
" length="fread(DataBuffer,1,READ_BUFFER_SIZE,fp);
" while="" (length="">0)
{
if(DataBuffer[length]=='\n')
*Sum += '\r'; //need to add CR to count for every LF since MC does it
*Sum += DataBuffer[--length];
}
}
/* Add 1 to the calculated CheckSum (agreed with the BMDS) */
*Sum += 1;
fclose(fp);
return TRUE;
#undef READ_BUFFER_SIZE
}
avivhal
|
|
|
|
|
I forgot a line in the function so here it is..........:
I wanted to get a checksum of a file.
when I wrote the following function with "#define READ_BUFFER_SIZE 1024"
It didn't get the right checksum for very big files.
I changed it to "#define READ_BUFFER_SIZE 2048"
and it worked!
can anyone please explane the reason for it?
then you.
Aviv.
BOOL FileCheckSum(CString FileName, unsigned long *Sum)
{
#define READ_BUFFER_SIZE 2048
FILE *fp;
char DataBuffer[READ_BUFFER_SIZE];
INT32 length;
fp=fopen(FileName,"r");
if(fp==NULL)
return FALSE;
*Sum=0;
while(!feof(fp))
{
/* Reset the data buffer before reading */
for(int i=0;i<read_buffer_size;i++)
databuffer[i]=0;
length =="" fread(databuffer,1,read_buffer_size,fp);
while="" (length="">0)
{
if(DataBuffer[length]=='\n')
*Sum += '\r'; //need to add CR to count for every LF since MC does it
*Sum += DataBuffer[--length];
}
}
/* Add 1 to the calculated CheckSum (agreed with the BMDS) */
*Sum += 1;
fclose(fp);
return TRUE;
#undef READ_BUFFER_SIZE
}
avivhal
|
|
|
|
|
VC++ : multi-language application with resource DLL
Hello !
I would like to create a VC multi-language application with language
resource DLL.
It's very easy for the main program, there is many exemple.
In the function CxxxApp::InitInstance() I add :
HINSTANCE hRes = NULL;
LoadLibrary("languFR.dll");
if(hRes)
AfxSetResourceHandle(hRes);
But my program use DLL and when I try to load a resource DLL into a DLL, my
software lose its string table !
Could you help me ?
|
|
|
|
|
Hi,
I have created a class derived from CListBox but when I use the CWnd::GetStyle() method (inside or outside my class), I can't see if my listbox has a border or not... is it a bug from Visual C++ 6.0 ?
I also used ::GetWindowLong() function, but the result is the same.
Thanks in advance.
|
|
|
|