|
James,
The GetParent()->ShowWindow(SW_HIDE) does the trick, thanks.
How would I modify the Sheet's style after creation to have WS_POPUP without WS_SYSMENU? I assume I would do it in it's OnInitDialog()?
Thanks,
Bob
|
|
|
|
|
I've got it, it's ModifyStyle (WS_SYSMENU, 0) in the Sheet's OnInitDialog.
Thanks for your help.
Bob
|
|
|
|
|
why not just have whatever called the CPropertySheet call the dialog whenever it returns?
if (MySheet.DoModal() == ID_WIZFINISH)
{
dialogB.doModal();
}
if you have a good reason then ignore my question
-dz
|
|
|
|
|
Since i'm new here i don't really know if you use to check old topics... if not, check this one and help me please:
http://www.codeproject.com/script/comments/forums.asp?msg=180313&forumid=1647&kw=phoenix#xx179201xx
Stay cool :p
Phoenix
|
|
|
|
|
I have a worker thread that is carelessly updating the status bar. It's causing a GPF. This involves a large complex application framework, which isn't easily changed. I would like to change my MFC status bar code to be thread safe. Is there a way to do this? Would this work: Have the status bar store a HWND, and whenever accessed, construct a CStatusBar FromHandle?
|
|
|
|
|
Create a user defined message and make the thread post it from time to time to the main application thread (i.e the one that owns CMainFrame). Then all the updated will be done by the thread that owns the status bar.
In that message you will send the completion percent (10%, 20%). Read this article by Joseph M. NewCommer: Using Worker Threads
Best regards,
Alexandru Savescu
|
|
|
|
|
Is there an easy way to determine if I'm in a worker thread vs the main thread? I tried calling:
if( AfxGetMainWnd() )
expecting that it would return NULL if it was the worker thread, based on an article by NewComer on CodeProject. However, it didn't return null in the worker thread. Any ideas?
|
|
|
|
|
hi
when i tried to declare an object that take CString constructor as follow:
Group groupA("France", "Senegal", "Uruguay", "Denmark");
it just give me this error:
: error C2059: syntax error : 'string'
and this is my constructor implementation:
Group::Group(CString t1,CString t2, CString t3, CString t4)
{
team.Add(t1);
team.Add(t2);
team.Add(t3);
team.Add(t4);
}
and i've tried this one also and by the way what is LPCTSTR??
Group::Group(LPCTSTR t1, LPCTSTR t2, LPCTSTR t3, LPCTSTR t4)
{
team.Add(t1);
team.Add(t2);
team.Add(t3);
team.Add(t4);
}
What is going on??? Thanks heap for you help
|
|
|
|
|
Hm, maybe there's a problem with the team member variable. How it is defined?
A LPCTSTR is a const pointer to an ASCIIZ string. If it's really ASCII/ANSI or Unicode depends on your compiler settings.
Martin
|
|
|
|
|
looks like you're using a type called "string" somewhere, but you haven't #include'd the appropriate header.
where does the syntax error occur??
LPCTSTR is a pointer to an array of TCHARs. a TCHAR is some character type (char, wchar, etc) depending on your build settings.
-c
"Should you not have a ramekin of sea salt beside the stove, you don’t deserve oatmeal."
Dean Allen
|
|
|
|
|
The code
Group groupA("France", "Senegal", "Uruguay", "Denmark"); is not passing CString objects to the constructor.
This code
Group groupA(CString("France"), CString("Senegal"), CString("Uruguay"), CString("Denmark")); is.
The code
Group::Group(LPCTSTR t1, LPCTSTR t2, LPCTSTR t3, LPCTSTR t4) should work unless team.Add(...) is also wanting a CString object.
Hope this helps...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
LPCTSTR = Long Pointer Constant To String Portable for UNICODE.
If you use the CString constructor you must pass CString objects not a char*
You can cast them directly
Group (CString ("France"),...)
but it is not worth it becasuse it will create some useless objects.
Use LPTSTR = Long Pointer To String Portable for UNICODE. You can see it is not a constant.
Best regards,
Alexandru Savescu
|
|
|
|
|
yeah, i understand it now. however it keeps produce another error.
this my class definition for the Group Class
class Group
{
public:
Group::Group(CString t1, CString t2, CString t3, CString t4);
CString Group::GetTeam(int i);
void Group::PutResult(int t1, int s1, int t2, int s2);
void Group::GetLadder();
private:
CStringArray team;
int res[4][4];
};
and this is my implementation for the constructor:
class Group
{
public:
Group::Group(CString t1, CString t2, CString t3, CString t4);
CString Group::GetTeam(int i);
void Group::PutResult(int t1, int s1, int t2, int s2);
void Group::GetLadder();
private:
CStringArray team;
int res[4][4];
};
and this is how i used it in the Doc
Group groupA(CString("France"), CString("Senegal"), CString("Uruguay"), CString("Denmark"));
and this is the error it produces
unexpected 'class CString ('
Regard
|
|
|
|
|
1. It looks that you missed the copy paste thing. The implementation and the source code look the same [ ]
2. Why do you prefix the functions inside the class?
class A
{
int A::f (); // you can say int f()
}
Best regards,
Alexandru Savescu
|
|
|
|
|
yes indeed, i missed the copy and paste
the function looks like this:
Group::Group(CString t1, CString t2, CString t3, CString t4)
{
team.Add(t1);
team.Add(t2);
team.Add(t3);
team.Add(t4);
}
and thanks for the tips, i did not know it before since i've just been working with MFC for 1 week.
|
|
|
|
|
I have this line in debug window:
HEAP: Free Heap block 14993bc8 modified at 14993bf4 after it was freed
Can anyone tell me what is that exactly I what can I do to correct this error.
Tanks...
|
|
|
|
|
looks like you are writing past the end of the buffer. check all the places you write into the array and make sure your pointers are good.
-c
"Should you not have a ramekin of sea salt beside the stove, you don’t deserve oatmeal."
Dean Allen
|
|
|
|
|
BUG: Exceeding Max Error Value in BCP Can Give Unhandled AV
ID: Q151592
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft SQL Server version 6.0
--------------------------------------------------------------------------------
BUG#: 13310 (6.00)
SYMPTOMS
When a BCP (Bulk Copy Program) operation exceeds the max error setting, an unhandled exception can be encountered with the BCP executable. This is controlled by the (-m) switch of the BCP.EXE, which defaults to 10 errors. The error you will receive will look similar to the following:
HEAP: Free Heap block 25c17c8 modified at 25c1894 after it was freed
CAUSE
If the max error value is exceeded, the bcp_exec function attempts to free a memory block twice. In some cases this results in an access violation while in other cases it can simply corrupt application memory.
WORKAROUND
Eliminate the errors from the BCP operation so that the max error value is not exceeded.
STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server 6.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Keywords : kbprg SSrvBCP SSrvProg kbbug6.00
Version : 6.0
Platform : WINDOWS
Issue type :
Maxwell Chen
People say "No news is good news". Then, no bug is good bug!?
|
|
|
|
|
Martin Laporte wrote:
HEAP: Free Heap block 14993bc8 modified at 14993bf4 after it was freed
There is your answer: you freed a pointer (to a memory block) by using delete , delete[] , or free(...) , and then tried to use the pointer after that.
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Hi,
I am looking at a VC class that makes use of the Intel JPEG Library. The class is used to convert a BMP to jpeg.
My problem is the class only works with 24bit jpegs.
Is anyone familiar enough with JPEGS, to offer any advice on what is causing the dependency.
Cheers
Rich
|
|
|
|
|
does the Intel code read 8-bit JPEGs?
i use IJG's code. it works.
-c
"Should you not have a ramekin of sea salt beside the stove, you don’t deserve oatmeal."
Dean Allen
|
|
|
|
|
I was under the impression that JPEG supports only 24bit color?!?
Signature space for rent. Apply Within.
|
|
|
|
|
JPEG can support single-channel 8-bit grayscale images, too. and, JPEG supports images with up to 12-bits per channel.
-c
"Should you not have a ramekin of sea salt beside the stove, you don’t deserve oatmeal."
Dean Allen
|
|
|
|
|
I have an MFC application that appears to have a memory leak.
I read the article "Catching Memory Leaks" and placed the code in my application. Also used the MS example code to add some additional checkpoints inside the main loop of the program. The code executed inside the debugger for over 24 hours. There were no leaks detected. The memory usage reported by Task Manager was almost constant.
However, I took the same debug .EXE file and executed it on a Windows XP platform. After 24 hours the memory usage, as reported by Task Manager, increased by about 30MB and continued to increase the longer the program ran.
The program uses the GetBufferSetLength and ReleaseBuffer functions which are my primary suspects. The documentation for ReleaseBuffer is a bit cryptic. The CString to which they are applied though is declared in an OnTimer routine and definitely goes out of scope each pass.
Any ideas what I should try next? The biggest problem is not being able to do much in the way of diagnostics on the target system.
TIA...
>>>-----> MikeO
|
|
|
|
|
Have you tried setting up a remote debugging session?
Thta should help you track it down if its OS dependant.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|