|
I agree with Giorgi: Thinking C++ by Eckel is really good! Also, every programmer, no matter what language, should read two books by Steve McConnell: "Code Complete", and "Rapid Development" (IMHO).
Peace!
|
|
|
|
|
I dunno if this is the right palce for this but i'm new to this forum so bear with me.
So i finnaly got Visual studio.net 2003 and it's great i cannot believe how stupid i was to be sticking with visual studio instead of this. There's so many new things i can do with it, includinga form based application.
But here's the problem: I want to have some sort of a connection between different forms, have one form start another but when i try to run another form and launch it from a form by calling Application::Run(new newForm); i get the following message: "starting a second message que on a thread is illegal".
i can start a new form without getting this message, or any other error by calling either Application::Exit or Form::dispose, these both kill the old form's message que instanly and allow me to run a new form. the problem here is that the new form runs and closes imediately.
I really need my program to start new forms from another, lets say when a button is pressed so any ideas guys?
i have some of my own but i dunno how to implement them:
-having the form return a value to the winmain function and let the form creation be handled there, unfortunately i dunno how to have a form return a value
and writing a return 1 in the button's code won't help as the button is declared as a void function. besided since the form is a deiiferent application from the winmain the mesage won't know where to go.
-making an invisible window and letting that run and receive messages from forms an handle the creation. i think that SendMessage or similar funtions would work but the problem here is that since the form is an external app i dunno how to get the invisible's window handle
-starting a new thread whenever a new form is to be created, this might work ut it's too complicated and due to the architecture of my app i ould rather not use it.
-calling Form::StartDialog(new newForm); won't do the trick for me although it's recomended by the error message.
One other thing, whatever method you (hopefully) propose i would like it to include some sort of external function or callback that handles the form creation as in version 2 of the app i plan to have it receive it's messages through directplay rathr than them being sent by a form running on that putter (have forms creation messages sent by a remote putter and have a sort of clien-server app).
A method that just links forms together would also be fine, actually anything would be fine.
m$: It is normal for your screen to go blank and for your computer to restart itself several times
|
|
|
|
|
hi all
i want to know the exact and clear distinction between VS 2005 & VS.NET 2005??
1)since v can develop pure VS applications(i.e MFC & win32 which are unmanaged) in VS.NET 2005 ,what is the need for VS 2005???
2)can the applications developed in VS 2005 run in VS.NET 2005 ?
-- modified at 5:07 Thursday 29th December, 2005
|
|
|
|
|
I'm make a bitmap transparency use StretchDIBits() function. I must use ROP4 in StretchDIBits() function following sequence: SRCINVERT -> SRCAND -> SRCINVERT.
Can you help me a way to do this.
|
|
|
|
|
I am confused what part are u seeking help. Do u need complete executable code or is some arguments of StretchDIBits has befuddled you.
Best Regards,
|
|
|
|
|
|
if you are working on windows XP then you need to load the manifest file.
-Prakash
|
|
|
|
|
I have it listed in the solution explorer. But still it is not working.
Mr.Prakash wrote: load the manifest file.
Can you tell me how if it is not in the above manner.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I did not have this problem and didnt solve it but the other guy in my office had this problem but he was able to rectify the problem.
So i am sorry, i wont be able to give you the exact settings required. Apologies
-Prakash
|
|
|
|
|
Some body help.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Download the project and It might help u.
http://www.codeproject.com/shell/systemtray.asp
It it helps, do mention what was the reason so others might get benefit.
Best Regards,
|
|
|
|
|
Buddy this is about SystemTray. Do please read my problem.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Yeah I know its about SysTray thats I why requested u for downloading the project. It uses CImageList and loading the Icons from Shell32.dll Icons, the same way u r doing I guess. I hope u get a clear picture now
|
|
|
|
|
Ibraheem Khan wrote: loading the Icons from Shell32.dll Icons
I didn't see a word called Shell32.dll in the whole project.
Ibraheem Khan wrote: I hope u get a clear picture now
It got bleak
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
m_imglist.Create ( 16, 16, ILC_COLOR4 | ILC_MASK, 4, 1 );
m_imglist.Add ( ::LoadIcon ( NULL, IDI_INFORMATION ));
m_imglist.Add ( ::LoadIcon ( NULL, IDI_WARNING ));
m_imglist.Add ( ::LoadIcon ( NULL, IDI_ERROR ));
I hope this helps u a little.
You can see icons in Demo->Show Balloon->Icon(this is a combo box).
What are the icons u r using ?. in which header file they are declared.
|
|
|
|
|
|
I am new in vc++ world. I want to give a bit map on a button . I'm using CBitmapButton::LoadBitmap(); but it is not loaded.Giving error is:"Failed to load bitmap for normal image."
Can any one help by giving proper method to do that.
Thank to all THE CODE PROJECT users.
|
|
|
|
|
CBitmapButton myButton;
myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
CRect(10,10,100,100), pParentWnd, 1);
myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);
You must replace IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE with your own bitmap id's that you have imported or added to the project.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
But if I replace the parameter
"pParentWnd" by "this" the button is not showing. To Show that what I have to do?
------------------------------------------------------------------
CBitmapButton myButton;
myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), this, 1);
// Load the bitmaps for this button.
myButton.LoadBitmaps(IDB_UPU, IDB_DOWND, IDB_FOCUSF, IDB_DISABLEX);
------------------------------------------------------------------
plz help.
Thank u.
-- modified at 4:10 Thursday 29th December, 2005
|
|
|
|
|
Are you trying this in a dialog.
Do you already have a button. If so then you have to add a member variable for that button with type as CBitmapButton and then use AutoLoad(). And don't forget to set the ownerdrawn property to true.
m_YourBmpButton.AutoLoad(IDC_MYBUTTON, this);
and then set the images.
Perhaps you may not have to call AutoLoad(...) if you are adding a member variable.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
The problem is that since u r creating button in a function, so it will be allocated on stack. and as the function is returned back ,where u are creating a button, all items are pop out of the stack. So ur button will no longer exists. Either u make it(myButton) member of class or Create the CBitmapButton object on Heap.
The code for creating on Heap is:
<br />
CBitmapButton* myButton = new CBitmapButton;<br />
myButton->Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), this, 1);<br />
myButton->LoadBitmaps(IDB_UPU, IDB_DOWND, IDB_FOCUSF, IDB_DISABLEX)<br />
Plus u must call delete in ur destructor or the entry after the button is not required.
It hope it helps :P
-- modified at 4:33 Thursday 29th December, 2005
|
|
|
|
|
Ok I've got .
Very very Thanks
|
|
|
|
|
Still now I'm not geting the result.
PLz help.
I am using dialog base.
I take a button.
Then create member m_button of the button.
------------------------------------------------------------------
CBitmapButton m_button;//at constractor
-------------------------------------------------------------------
DDX_Control(pDX, IDC_BUTTON1, m_button);(at DoDataExchange)
-------------------------------------------------------------------
I've import bitmaps mamed IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE
then using ....
-------------------------------------------------------------------
m_button.LoadBitmaps("IDB_UPU", "IDB_DOWND", "IDB_FOCUSF", "IDB_DISABLEX");
-----------------------------------------------------------------------
Q1> How can i give the property "WS_CHILD|WS_VISIBLE|BS_OWNERDRAW".
Q2> If i use Autoload() then how i can give names of Bitmaps?
Very Very thanks.
|
|
|
|
|
Saday Sarkar wrote: CBitmapButton m_button;//at constractor
What's this.
You declared m_button in the constructor. You must do it in the header file.
using AutoLoad is easy. But I don't think you will need it. But any way here it is.
m_button.AutoLoad(IDC_BUTTON1, this/*parent window*/);
m_button.SetBitmaps(..........)
This should work.
Make sure that the button in the dialog has the ownerdrawn property set to TRUE
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Yes I've got.
I've not do"the button in the dialog has the ownerdrawn property set to TRUE "
Now ok.
Very Very Thanks.
|
|
|
|