|
Hi, everyone!
When compiling a project in VC6.0. I find some errors
that say __FUNCTION__ is undefined. Is it a compiler
defined precompile directive? (I have only noticed __FILE__
and __LINE__ before.)
How to resolve the trouble?
Thanks in advance,
George
|
|
|
|
|
Thanks George2, I just discovered another useful macro. As for you question MSDN states that __FUNCTION__ is invalid when
a. outside of function body
b. /EP (Copy Preprocessor Output to Standard Output) or /P (Create Preprocessor-Output File) are used for compiler
|
|
|
|
|
Thanks, AlexO buddie!
Can you tell me what steps should I do if I
want to use it in VC6.0?
Cheers,
George
|
|
|
|
|
I give up (after 20 min) - could not make it work in VC6, Works great in VC7 though
|
|
|
|
|
Thanks, AlexO buddie!
George
|
|
|
|
|
the problem is simple .
i m tryin to encrypt n decrypt somehthing
to i allready have a pub n priv key .
to encrypt i typed CryptGetUserKey( ...) and i got hold of the priv key to encrypt.
to decrypt ...
i wanted the certificate so that i can get the public key .....
how do i do this ??
p.s : is the ciphertext always larger than the plaintext ?
thank you ,
Dmi3
|
|
|
|
|
Hi...I'm developing a graphical interface. The programs computes some values that are later shown in control boxes in the screen. The program does already that, but I was wondering if there is any way to format that output. That is if the program is displaying in a control box a numeric variable it shows 99.9999 and not 99.999999 (or whatever).
I'm using MFC to do most of the stuff, like showing and reading, and all the computations are mine. In the part where the values are shown, I'm calling UPDATE() with false, so to not read values, just show the values.
Thanks,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
Formatin output can be easily done when using CString::Format or sprintf. When searching MSDN for the latter one, you'll find appropriate documentation on how to set the precision of your output.
|
|
|
|
|
You can use
std::stringstream ss;
ss << std::setprecision(4) << YourVariable
m_Editbox.SetWindowText( ss.str().c_str() ); You can look up the other modifiers beside std::setprecision() in the Help. There is one for any need.
Or you simply use the old-fashioned way, from the days before C++ :
sprintf() or its wrapper in the CString class, Format() .
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Hi,
I've placed this code on the OnInitialUpdate
if(m_pdcMemory->GetSafeHdc() == NULL)
{
CClientDC dc(this);
OnPrepareDC(&dc);
m_pdcMemory->CreateCompatibleDC(&dc);
}
and on the OnPaint handler the following code.
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
OnPrepareDC(&dc);
CRect rectUpdate;
dc.GetClipBox(rectUpdate);
m_pdcMemory->SelectClipRgn(NULL);
m_pdcMemory->IntersectClipRect(&rectUpdate);
CBrush backgroundBrush(::GetSysColor(COLOR_WINDOW));
CBrush* pOldBrush = m_pdcMemory->SelectObject(&backgroundBrush);
m_pdcMemory->PatBlt(rectUpdate.left, rectUpdate.top, rectUpdate.Width(), rectUpdate.Height(),
PATCOPY);
OnDraw(m_pdcMemory);
dc.BitBlt(rectUpdate.left, rectUpdate.top, rectUpdate.Width(), rectUpdate.Height(),
m_pdcMemory, 0, 0, SRCCOPY);
m_pdcMemory->SelectObject(pOldBrush);
In the OnDraw I've included code to draw some stuff. but I'm unable to get any output any idea what the cause could be
|
|
|
|
|
Hello!
It's hard to tell without having the rest of the code. But I think you ought to set viewport / window origin. Because you use m_pdcMemory->IntersectClipRect(&rectUpdate); where rectUpdate is in dc coordinates.
You can comment this function to check it.
And if you use scrolling you must set viewport / window origin, otherwise you will always see only top / left part of your picture.
With regards,
Pavel Krupets
|
|
|
|
|
ThankQ for the suggestion I've removed the code
.......
//m_pdcMemory->SelectClipRgn(NULL);
//m_pdcMemory->IntersectClipRect(&rectUpdate);
........
But it still doesn't seem to work.
|
|
|
|
|
Hello.
Sorry I've just spotted an error. You have to create and select bitmap into your off screen DC. Because by default it has 1 by 1 pixel monochrome bitmap selected.
Example
HDC hDC = CreateCompatibleDC(hScreenDC);<br />
<br />
if (!hDC)<br />
return false;<br />
<br />
<br />
long nWidth = 0;<br />
long nHeight = 0;<br />
<br />
if (pszClient)<br />
{<br />
nWidth = pszClient->cx;<br />
nHeight = pszClient->cy;<br />
}<br />
else<br />
{<br />
nWidth = GetDeviceCaps(hScreenDC, HORZRES);<br />
nHeight = GetDeviceCaps(hScreenDC, VERTRES);<br />
}<br />
<br />
<br />
HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC, nWidth, nHeight);<br />
<br />
if (!hBitmap)<br />
{<br />
DeleteDC(hDC);<br />
return false;<br />
}<br />
<br />
<br />
m_hOldBitmap = SelectObject(m_hDC = hDC, m_hBitmap = hBitmap);<br />
<br />
return true;
With regards,
Pavel Krupets
|
|
|
|
|
ThanQ very much it's working now.
|
|
|
|
|
Hello!
Maybe someone knows books titles or papers / articles about multi-threaded software development. I mean structure development: where do I need to use synchronization or locking and where I don't need to use neither of them, and how to avoid interlocks.
Maybe there are some methods that can be used to simplify multi-threaded software development (building some diagrams or something).
I used to develop small applications with 2 threads and a few objects (that used simultaneously by different threads), but now I have to develop application with huge amount of objects managed by lots of threads. And it's hard to imagine and to envisage all possible communications and interactions.
With regards,
Pavel Krupets
|
|
|
|
|
I use the "advanced windows programming" from Jeffrey Richter and Microsoft press.
That book has a lot of examples, explanations... related to multithreading.
Hope this helps...
|
|
|
|
|
How can we call a "SDI canvas form" from a dialog box ??
ie. if we select a SDI project and we want to invoke some dialog boxes and then SDI canvas form
How to proceed ??
|
|
|
|
|
Well, I'm not really sure what you want to do ...
but
How can we call a "SDI canvas form" from a dialog box ??
sounds like you've a dialog box and from there want to open a document. If yes, this could be done by calling OpenDocumentFile from you CSingleDocTemplate that's used to handle your documents.
If you rather want to display dialogs when a document gets opened, you can implement OnOpenDocument/OnNewDocument of your CDocument derived class and invoke your dialogs.
|
|
|
|
|
I Have Visual C++ .NET Standard (version 2002, Spanish), if i create a new project (based on CView, with Print and Print Preview support), or import old VC6 projects, when i activate the print preview and then zoom in, everything seems to go OK, but if i push the 'Next Page' button, the preview moves to the left, and if you scroll down the preview, the part of the preview that appears, do it centered, so the preview is shown broken. Does anybody notice this bug or occurs only in my version of MFC 7.0 ?, Any solution?. Thanks in advance.
|
|
|
|
|
:-OI developed form on SDI canvas. Suddenly I remembered to add a dialog box before that. i.e
I need a dialog box(sort of password screen) and then that SDI form shall appear. Is there any way to do it ??
Please comment !
|
|
|
|
|
Insert your dialog code somewhere in your applications InitInstance() , before creation if the FrameWnd.
At this point is not much of the framework (like Doc, View) already running, but for a login dialog this should be no problem.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I want to write a program need to read some doc file, but I don't have office, who can tell me how to get the text content of the word doc?
thanks
|
|
|
|
|
- suggestion 1 : try to open a .doc document with notepad. You'll figure out the content is actually clearly displayed (without all the formatting).
- suggestion 2 : use OLE/DocViewer to figure out the storage/Stream hierarchy from the .doc internal, then it's easy to grab a code from somewhere which opens a given IStorage/IStream and reads its content.
- suggestion 3 : buy a third-party lib for a couple bucks.
|
|
|
|
|
I need to insert "Control List" in SDI view . Where do I have to place code to add columns in that control List ??
|
|
|
|
|
If you mean the standard list control, derive your view from CListView , and add columns in the view's OnInitialUpdate() function.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
Hi! I'm a sig virus. Attach me to the end of your sig to help me take over the world!
|
|
|
|