|
please suggest ur ideas??
|
|
|
|
|
If you could make it do syntax coloring, that would be very cool.
|
|
|
|
|
I can see where creating even a small text editor could be helpful. It can be very instrumental in getting experience dealing with primitive text layout (fixed vs. variable width fonts), carets, word wrap (or not to wrap), auto-indention including spaces vs tabs, syntax highlighting and a wide range of other text related stuff.
You could do something nifty like displaying comments containing FIXME, TODO and other such tags in a different color. Something small that utilizes functionality you would already need to implement but makes it stand out a little more.
I guess the big question is how much time do you have to implement it and how functional does it have to be?
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
i have around 8 months to complete my project!!
|
|
|
|
|
The big feature I see missing from a lot of IDE's is syntax highlighting of USER-DEFINED TYPES.
Say I have a class called Foo, and I instantiate an object of type Foo...
int theInt;
Foo theFoo;
Of course that greatly complicates things as you would need to find every single user-defined type (including types defined in windows headers, etc). This then leads me to think - why the hell DOESN'T Visual Studio have this feature? It would be incredibly simple to implement, given that Intellisense already does the hard part of identifying user-defined types...
|
|
|
|
|
Starting with Visual Studio 5 you can edit the usertype.dat file (found in the same directory as msdev.exe) to add custom keywords. The "User Keyword" setting in the "Fonts and Colors" configuration can be used to change the color of these keywords (all custom keywords are the same color). Technically you should be able to create a plugin which scans either the class view data or browser file and automatically updates this file. Later versions of Visual Studio provide additional support for custom languages and syntax highlighting.
http://msdn.microsoft.com/en-us/library/bb166778(VS.80).aspx[^]
[Correction: for later versions of VS it's devenv.exe instead of msdev.exe]
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
I'm aware of this, but the typical project is going to have a large number of classes and other user-defined types... So it's somewhat inconvenient to manually edit a file every time you add a new one.
Not to mention the fact that these settings are global and will be applied regardless of which project you're working on, so you may have types appearing with syntax highlighting even if they dont exist within the current project.
Someone needs to do something about that and make it dynamically updated in real-time, and if you're going to be writing a code editor for your final project, then why not implement such a feature?
|
|
|
|
|
When Create controls for a Modless Dialog
Durning which message is it best to do So
OnInitdialog or OnCreate
I meant which virtual functions ??
|
|
|
|
|
Dialog and associated child control initialization should be handled in OnInitDialog().
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
OnCreate is called just when the application requests that the Create function be called. So it is not guarenteed that the window is fully created. OnInitDialog is called after the window (in this case the dialog) is completely created.
When you are dynamically creating a control, you will specify its parent window handle and so it has to be created completely. So always do it in OnInitDialog as said in the previous answer.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
|
So what is your question?
Hint: No one here is going to write code for you.
|
|
|
|
|
|
One thing you're doing wrong is failing to say what exactly is not working about the program, and what you have done to try to fix it yourself.
|
|
|
|
|
|
What have you tried so far to fix it?
Take, "letterGrade" for instance. What do you think "redefinition; different type modifier" means?
|
|
|
|
|
|
Fair enough. Put in some effort on your own first, and then if you have specific questions, ask them.
|
|
|
|
|
|
Well, take the errors one at a time:
"Undeclared identifier" - Sounds like it has something to do with the variable declaration.
For tricky errors like "unknown override specifier" it is a big help to look up the error in the documentation. If you're using Visual Studio you can hit F1 while the cursor is over the error.
If you're not using Visual Studio, you can always google it.
My guess about that error is that you have mistyped the syntax of a function call, and the compiler is misinterpreting what you mean.
Make sure you have entered the ifstream function calls correctly.
Did you write this program, or was it handed out to you?
|
|
|
|
|
Richard,
I like your style....
Rozis
|
|
|
|
|
i want to use CDialog class in API
so i set the project "shared MFC dll"
and include afxwin.h
after, i add the dialog resource and add the class named CTestDlg
finally i code in Proc
"switch(iMessage)
{
case WM_LBUTTONDOWN:
{
CTestDlg dlg;
dlg.DoModal();
}
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}"
it had no error and run well
but when i click Lbutton ,it downs.
i debuged it
and it stoped at
"_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);
return afxCurrentResourceHandle; }"
why it isn't run?
and what should i do to run it?
|
|
|
|
|
At the very least you need to make a call to AfxWinInit() in your WinMain implementation. This will initialize the necessary MFC environment and if available the CWinApp (or your derived implementation). Keep in mind that using MFC on top of a Windows API application can be tricky at times depending on how extensively you use MFC.
while(false != m_OutOfCupcakes)
{
RefuseToWork(INFINITE);
}
|
|
|
|
|
Is there an easy way to find out what type of GDI object is referenced by HGDIOBJ handle i.e. is it a pen, brush, bitmap, font or region? I can't find WINAPI that does the job. Of course, I can always go the tricky way to determine the type of HGDIOBJ hTestedObj: create a dummy hDc, hPen, hBrush, hBitmap, hFont, hRegion; select these dummy objects into hDc, then compare the handle returned by SelectObject(hDc,hTestedObj) with hPen, hBrush, etc. The following code illustrates the idea.
const CHAR* GdiType(HGDIOBJ hTestedObj){
HDC hDc=CreateCompatibleDC(GetDC(NULL));
assert(hDc!=NULL);
HGDIOBJ hPen=GetStockObject(DC_PEN);
HGDIOBJ hBrush=GetStockObject(DC_BRUSH);
HGDIOBJ hFont=GetStockObject(ANSI_FIXED_FONT);
HGDIOBJ hBitmap=CreateCompatibleBitmap(GetDC(NULL),1,1);
assert(hBitmap!=NULL);
HRGN hRegion=CreateRectRgn(0,0,1,1);
assert(hRegion);
HGDIOBJ hTemp=NULL;
hTemp=SelectObject(hDc,hPen);assert(hTemp!=NULL);
hTemp=SelectObject(hDc,hBrush);assert(hTemp!=NULL);
hTemp=SelectObject(hDc,hFont);assert(hTemp!=NULL);
hTemp=SelectObject(hDc,hBitmap);assert(hTemp!=NULL);
hTemp=SelectObject(hDc,hRegion);assert(hTemp!=HGDI_ERROR);
const CHAR *szRet="?";
hTemp=SelectObject(hDc,hTestedObj);
assert(hTemp!=NULL && hTemp!=HGDI_ERROR);
if(hTemp==hPen)szRet="PEN";
else if(hTemp==hBrush)szRet="BRUSH";
else if(hTemp==hFont)szRet="FONT";
else if(hTemp==hBitmap)szRet="BITMAP";
else if(hTemp==hRegion || hTemp==(HGDIOBJ)SIMPLEREGION ||
hTemp==(HGDIOBJ)COMPLEXREGION ||
hTemp==(HGDIOBJ)NULLREGION)szRet="REGION";
DeleteObject(hBitmap);
DeleteObject(hRegion);
DeleteDC(hDc);
return szRet;
}
But this technique seems somewhat awkward (though it works). Perhaps, there is an elegant way to do the same thing?
|
|
|
|