|
savitri wrote: u all also from scratch only become expert in subjects ok. dont insert to freshers ok.
I amnot insulting you! I am a beginner too! thats why i refer you to teh online version of bruce eckel book!. one of the best book for C++.
Secondly, if you see, I don't have sixth vision, to visualise what all the function do! you have to show me the code before get answered!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
savitri wrote: i am studying
well, this is not what you said here[^]. You said you completed your BE in 2007, didn't you? And since you said you completed BE in 2007, I will assume that you already have a job.
savitri wrote: why u all are inserting too much
you mean to say 'insulting'?
savitri wrote: all are take some time to learn new things ok
And with your kind of approach, it will take even longer.
savitri wrote: dont insert to freshers
again, you mean 'insult'?
your communication skills are as poor as your knowledge on C++. Try improving both.
Regards,
Vijay.
|
|
|
|
|
Vijay, nice reply dude, but it would better if you send her the mail..!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
"If it were machines, the pair_programming seem to work, but for humans it is pair_crackdown that seems to work! " - Nisamudheen
Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
If you have MSDN installed (or online MSDN), you can check for error code C2666. Here's the explanation :
An overloaded function or operator is ambiguous. Formal parameter lists may be too similar for the compiler to resolve the ambiguity. To resolve this error, explicitly cast one or more of the actual parameters.
Your problem here is that there are several definitions of A_BUGFIX that can be used in that line, and the compiler doesnt know which one to use, so you need to hint the compiler.
|
|
|
|
|
uus831 wrote: Your problem here is that there are several definitions of A_BUGFIX that can be used in that line
And possibly the operator + is overloaded than A_BUGFIX, as the OP error message shows that the identifier of the error as '+'
OP wrote: error C2666: '+' :
|
|
|
|
|
|
Hi.
I was wondering if anyone knows how to retain the default button function on a dialog? After I push the cancel button, if I show the dialog again (showwindow), the OK button no longer has the default "status" and so pushing the return button after entering something into an edit box does not automatically push OK but Cancel now.
Is there a way that when I show the window,I force teh OK button to have teh default button status everytime?
Thanks in advance!
Stan the man
|
|
|
|
|
You can use the WM_NEXTDLGCTL message to move focus and default state to the pushbutton
you desire.
That, BTW, is the proper message to use to set focus to any dialog control.
See here[^] for details...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That was perfect, just want I need it.
Thanks,
Stan the man
|
|
|
|
|
|
may be "Static Text" control is useful.
|
|
|
|
|
And you can use "SetWindowText(..)" to do the same.
|
|
|
|
|
CWindow::Create!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi, guyz.
Hope you can help me with this one.
I'm encountering a problem using BitBlt. I might implemented it wrong, please help me check it.
code:
.h: static CBitmap m_bitmap;
OnDraw(CDC *pDC)
{
CDC BitmapDc;
CBitmap *old_bitmap;
BitmapDC.CreateCompatibleDC(pDC);
old_bitmap=BitmapDC.SelectObject(&m_bitmap);
// Drawing code here
BitmapDc.Rectangle(top,bottom,right,bottom);
.....................
....................
//******************************
// 1st
CBitmap bitmap;
CDC memDC;
bitmap.LoadBitmap(L"START_BITMAP");
memDC.CretaeCompatibleDC(pDC);
BitmapDC.BitBlt(top,left,right,bottom,&memDC,0,0,SRCCOPY);
//******************************
// another drawing code for lines
................
.................
pDc->BitBlt(top,left,right,bottom,&BitmapDC,0,0,SRCCOPY);
BitmapDC.SelectedObject(old_bitmap);
// end of code
From the above code, there's no problem work as expected. Image appears at the background of the lines.
But, if i use HDC instead of the bitmap, the image were not seen and has been overlapped by a white fill.
//******************************
// 2nd
CDC memDC;
memDC.Attach(m_hDC);
BitmapDC.BitBlt(top,left,right,bottom,&memDC,0,0,SRCCOPY);
//******************************
// m_hDC was returned from other class
What is the difference with the 2?
Why is the image were not seen using the 2nd code
}
|
|
|
|
|
TooShy2Talk wrote: old_bitmap=BitmapDC.SelectObject(&m_bitmap);
Before SelectObject(), have you created m_bitmap??? if not use CreateCompaitbleBitmap() to create the bitmap. And since the m_bitmap is a member variable, you should create it only once.
|
|
|
|
|
Yes, it was already initialized.
Upon debugging, I noticed the effect of the BitmapDC.Rectangle().
The fill color that cover the image was somehow related to the Rectangle fill.
Is it possible to create rectangle(BitmapDC.Rectangle()) without fill?
But when 1st code is used this is not happening.
Do you know why?
|
|
|
|
|
TooShy2Talk wrote: Is it possible to create rectangle
Yes use the Draw3dRect() function for that. I thing Selecting a NULL brush to the BitmapDC and then calling the Rectangle() function will also work.
|
|
|
|
|
I have tried using
BitmapDc.SelectBrush(NULL_BRUSH);
before creating the rectangle
BitmapDC.Rectangle(left,top,right,bottom);
but then the cover fill become black.
The image is still invisible.
|
|
|
|
|
TooShy2Talk wrote: BitmapDc.SelectBrush(NULL_BRUSH);
SelectBrush()?? Is there function like that in the CDC class?
How about Draw3dRect() function?
|
|
|
|
|
hi all,
this is my function, for this how can assign the value.please help me
BOOL CACR120RWBLOCK1Dlg::VerifyKeyA(int SectorNo)
{
VerifyKeyA = false;
}
i am getting this error.
error C2659: '=' : overloaded function as left operand
thanku all,
savitri,
|
|
|
|
|
What are you trying to do ? VerifyKeyA is a function, not a variable.
Ah, I think I know. You know some VB, but you don't know C++ ? You need to create a new variable to return. Also, you should use bool, not BOOL, which is just a macro for people using C ( which did not have bool ). BOOL is an int.
boolCACR120RWBLOCK1Dlg::VerifyKeyA(int SectorNo)
{
bool result = false;
// insert code here to set result to true if appropriate.
return result;
}
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Lets see if I can explain this.
I have an app.exe (basically a test app) which loads, via LoadLibrary, mainDLL (which exports c-style functions as an api) that uses libraryDLL which contains class definitions which are exported.
app.exe passes hInstance to mainDLL via DllMain. mainDLL uses classes defined in LibraryDLL. It appears that libraryDLL is loaded everytime an exported class is used by mainDLL (as expected I guess, but this isnt my confused point)
The problem is when libraryDLL gets hInstance, its always the handle of app.exe and not mainDLL. I need libraryDLL to use retrieve mainDLL handle and name because other files are used based on the mainDLL name.
Questions:
- How do I get libraryDLL to get the handle of mainDLL?
- libraryDLL is always loaded first. Can I control this? I'm guessing I cant since its not an api dll but exported classes
- Why does mainDLL return the handle of app.exe when I call GetModuleHandle(NULL) instead of the handle for mainDLL?
- Do I need a DLLMain in both mainDLL and libraryDLL?
If so, should I use hInstance? If so, hInstance is always of the wrong module so why use it?
Is it apparent I"m confused? ANy help or articles to read would be appreciated.
TIA
-C
|
|
|
|
|
Wheatbread wrote: Why does mainDLL return the handle of app.exe when I call GetModuleHandle(NULL) instead of the handle for mainDLL?
First read the MSDN well. it says
"If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file)."
The module handle of the mainDLL will be passed to the DllMain of the mainDLL ( HINSTANCE ). Save that HINSTANCE so that you can pass that value to the libraryDLL when need.
Another option is to use the below code to get the module handle
MEMORY_BASIC_INFORMATION stMemoryInfo; <br />
static int nAddress; <br />
if( !VirtualQuery( &nAddress, &stMemoryInfo, sizeof( stMemoryInfo ))<br />
!= 0 )<br />
{ <br />
return false; <br />
}<br />
HMODULE hModule = (HMODULE)stMemoryInfo.AllocationBase;
|
|
|
|
|
hi all,
in vb the function declaration is like this
Hex_Dec(val$, ByVal start As Byte) As Byte, how shall i declare the same fuction in VC++. please help me i am fresher.
thanku,
savitri
|
|
|
|
|
savitri wrote: Hex_Dec(val$, ByVal start As Byte) As Byte
What does this function do?
Maxwell Chen
|
|
|
|
|