|
a: i'd like to know what's the difference between vb and vcpp. with what is it better to start learing programing?
b: how is the Microsoft press's books as tutorials? r they good?
c: i got the vs 6. enterprise edition, is it worth something? ;)
joker
|
|
|
|
|
a/ It depends really. If you asked which is easier, it's VB. If you want to know which language is more powerful, it's VC. If you're willing to take the time to learn to program well, start with a well designed language. If you want to be a hack and get something running in a hurry, go with VB.
b/ Yes, absolutely. If you're going VC++, get their MFC book, as well as Stroustrup for a general language reference. Petzhold is probably less essential in the world of MFC, but still useful. There is a list of essential books on the site.
c/ Yes, it sure is. We will be sticking with VS 6 ( well, VC 6 ) at work and I am sure we won't be alone, at least for the interim. To know a cash value 2nd hand ( if that's what you're asking ) see what it's going for on ebay.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I thought I should share this experience with all you fellows out there, so as to save you some time:
In an ActiveX project, I had a dialog box popping up with an editable one column listctrl in it. If the user would enter improper data in the listctrl, it would pop
up a second dialog box which would specify the error. This second dialog box was launched from the EndLabelEdit function of the listctrl.
Now, if you would hit "enter" after modifying the ListCtrl item, the error dialog box would come up focused and nice, but if you would click out after modifying the listctrl item,
the dialog box would come out but with focus
on the parent dialog box and thus, things looking abit locked up.
Now, I replaced the 2nd dialog box with various versions of AfxMessageBox and they seem to all work, so I am not sure what the difference between a CDialog based dialog and an AfxMessageBox really is...
Since I wanted a fancy dialog box, I eventually ended up going with MessageBoxIndirect so I can add some icons to it, but had to give up on my much fancier
original dialog.
|
|
|
|
|
MFC dialogs are modeless dialogs, which then become modal.
Message boxes are modal dialogs.
Maybe this can explain things?
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hello,
New-B question.. I'm parsing a text file for a value.. when found I extract it and display it on a dialog box.. this works fine but the problem is it displays some garbage before and after the String.. Could this be because there is a carrage return before and after the falue in the text file? How can I remove the garbage and just display the string?
Thanks for any help!
Rob
|
|
|
|
|
|
I am using an asynchronous property in my ActiveX control to implement the background of my control.
What should I do to implement the property?
Is there any articles about the topic?
Thanks.
Maer
|
|
|
|
|
In the "OnCreate" funtion of the class "CInPlaceFrame" of a Server Application, there is a statement like this "m_dropTarget.Register(this)". Here are the comments from Microsoft:
// By default, it is a good idea to register a drop-target that does
// nothing with your frame window. This prevents drops from
// "falling through" to a container that supports drag-drop.
I can not see the funtion of the statement. If I remove the statement, my server application runs like before.
Maer
|
|
|
|
|
Why use the statement "EnableCompoundFile()" in the function "CMyServerDoc::CMyServerDoc"? Here, "CMyServerDoc" is a class derived from the class "COleServerDoc". My application is a MDI based server application.
Does it have anything to do with "COleServerItem"?
|
|
|
|
|
I have some simple questions about "NETRESOURCE":
1.What is the difference between "RESOURCE_GLOBALNET" and "RESOURCE_CONTEXT"?
What means "All network resources"(from MSDN) in the description of "RESOURCE_GLOBALNET"?
And What means "The network resources associated with the user's current and default network context. "(from MSDN) in the description of "RESOURCE_CONTEXT"?
2.If I specify the value "RESOURCEDISPLAYTYPE_SERVER" to "dwDisplayType " when calling "NPOpenEnum", then after the call to "NPEnumResource", I get several "NETRESOURCE"s. Can the value of "dwDisplayType" of the "NETRESOURCE"s (retrieved) different from "RESOURCEDISPLAYTYPE_SERVER"?
3.How can I check out whether a "NETRESOURCE" is a container that contains sub-"NETRESOURCE"s?
Use the flag "RESOURCEUSAGE_CONTAINER" or the flag "RESOURCEUSAGE_CONTAINER" & "RESOURCE_GLOBALNET"?
Thanks
Maer
|
|
|
|
|
I know this will be a silly question but it is driving me nuts. I need to both display and print symbols for hearts, diamonds, clubs and spades. No problem on the View, everything works just fine. What doesn't work is the print function. The symbols are output as empty blocks. I have delved into every help/resource I can find and have found nothing that works. This can't be difficult, but the solution isn't obvious (to me). Any help would be appreciated.
The essential code from the OnDraw() and set up logic is:
LOGFONT m_lf;
m_lc.lfCharSet = ANSI_CHARSET;
m_lc.lfPitchAndFamily = FIXED_PITCH | FF_DECORATIVE;
m_lc.lfQuality = PROOF_QUALITY;
strcpy(m_lc.lfFaceName,"Symbol");
// Create font for this view
m_SymbolFont.CreateFontIndirect(&m_lc);
CFont* xFont = pDC->SelectObject(&m_SymbolFont);
pDC->TextOut(xPos,yPos,wbItem,wbItem.GetLength());
Thanks
Too much poop - not enough toilets
|
|
|
|
|
|
I never did get an answer, but finally did solve the problem and thought I would share it in case someone else ever has the same problem.
// Original didn't work
m_lc.lfPitchAndFamily = FIXED_PITCH | FF_DECORATIVE;
// This works!!
m_lc.lfPitchAndFamily = DEFAULT_PITCH | TMPF_TRUETYPE;
The original displayed just fine, but on either print preview or actual printed output the symbols were replaced with empty "blocks".
The key was in specifying DEFAULT_PITCH instead of FIXED_PITCH - FF_DECORATIVE and TMPF_TRUETYPE did not have an impact on the results.
|
|
|
|
|
Hi..
I added a Windows message handler "OnLButtonDown" ... and I was wondering how will I know which control is being clicked (within that procedure of OnLButtonDown)....
Note: I cannot use the BNCLICKED (message handler) because it conflicts with the LButtonDown of the Dialog...
Thanks in Advance... Ciao!
|
|
|
|
|
If you want to capture a button being pressed, you would handle the BN_CLICKED message for that control within the dialog that holds it.
Alex
|
|
|
|
|
Hi.. I'm using a project whose baseclass is CFORMVIEW..
my question is HOW DO YOU CHANGE the COLOR of the FORM???
Thanks...
|
|
|
|
|
OnEraseBackground. Draw the colour you want here instead.
Alex
|
|
|
|
|
Hi ...
Sorry to ask you once again ...but I don't seem to understand your response.
Is this OnEraseBackground a windows message handler .. and where should I add such windows message handler (I only saw WM_ERASEBKGND on the CMainFrame)? And what's the command to change the color of the Form? Please, elucidate.
Thanks for the help. =)
|
|
|
|
|
I've just had a look, and the view *does* have WM_ERASEBKGND. There is no command, this is called whenever the area is erased and you will need to draw the background.
Something like this:
CRect rc;
GetClientRect(&rc);
pDC->FillSolidRect(&rc, RGB(255,0,0));
Alex
|
|
|
|
|
Oh.. didn't see that there was WM_ERASEBKGND.. coz the filter messages was to the default class:VIEW class instead of the window or child window.. so i didn't see it...
alex, thanks a lot...ciao...
|
|
|
|
|
Erasebackground will not completly solve your problem nor do I think it is the prefered method. Usesomething like this:
void CMainView::OnPaint()
{
CMainFrame* pFrame;
CPaintDC dc(this); // device context for painting
pFrame = (CMainFrame*)GetParentFrame();
CString s="Printing Library Demo Program";
pFrame->SetWindowText(s);
RECT rc;
CBrush cBr(RGB(255,255,0));
GetClientRect(&rc);
dc.FillRect(&rc, &cBr);
}
then to solve the control background problem use this:
HBRUSH CMainView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor==CTLCOLOR_STATIC)
{
HBRUSH hbr2=CreateSolidBrush(RGB(255,255,0));
pDC->SetBkMode(TRANSPARENT);
return hbr2;
}
return hbr;
}
Class wizard will make both overrides for you
Richard
ISS Software
Dallas Texas
|
|
|
|
|
I posted a message HERE a few days ago, but I have been unable to figure out a solution. I was hoping maybe you GURU's may have some helpful thoughts. The basic situation is as follows...
I have SDI formview based app. It runs fine when compiled in debug mode, and compiles fine in release mode. However, the release version, crashes before reaching the first line of CMyApp::InitInstance() when I attempt to run it. Turning off optimizations doesn't help and I am out of ideas on what to try next.
When I attempt to run to cursor on the first line of InitInstance, the debugger stops in "\Mfc\Src\Appmodul.cpp" on the following function.
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
When I press I run after that it pops up "Unhandled exception in MyApp.exe: 0x0000005: Access Violation", and the debug window, after I stop debugging, shows "First-chance exception in LU.exe (KERNEL32.DLL): 0xC0000005: Access Violation."
Any ideas, thoughts would be greatly appreciated.
- John
|
|
|
|
|
Do you have any static objects in your program? Or, is there any code in CYourApp constructor?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
No code in the constructor.
|
|
|
|
|
Check wether release version of this app links all other libraries in release version.
Furthermore - try to turn off incremental linking. I have one project which does not want to run (though this is the debug version which does not want to get up - release runs fine) if inremental linking is on...
|
|
|
|