|
The compiler is looking for precompiled header, ie, most probably stdafx.h.
Project Properties->(select student.cpp from left list)C/C++->Category->Precompiled Headers->Select Not Using Precompiled Headers.
There is no spoon.
suhredayan
|
|
|
|
|
Hi, I am a new comer of MFC, and here is my question:
I created a child window on the top of its parent window so its parent window is covered(both are derived from Cwnd). I wish I could bring the parent window to be visible any time by a button click even when the child window is still active. I tried to call:
parentwindow->BringWindowToTop();
but it does not work.
I am wondering maybe I just can't do so when its child window is still shown or not hiden. Anybody has any idea about this? Thanks in advance!
carl
|
|
|
|
|
1.The child window can't use DoModal(),you can use Create().
2.You can show child window hide,then the parent show all.
|
|
|
|
|
Thanks very much for the reply! But I am just wondering should i have to hide the child window first in order to show parent window? I have tried it and it seem it is the case! I wish I could make the parent window visible even without having to hide the child window because you may not know which child window is showing.
|
|
|
|
|
I am trying to have a thread constantly update data in a dialog box, nothing is working! How do you constantly update data in a dialog box as other processes are running?
DAVID
|
|
|
|
|
Add control type var,use SetWindowText() to change update data.
|
|
|
|
|
How are you trying to update the dialog data from another thread.
The suggested way is to post user defined messages with the parameter as new data to the dialog window, and write the message handler to update the dialog data itself.
There is no spoon.
suhredayan
|
|
|
|
|
I am attempting to post GPS coordinates from the GPS to the dialog box real time. A thread reads the GPS coordinates from the GPS unit and updates the current values in memory. Somehow I need to get those values to appear realtime in a dialog box!!!
|
|
|
|
|
maybe not real time but somewhere close to that ..... u can use timer function triggerd very millisecond!!!!!
well like said before u can define a variable like "BOOL m_update"(or something like that) and whenever this thread of ur is getting updating the data u can set the "m_update".....
since the timer is set every millisecond u can give a code that check if m_update is set or not and based on that update the datavariables to the dialog box.....and then use the command "UpdateDatA(FALSE)" to update that to the screen.....
ofcourse the best way again would be to use the PostMessage option.....to update the dialog rather than using the timer function.....
if u can make ur question a little more clear.....maybe i can hlp......
hope this helpz u out!!!!!
happy programming.....
cheerz
|
|
|
|
|
maybe not real time but somewhere close to that ..... u can use timer function triggerd very millisecond!!!!!
well like said before u can define a variable like "BOOL m_update"(or something like that) and whenever this thread of ur is getting updating the data u can set the "m_update".....
since the timer is set every millisecond u can give a code that check if m_update is set or not and based on that update the datavariables to the dialog box.....and then use the command "UpdateDatA(FALSE)" to update the dialog contents to the screen.....
ofcourse the best way again would be to use the PostMessage option.....to update the dialog rather than using the timer function.....
if u can make ur question a little more clear.....maybe i can hlp......
hope this helpz u out!!!!!
happy programming.....
cheerz
|
|
|
|
|
--------------------------------------------------------------------------------
I am trying to use urldownloadtofile to download a file from the net with comands for my prog so I need to do this in a cycle you know?
But I can't cause it only works once because after that ie stores the downloaded file in temporary internet foldes(cache) and I can't delete it from there, so I get the same file all the time.Is there any way to:
delete the file from cache or make urldownloadtofile not store it in cahce.
|
|
|
|
|
|
Call the Urldownload2file with the "dwReserved = 1 " this force to download from URL without checking the cache.
There is no spoon.
suhredayan
|
|
|
|
|
sollution that worked:DeleteUrlCacheEntry()
the other indeea didn't work for me but maby it works on other comps no hard feelings
but I still have a question:
is there an equivalent of DeleteUrlCacheEntry() for VBscript or a way to call this funcion from there maby?
if you know please answer, thank you in advance
|
|
|
|
|
making urldownloadtofile skip the caching
Hi,
I use urldownloadtofile function to get some data from the net(a file) and I need to read from this file all the time, every few seconds(because my program needs new instructions) but I can't use it more than once because then dumb windows caches that file and then I can't download it any more and I only get the same file because windows only downloads if it hasn't already cached it.
Is there any way to fix this problem? Thanks in advance
|
|
|
|
|
I've found plenty of examples for using Crystal Reports for .Net, but I just want to use it with regular MFC/C++. Does anyone know of any place that I can find some info on this? Using .Net, you can use the CrystalReportViewer control (which is great!). I'm hoping to find a way to use that control or a similar one from a non-managed MFC application. Any response is appreciated. Thanks!
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
I'm working on a trivial MFC SDI app that uses several dialogs, triggered by the menus or the view itself. I had one dialog functioning very well and then added another. Now I get the following error message when my app hits MyDlg.DoModal() :
Microsoft Visual C++ Debug Library:
Debug Error!
Program: E:\...
DAMAGE: after Normal block (#249) at 0x00326038.
(Press Retry to debug the application)
[Abort][Retry][Ignore]
The "normal block" number and memory address seem to reflect my memory usage, which makes some sense. For example, if I load several files into the program before attempting to open the dialog, the block number will jump about 1000 per file, as will the memory address.
I believe the only significant change was the addition of the second dialog. In my frustration, I've tried replacing the dialog class and copy/pasting the old code into the new class (with necissary changes). I still get the same error. The dialog is called from the app's view class; beyond that, I don't know what other info to provide.
I don't know what this error means or what caused it to appear. Thank you in advance for any help you can provide!
Help me! I have no idea what's happening! Please?
|
|
|
|
|
ps I'm a member, i really am! login was funky...
Help me! I have no idea what's happening! Please?
|
|
|
|
|
As far as I remember this message occurs if you overwrite the bounds of memory that you allocate.
I.E.
char *temp = new char [100];
for(l=0;l<200;l++)
char[l]='x';
will cause this message.
hope that helps.
|
|
|
|
|
I forgot to add...
delete [] temp;
/\
|
|----- this is when the error will be reported.
|
|
|
|
|
Very strange problem... Didn't find the cause, but I did find some ints in my data structures that were never initialized. After I initialize them, the dialog seems to work, so I'll go with it... Makes absolutely no sense...
Help me! I have no idea what's happening! Please?
|
|
|
|
|
Hi,
I am working on a small periodic table for my college friends. The idea of the application is that there will be a button for each element, placed in the same style as that of Modern periodic table. Now I have 2 options to implement this.
-> I must place more than 100 buttons on the Dialog and write event handler for each button.
-> or place buttons and write single event handler for all button.
What should I choose? Or suggest anything else I can implement.
Also, if I implement 2nd option, how I can detect which button is clicked
|
|
|
|
|
Check out ON_NOTIFY_RANGE() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
...Or check ON_COMMAND_RANGE, just make sure your buttons have subsequent IDs. Your handler will look like:
void MyApp::OnButton(UINT nID)
{
int nIdx = nID-IDC_BUTTON1;
// handle button by order index
}
Igor Green
http://www.grigsoft.com
Compare It! + Synchronize It! : Files and folders comparison never was easier!
|
|
|
|
|
Hi,
I'm having trouble displaying a picture by overriding OnPaint() method and putting the function SetDIBitsToDevice in there. Here's a bit of the code
<br />
void CProjectorFrame::ShowPattern()<br />
{<br />
m_bBlank = false;<br />
OnPaint();<br />
}<br />
void CProjectorFrame::OnPaint() <br />
{<br />
CPaintDC dc(this);
CRect rClient;<br />
GetClientRect(&rClient);<br />
<br />
if (m_bBlank)
{<br />
dc.SetBkColor(RGB(0, 0, 0));<br />
dc.ExtTextOut(0,0,ETO_OPAQUE, &rClient,0,0,0);<br />
return;<br />
}<br />
else<br />
{<br />
int val = ::SetDIBitsToDevice(<br />
dc,<br />
m_nXOffset, <br />
m_nYOffset,<br />
m_BitmapInfo.bmiHeader.biWidth, <br />
m_nImageHeight,<br />
0, <br />
0,<br />
0, <br />
m_nImageHeight,<br />
m_pImage, <br />
&m_BitmapInfo, <br />
DIB_RGB_COLORS );<br />
}<br />
}<br />
m_MyObject.ShowPattern();<br />
But the pattern doesn't display right after the call to ShowPattern(). I ran this through the debugger and everything seems to work fine. SetDIBitsToDevice actually returns that it set 768 lines, and all the code executes. I'm confused.
Thanks.
|
|
|
|