|
OnInitDialog() is derived from the Base class CDialog. It's used to do any special initialization required to display the form. For instance, if you have a dropdown(DD) controlling two groups of radio buttons. Item0 in the DD displays the left hand radio buttons hides the right hand; while, item1 in the DD displays the RHS and hides the LHS.
http://msdn.microsoft.com/en-us/library/fwz35s59(VS.80).aspx
It's supposed to perform these operations BEFORE the form is displayed - in my instance, the code there is being executed AFTER I press OnOK().
It's gotta be some stale OBJ code in the project I'm working on that's causing it to refer to the wrong address locations.
Anyone else have a similar experience?
|
|
|
|
|
Right, I know how the method works. My point was, I couldn't tell
from the code you posted which dialog class you were referring to,
or how and where you are creating the dialog.
The system sends the WM_INITDIALOG message before the dialog is displayed
so it shouldn't be related to your code.
Do you have corrupt or outdated debug info hanging around somewhere? Have you cleaned
the project's intermediate and output files by hand before a full rebuild?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
OK, sorry. Misunderstood you there.
Do you have corrupt or outdated debug info hanging around somewhere?
That's been my theory all along. It's strange because I cleared all objs by hand yesterday.
I was just able to get it to clean up. There's something majorly wrong with the project I'm working in.
I actually tried all those methods:
Deleted OBJs by hand, performed "Clean Solution", Compile each project singularly via the solution explorer, 'Re-build', etc.
What I finally did was go directly to the offending file, select it and click 'Compile.' Then I right clicked on the project the file is a part of and did a "Build". Then I did a "Build Solution", debug 'Start' and performed the operations. Problem solved.
There's definitely a problem with the project settings if all files are not kept up to date WRT edit times vs compile times.
|
|
|
|
|
Cool thanks for the update!
I know I've had a similar problem in the past - I think I
gave up and re-created the project from scratch. It hasn't
happened since VS 2003 for me thankfully
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please help me how to store an image into Ms Access with Visual C++ 2005.
ANd how to retrieve the image from database (Ms Access)?
thank in advance
|
|
|
|
|
Have you searched this forum for "access blob"?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
thx DavidCrow, following ur sugestion i searched "access blob", but all is in VC++6.0, that would be error in Visual C 2005 when i complide
|
|
|
|
|
hafini wrote: ...but all is in VC++6.0, that would be error in Visual C 2005 when i complide
That's just a result of the VS2005 compiler being more C++ compliant.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Sorry, i am stupid . I dont understand clearly what u said, could u explaint for me more detail?
In fact, some methods of VC++ 6 used in this case that is not correct way to be used in Visual C 5.
If u have ever do it with VC 2005, u have the solution in hand, could you told me?
|
|
|
|
|
Do you have an example of something that works with VS6 but does not work with VS2005?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here is two example:
the first eg:
CFileDialog m_ldFile(TRUE, ".bmp", m_sBitmap, OFN_HIDEREADONLY+OFN_OVERWRITEPROMPT,szFilter);
if i use VC6 compile it is okei, but with VC5 it is a trouble.
the second:
from source code posted on the following link
http://www.codeproject.com/KB/database/usingblob.aspx[^]
once again, i used VC6 compile it can run, while vc5 it showed two errors.
|
|
|
|
|
Thx David, i followed ur suggestion but all is in VC++6.0 that would be error when i used Visual C 2005 to complide.
|
|
|
|
|
I have a project that will need to call the GdiplusStartup / GdiplusShutdown pair about twice a second. Has anyone had experience doing this?
|
|
|
|
|
FossilDocent wrote: I have a project that will need to call the GdiplusStartup / GdiplusShutdown pair about twice a second.
Why? They only have to be called once per process.
Twice a second isn't much overhead but it's way more overhead
than necessary
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The code I am working with is part of a larger code base. The rest of the code is not using GDI+.
|
|
|
|
|
If performance is not an issue then making the calls every time
you use GDI+ is a valid solution.
What about adding init and cleanup functions that make the calls?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Performance is indeed an issue. I was hoping someone could tell me how much of a performance hit the code might take. Otherwise I will try to do some timing.
I guess I am being boneheaded. Could you elaborate on the init and cleanup functions you are referring to?
|
|
|
|
|
FossilDocent wrote: Could you elaborate on the init and cleanup functions you are referring to?
I mean add some functions (or methods to a class if appropriate)...
void InitGDIPlus()
{
GdiplusStartup(...
}
void CleanupGDIPlus()
{
GdiplusShutdown(...
}
These don't need to be called on the same thread. Just call
InitGDIPlus() once before using GDI+, and call CleanupGDIPlus()
once when finished with GDI+.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Once I call GdiplusStartup for my class, and before I call GdiplusShutdown, will other classes still be able to use non-GDI+ CDC drawing methods? If GdiplusStartup does not disable use of drawing such as
CDC *pDC;
pDC->LPtoDP(...);
pDC->MoveTo(...);
pDC->LineTo(...);
I can do just as you suggest.
|
|
|
|
|
Regular GDI is not affected in any way
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I just wrote some code to check it out. This should do the trick.
Thank-you!
|
|
|
|
|
Hello,
Till now, I used something like this for this problem:
karstamm::storesort(CString fn)<br />
{<br />
struct satz<br />
{<br />
char karnr[256];<br />
char karsort[256];<br />
char cr;<br />
};<br />
<br />
int k;<br />
satz aussatz;<br />
FILE *ausgabe;<br />
<br />
aussatz.cr = '\n';<br />
ausgabe = fopen(fn, "wt");<br />
if (first())<br />
{<br />
do<br />
if (getkarsort() != "")<br />
{<br />
strcpy(aussatz.karnr, getkarnr().c_str());<br />
strcpy(aussatz.karsort, getkarsort().c_str());<br />
k = fwrite(&aussatz, sizeof(aussatz), 1, ausgabe);<br />
}<br />
while(next());<br />
}<br />
fclose(ausgabe);<br />
}<br />
And it works fine, if I read it in my program to use it there again. But now, I want to export my data in CSV-format - and I have problems with the data-length and the default-characters. Is there any possibilty to export 2 CStrings like "abc" and "def" and get a text-file like "abc;def;"???
Many thanks in advance, GE
|
|
|
|
|
Gerhard-E wrote: Is there any possibilty to export 2 CStrings like "abc" and "def" and get a text-file like "abc;def;"???
No. I don't think that has been supported in any PCs since the Commodore 64
led mike
|
|
|
|
|
Thank you. Seem's, that I have to export chracter by character
But it's a great help for me, to have somebody else who says, that there is no easy way.
Thanks again, GE
|
|
|
|
|
Does the Commodore 64 support .NET?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|