|
wow
cool
thx to both of you
|
|
|
|
|
hi
you can take the variable of bstr type and assign variant to the bstr and then pass the bstr value in messagebox .
It works
cheers
|
|
|
|
|
If you know that the VARIANT contains a BSTR you can get the BSTR , which is really a special form of a wide-character string, and pass it to the wide-character version of MessageBox :
MessageBoxW( hWndParent, vtMyVariant.bstrVal, L"The Caption", ( MB_ICONINFORMATION | MB_OK ) )
(You could also pass in a dereferenced pbstrVal .)
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi..
I have a problem with my VC++ code,
the problem is i don't know how to send my calculation from Doc file to dialog file. I keep getting errors.
Here are my code in Dialog class :
void ImgViewerDlg::OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint)
{
CImgViewerDoc *pDoc =GetDocument();
ASSERT_VALID(pDoc);
sasa = static_cast<cstring>(pDoc->jarak);
m_Angle = sasa;
}
void ImgViewerDlg::OnApply()
{
UpdateData(TRUE);
CImgViewerDoc *pDoc = GetDocument();
ASSERT_VALID(pDoc);
sasa = m_Distance;
}
the errors are :
mgViewerDlg.obj : error LNK2001: unresolved external symbol "protected: class CImgViewerDoc * __thiscall ImgViewerDlg::GetDocument(void)" (?GetDocument@ImgViewerDlg@@IAEPAVCImgViewerDoc@@XZ)
maybe it something to do with the declaration of Doc class. please help me..I want to sent my calculation from Doc to view in textbox on a dialog.
Thank in advance.
mafuza
|
|
|
|
|
mafuza wrote:
void ImgViewerDlg::OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint)
Is this a CDialog or CView class ?
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
sorry late reply because internet connection down.
for your question the answer is CDialog class.
so any suggestion?
|
|
|
|
|
Defination for GetDocument is missing, Implement this in your ImgViewerDlg class and it should work fine.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Hello!
Can anyone tell me what is an easiest way to show some picture file (say .bmp) on dialog based application in Visual C++?
Best regards,
Rostfrei
|
|
|
|
|
Using CStatic would server your purpose.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
CStatic how? Can you please write 1 or 2 line of example code?
Regards,
Rostfrei
|
|
|
|
|
on you dialog editor, paste a bitmap control on your dialog... it is actually a CStatic control...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Check this[^]
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
I created 2 sliders in my dialog box. The problem now is that i can only set the range in whole number.eg (0-100). I need to set it in float .eg (0-1) Can anyone help me out?Below is part of my program.
BOOL GrowDialogBox::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_slider3.SetRange(0,1);
m_slider3.SetTicFreq(0.01);
m_slider4.SetRange(0,1);
m_slider4.SetTicFreq(0.01);
minnSliderPos = 0;
maxxSliderPos = 1;
// For displaying numbers on the box
s3.Format("%f",0); // Set it to 0 for min and 1 for max
m_EDIT3.SetWindowText(s3);
s4.Format("%f",1);
m_EDIT4.SetWindowText(s4);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
My warning received is
warning C4244: 'argument' : conversion from 'const double' to 'int', possible loss of data
|
|
|
|
|
First off, the control does not allow float parameter. Once this is known, you can stop trying to fit that square peg in that round hole.
What you will need to do, and I suspect other have done, is to scale your input to an appropriate integer range.
So lets say that you want your slider to show be in the range 0 - 0.1. Then what you can do is multiply all your values by 100, and set the slider range to be 0-100. Use the reverse technique when retrieving values from the slider (divide by 100, to get the true value).
Hope this helps
I Dream of Absolute Zero
|
|
|
|
|
Hi all!
Can you hepl me?
I have a problem When I compile my project.
my Project was written by MFC/Single Doc/View.
I use Window 2000 EN, and Visual C++ 6.0 EN.
My project was compiled to Release and Debug successfully.
In Window2000 EN,The Release version run very well. But it can't run In Window2000 JP.
However, The Debug version run in two the environments. Then I can use Break points.
Do you know the bug.
Thanhx you very much.
LiLiTrang
|
|
|
|
|
|
Have you taken care of your language resources ?
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
When I use the WriteConsole method I always get a "First-chance exception in FileBinary.exe (KERNEL32.DLL): 0xC0000005: Access Violation." in the output window within Visual Studio, however the text that I sent in the WriteConsole method appears correctly on the console window.
Does anyone know what I am doing wrong (I've attatched some sample code below which just sends an end of line to the console, AllocConsole has already been called elsewhere in my program)?
LPDWORD s = 0 ;
CString myStr = "\n" ;
HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ) ;
WriteConsole ( h,
myStr ,
myStr.GetLength ( ),
s,
NULL ) ;
cheers,
Andy
|
|
|
|
|
LPDWORD is a pointer. You need to pass a valid memory location to the WriteConsole function, not just a random pointer. Also, cast the CString to a LPCTSTR manually, before turning it into a VOID*.
DWORD s = 0 ;
CString myStr = "\n";
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsole(h, (LPCTSTR)myStr, myStr.GetLength(), &s, NULL);
|
|
|
|
|
thanks for your very quick reply, I'll give that a try.
Andy
|
|
|
|
|
I wants to crate Trial Version of My appliation.
Can anybody suggest a good way crate Trials.
storing information in registry is very unsafe.
please suggest any other option
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
Have a look[^].
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
|
Hello,
You know what the problem is all the trial software (from a business point of view)? They get cracked way to often. Why? Because the trial is the complete program, that has all the functionality locked by some registration technique.
I create the trial version of my app by building different configurations. Use the preprocessor to exclude functionality that you don't wan't in your trial version.
When the user registers, you can always give access to the full version on your website of whatever..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
They get cracked way to often.
I'd say always.
"Go as far as you can see,and when you get there you'll see further" - Unknown
|
|
|
|